diff --git a/project/StartScn.tscn b/project/StartScn.tscn index 0d965f7..ad26cf0 100644 --- a/project/StartScn.tscn +++ b/project/StartScn.tscn @@ -7,7 +7,7 @@ [ext_resource path="res://assets/dressup_title.svg" type="Texture" id=5] [ext_resource path="res://WinDialogs.tscn" type="PackedScene" id=6] -[node name="Start" type="Node"] +[node name="Start" type="Node" index="0"] script = ExtResource( 1 ) @@ -48,7 +48,6 @@ __meta__ = { [node name="MenuRf" type="ReferenceRect" parent="." index="3"] -editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -239,6 +238,7 @@ group = null text = "Modern" flat = false align = 1 +_sections_unfolded = [ "Pause" ] __meta__ = { "_edit_lock_": true } diff --git a/project/WinDialogs.tscn b/project/WinDialogs.tscn index f7869a2..8beb38b 100644 --- a/project/WinDialogs.tscn +++ b/project/WinDialogs.tscn @@ -3,18 +3,8 @@ [ext_resource path="res://src/WinDialogs.gd" type="Script" id=1] [ext_resource path="res://music/song.ogg" type="AudioStream" id=2] -[node name="WinDialogs" type="Control" index="0"] +[node name="WinDialogs" type="Node" index="0"] -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 script = ExtResource( 1 ) [node name="Music" type="AudioStreamPlayer" parent="." index="0"] @@ -29,6 +19,7 @@ bus = "Master" [node name="PauseWin" type="PopupDialog" parent="." index="1"] pause_mode = 2 +editor/display_folded = true visible = false anchor_left = 0.0 anchor_top = 0.0 @@ -160,6 +151,7 @@ align = 1 [node name="CreditsWin" type="AcceptDialog" parent="." index="2"] +editor/display_folded = true visible = false anchor_left = 0.0 anchor_top = 0.0 @@ -280,7 +272,6 @@ columns = 3 [node name="Languages" type="MenuButton" parent="SettingsWin/Grid" index="0"] -pause_mode = 1 visible = false anchor_left = 0.0 anchor_top = 0.0 @@ -311,7 +302,8 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_right = 65.0 +margin_left = 60.0 +margin_right = 125.0 margin_bottom = 24.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false @@ -327,6 +319,7 @@ group = null text = "KMUS" flat = false align = 1 +_sections_unfolded = [ "Pause" ] [node name="LicenseWin" type="AcceptDialog" parent="." index="4"] diff --git a/project/src/GameKit.gd b/project/src/GameKit.gd new file mode 100644 index 0000000..2de1c4f --- /dev/null +++ b/project/src/GameKit.gd @@ -0,0 +1,17 @@ +# Anthony Wilcox licenses this file to you under the GPL license. +# See the LICENSE file in the project root for more information. +extends Node + +func is_game_paused(is_paused): + if is_paused == true: + get_tree().paused = true + else: + get_tree().paused = false + +func switch_scenes(new_mode): + if new_mode == "classic": + get_tree().change_scene("res://ClassicScn.tscn") + elif new_mode == "modern": + get_tree().change_scene("res://ModernScn.tscn") + elif new_mode == "start": + get_tree().change_scene("res://StartScn.tscn") \ No newline at end of file diff --git a/project/src/GameScn.gd b/project/src/GameScn.gd index 86c9a7c..bff00a0 100644 --- a/project/src/GameScn.gd +++ b/project/src/GameScn.gd @@ -1,8 +1,8 @@ # Anthony Wilcox licenses this file to you under the GPL license. # See the LICENSE file in the project root for more information. -extends Node +extends "res://src/GameKit.gd" func _process(delta): if Input.is_action_pressed("ui_pause"): - get_tree().paused = true - $WinDialogs/PauseWin.show() + is_game_paused(true) + $WinDialogs/PauseWin.show() \ No newline at end of file diff --git a/project/src/StartScn.gd b/project/src/StartScn.gd index f5694df..8238689 100644 --- a/project/src/StartScn.gd +++ b/project/src/StartScn.gd @@ -1,12 +1,12 @@ # Anthony Wilcox licenses this file to you under the GPL license. # See the LICENSE file in the project root for more information. -extends Node +extends "res://src/GameKit.gd" func _on_ClassicBtn_pressed(): - get_tree().change_scene("res://ClassicScn.tscn") + switch_scenes("classic") func _on_ModernBtn_pressed(): - get_tree().change_scene("res://ModernScn.tscn") + switch_scenes("modern") func _on_ClassicBtn_mouse_entered(): $Modern.hide() diff --git a/project/src/WinDialogs.gd b/project/src/WinDialogs.gd index 802af02..5c7f0d4 100644 --- a/project/src/WinDialogs.gd +++ b/project/src/WinDialogs.gd @@ -1,16 +1,10 @@ # Anthony Wilcox licenses this file to you under the GPL license. # See the LICENSE file in the project root for more information. -extends Control - -func pause_zdressup(is_paused): - if is_paused == true: - get_tree().paused = true - else: - get_tree().paused = false +extends "res://src/GameKit.gd" func _on_ExitBtn_pressed(): - pause_zdressup(false) - get_tree().change_scene("res://StartScn.tscn") + is_game_paused(false) + switch_scenes("start") func _on_SettingsBtn_pressed(): $SettingsWin.show() @@ -32,4 +26,4 @@ func _on_MusicBtn_toggled(button_pressed): func _on_ResumeBtn_pressed(): $PauseWin.hide() - pause_zdressup(false) \ No newline at end of file + is_game_paused(false) \ No newline at end of file diff --git a/screenshot.png b/screenshot.png index 3c138de..cdfef7e 100644 Binary files a/screenshot.png and b/screenshot.png differ