diff --git a/project/ClassicGUI.tscn b/project/ClassicGUI.tscn deleted file mode 100644 index caacf43..0000000 --- a/project/ClassicGUI.tscn +++ /dev/null @@ -1,111 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://src/Interface.gd" type="Script" id=1] -[ext_resource path="res://WinDialogs.tscn" type="PackedScene" id=2] - -[node name="Interface" type="Control"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = -7.0 -margin_right = 40.0 -margin_bottom = 33.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="RefRect" type="ReferenceRect" parent="." index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 11.0 -margin_top = 16.0 -margin_right = 165.0 -margin_bottom = 128.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 - -[node name="VertContainer" type="VBoxContainer" parent="RefRect" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 4.0 -margin_top = 3.0 -margin_right = -3.0 -margin_bottom = -111.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -alignment = 0 - -[node name="ExitBtn" type="Button" parent="RefRect/VertContainer" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 147.0 -margin_bottom = 20.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "KEXT" -flat = false -align = 1 - -[node name="SettingsBtn" type="Button" parent="RefRect/VertContainer" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 24.0 -margin_right = 147.0 -margin_bottom = 44.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "KSET" -flat = false -align = 1 - -[node name="WinDialogs" parent="." index="1" instance=ExtResource( 2 )] - -[connection signal="pressed" from="RefRect/VertContainer/ExitBtn" to="." method="_on_ExitBtn_pressed"] - -[connection signal="pressed" from="RefRect/VertContainer/SettingsBtn" to="." method="_on_SettingsBtn_pressed"] - - diff --git a/project/ClassicScn.tscn b/project/ClassicScn.tscn index 1fb1302..fd6bac5 100644 --- a/project/ClassicScn.tscn +++ b/project/ClassicScn.tscn @@ -1,13 +1,11 @@ [gd_scene load_steps=7 format=2] -[ext_resource path="res://src/GameScreen.gd" type="Script" id=1] +[ext_resource path="res://src/GameScn.gd" type="Script" id=1] [ext_resource path="res://assets/classic_dress_up_bg.png" type="Texture" id=2] [ext_resource path="res://assets/lights.png" type="Texture" id=3] [ext_resource path="res://Zack.tscn" type="PackedScene" id=4] [ext_resource path="res://ClassicClothes.tscn" type="PackedScene" id=5] -[ext_resource path="res://ClassicGUI.tscn" type="PackedScene" id=6] - - +[ext_resource path="res://WinDialogs.tscn" type="PackedScene" id=6] [node name="GameScreen" type="Node"] @@ -34,6 +32,6 @@ __meta__ = { [node name="Clothes" parent="." index="3" instance=ExtResource( 5 )] -[node name="Interface" parent="." index="4" instance=ExtResource( 6 )] +[node name="WinDialogs" parent="." index="4" instance=ExtResource( 6 )] diff --git a/project/GUI.tscn b/project/GUI.tscn deleted file mode 100644 index 8bb4b22..0000000 --- a/project/GUI.tscn +++ /dev/null @@ -1,123 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://src/Interface.gd" type="Script" id=1] -[ext_resource path="res://WinDialogs.tscn" type="PackedScene" id=2] - -[node name="Interface" type="Control"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = -7.0 -margin_right = 40.0 -margin_bottom = 33.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="GMRefRect" type="ReferenceRect" parent="." index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 8.0 -margin_right = 800.0 -margin_bottom = 36.0 -rect_min_size = Vector2( 800, 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 -_sections_unfolded = [ "Anchor", "Grow Direction", "Margin", "Rect" ] - -[node name="GMenuHbox" type="HBoxContainer" parent="GMRefRect" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 10.0 -margin_top = 2.0 -margin_right = -10.0 -margin_bottom = -6.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -alignment = 0 -_sections_unfolded = [ "Margin" ] - -[node name="ExitBtn" type="Button" parent="GMRefRect/GMenuHbox" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 42.0 -margin_bottom = 20.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -custom_colors/font_color_disabled = Color( 0, 0, 0, 1 ) -custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_colors/font_color_hover = Color( 0, 0, 0, 1 ) -custom_colors/font_color_pressed = Color( 0, 0, 0, 1 ) -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "KEXT" -flat = true -align = 1 -_sections_unfolded = [ "custom_colors", "custom_constants" ] - -[node name="SettingsBtn" type="Button" parent="GMRefRect/GMenuHbox" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 46.0 -margin_right = 87.0 -margin_bottom = 20.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -custom_colors/font_color_disabled = Color( 0, 0, 0, 1 ) -custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_colors/font_color_hover = Color( 0, 0, 0, 1 ) -custom_colors/font_color_pressed = Color( 0, 0, 0, 1 ) -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "KSET" -flat = true -align = 1 -_sections_unfolded = [ "custom_colors" ] - -[node name="WinDialogs" parent="." index="1" instance=ExtResource( 2 )] - -[connection signal="pressed" from="GMRefRect/GMenuHbox/ExitBtn" to="." method="_on_ExitBtn_pressed"] - -[connection signal="pressed" from="GMRefRect/GMenuHbox/SettingsBtn" to="." method="_on_SettingsBtn_pressed"] - - diff --git a/project/GameScn.tscn b/project/ModernScn.tscn similarity index 76% rename from project/GameScn.tscn rename to project/ModernScn.tscn index fb33876..60787bf 100644 --- a/project/GameScn.tscn +++ b/project/ModernScn.tscn @@ -1,13 +1,13 @@ [gd_scene load_steps=7 format=2] -[ext_resource path="res://src/GameScreen.gd" type="Script" id=1] +[ext_resource path="res://src/GameScn.gd" type="Script" id=1] [ext_resource path="res://assets/modern_dress_up_bg.png" type="Texture" id=2] [ext_resource path="res://assets/icrazy_frame.png" type="Texture" id=3] [ext_resource path="res://Zack.tscn" type="PackedScene" id=4] [ext_resource path="res://Clothes.tscn" type="PackedScene" id=5] -[ext_resource path="res://GUI.tscn" type="PackedScene" id=6] +[ext_resource path="res://WinDialogs.tscn" type="PackedScene" id=6] -[node name="GameScreen" type="Node" index="0"] +[node name="GameScreen" type="Node"] script = ExtResource( 1 ) @@ -31,6 +31,6 @@ __meta__ = { [node name="Clothes" parent="." index="3" instance=ExtResource( 5 )] -[node name="Interface" parent="." index="4" instance=ExtResource( 6 )] +[node name="WinDialogs" parent="." index="4" instance=ExtResource( 6 )] diff --git a/project/StartScn.tscn b/project/StartScn.tscn index 648980d..0d965f7 100644 --- a/project/StartScn.tscn +++ b/project/StartScn.tscn @@ -7,11 +7,13 @@ [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" index="0"] +[node name="Start" type="Node"] script = ExtResource( 1 ) -[node name="ModernBG" type="Sprite" parent="." index="0"] +[node name="Modern" type="Node2D" parent="." index="0"] + +[node name="ModernBG" type="Sprite" parent="Modern" index="0"] position = Vector2( 400, 277 ) texture = ExtResource( 2 ) @@ -19,7 +21,7 @@ __meta__ = { "_edit_lock_": true } -[node name="WordrobeBG" type="Sprite" parent="." index="1"] +[node name="WordrobeBG" type="Sprite" parent="Modern" index="1"] position = Vector2( 492.609, 280.27 ) texture = ExtResource( 3 ) @@ -27,7 +29,7 @@ __meta__ = { "_edit_lock_": true } -[node name="ClassicBG" type="Sprite" parent="." index="2"] +[node name="ClassicBG" type="Sprite" parent="." index="1"] visible = false position = Vector2( 400, 277 ) @@ -36,7 +38,7 @@ __meta__ = { "_edit_lock_": true } -[node name="GameTitle" type="Sprite" parent="." index="3"] +[node name="GameTitle" type="Sprite" parent="." index="2"] position = Vector2( 489.565, 100.74 ) texture = ExtResource( 5 ) @@ -44,8 +46,9 @@ __meta__ = { "_edit_lock_": true } -[node name="MenuRf" type="ReferenceRect" parent="." index="4"] +[node name="MenuRf" type="ReferenceRect" parent="." index="3"] +editor/display_folded = true anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 @@ -267,7 +270,7 @@ __meta__ = { "_edit_lock_": true } -[node name="WinDialogs" parent="." index="5" instance=ExtResource( 6 )] +[node name="WinDialogs" parent="." index="4" instance=ExtResource( 6 )] [connection signal="toggled" from="MenuRf/StartVbox/PlayBtn" to="." method="_on_PlayBtn_toggled"] diff --git a/project/WinDialogs.tscn b/project/WinDialogs.tscn index b969137..f7869a2 100644 --- a/project/WinDialogs.tscn +++ b/project/WinDialogs.tscn @@ -3,7 +3,7 @@ [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"] +[node name="WinDialogs" type="Control" index="0"] anchor_left = 0.0 anchor_top = 0.0 @@ -26,7 +26,139 @@ autoplay = false mix_target = 0 bus = "Master" -[node name="CreditsWin" type="AcceptDialog" parent="." index="1"] +[node name="PauseWin" type="PopupDialog" parent="." index="1"] + +pause_mode = 2 +visible = false +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 318.0 +margin_top = 227.0 +margin_right = 494.0 +margin_bottom = 341.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 +popup_exclusive = false +_sections_unfolded = [ "Pause" ] + +[node name="PauseVbox" type="VBoxContainer" parent="PauseWin" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 10.0 +margin_top = 10.0 +margin_right = -10.0 +margin_bottom = -10.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +alignment = 0 +_sections_unfolded = [ "Margin" ] + +[node name="PauseLbl" type="Label" parent="PauseWin/PauseVbox" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 156.0 +margin_bottom = 14.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 4 +text = "KPUS" +align = 1 +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="SettingsBtn" type="Button" parent="PauseWin/PauseVbox" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 18.0 +margin_right = 156.0 +margin_bottom = 38.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +text = "KSET" +flat = false +align = 1 + +[node name="ResumeBtn" type="Button" parent="PauseWin/PauseVbox" index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 42.0 +margin_right = 156.0 +margin_bottom = 62.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +text = "KRUS" +flat = false +align = 1 + +[node name="ExitBtn" type="Button" parent="PauseWin/PauseVbox" index="3"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 66.0 +margin_right = 156.0 +margin_bottom = 86.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +toggle_mode = false +enabled_focus_mode = 2 +shortcut = null +group = null +text = "KEXT" +flat = false +align = 1 + +[node name="CreditsWin" type="AcceptDialog" parent="." index="2"] visible = false anchor_left = 0.0 @@ -47,6 +179,7 @@ popup_exclusive = false window_title = "KCRE" resizable = false dialog_hide_on_ok = true +_sections_unfolded = [ "Pause" ] [node name="CreditsTxt" type="RichTextLabel" parent="CreditsWin" index="3"] @@ -102,8 +235,9 @@ selection_enabled = true override_selected_font_color = false _sections_unfolded = [ "BBCode" ] -[node name="SettingsWin" type="AcceptDialog" parent="." index="2"] +[node name="SettingsWin" type="AcceptDialog" parent="." index="3"] +pause_mode = 2 editor/display_folded = true visible = false anchor_left = 0.0 @@ -124,7 +258,7 @@ popup_exclusive = false window_title = "KSET" resizable = false dialog_hide_on_ok = true -_sections_unfolded = [ "Dialog" ] +_sections_unfolded = [ "Dialog", "Pause" ] [node name="Grid" type="GridContainer" parent="SettingsWin" index="3"] @@ -194,7 +328,7 @@ text = "KMUS" flat = false align = 1 -[node name="LicenseWin" type="AcceptDialog" parent="." index="3"] +[node name="LicenseWin" type="AcceptDialog" parent="." index="4"] editor/display_folded = true visible = false @@ -216,7 +350,7 @@ popup_exclusive = false window_title = "KLIC" resizable = false dialog_hide_on_ok = true -_sections_unfolded = [ "Dialog" ] +_sections_unfolded = [ "Dialog", "Pause" ] [node name="LicenseTxt" type="RichTextLabel" parent="LicenseWin" index="3"] @@ -275,6 +409,12 @@ selection_enabled = false override_selected_font_color = false _sections_unfolded = [ "BBCode" ] +[connection signal="pressed" from="PauseWin/PauseVbox/SettingsBtn" to="." method="_on_SettingsBtn_pressed"] + +[connection signal="pressed" from="PauseWin/PauseVbox/ResumeBtn" to="." method="_on_ResumeBtn_pressed"] + +[connection signal="pressed" from="PauseWin/PauseVbox/ExitBtn" to="." method="_on_ExitBtn_pressed"] + [connection signal="toggled" from="SettingsWin/Grid/MusicBtn" to="." method="_on_MusicBtn_toggled"] diff --git a/project/lang/local.csv b/project/lang/local.csv index 80c6887..fd7b175 100644 --- a/project/lang/local.csv +++ b/project/lang/local.csv @@ -8,6 +8,8 @@ KRBT,Remove Pants,Ta bort byxor KCLS,Classic,Klassisk KUND,Underwear,Underkläder KCLR,Clear,Klar +KRUS,Resume,Återuppta +KPUS,Paused,Pausad KMUS,Music,Musik KGMO,Game Mode,Spelläge KCRE,Credits,Eftertexter diff --git a/project/lang/local.en.translation b/project/lang/local.en.translation index a708a63..299478b 100644 Binary files a/project/lang/local.en.translation and b/project/lang/local.en.translation differ diff --git a/project/lang/local.sv.translation b/project/lang/local.sv.translation index 8e725a8..a85e985 100644 Binary files a/project/lang/local.sv.translation and b/project/lang/local.sv.translation differ diff --git a/project/project.godot b/project/project.godot index 788639a..e9a2583 100644 --- a/project/project.godot +++ b/project/project.godot @@ -23,6 +23,12 @@ window/size/width=800 window/size/height=554 window/size/resizable=false +[input] + +ui_pause=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) + ] + [locale] locale_filter=[ 1, [ "en", "sv" ] ] diff --git a/project/src/GameScreen.gd b/project/src/GameScn.gd similarity index 54% rename from project/src/GameScreen.gd rename to project/src/GameScn.gd index 4ff60c6..86c9a7c 100644 --- a/project/src/GameScreen.gd +++ b/project/src/GameScn.gd @@ -1,3 +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 + +func _process(delta): + if Input.is_action_pressed("ui_pause"): + get_tree().paused = true + $WinDialogs/PauseWin.show() diff --git a/project/src/Interface.gd b/project/src/Interface.gd deleted file mode 100644 index be4edac..0000000 --- a/project/src/Interface.gd +++ /dev/null @@ -1,9 +0,0 @@ -# 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 _on_SettingsBtn_pressed(): - $WinDialogs/SettingsWin.show() - -func _on_ExitBtn_pressed(): - get_tree().change_scene("res://StartScn.tscn") diff --git a/project/src/StartScn.gd b/project/src/StartScn.gd index c4f942e..f5694df 100644 --- a/project/src/StartScn.gd +++ b/project/src/StartScn.gd @@ -6,17 +6,15 @@ func _on_ClassicBtn_pressed(): get_tree().change_scene("res://ClassicScn.tscn") func _on_ModernBtn_pressed(): - get_tree().change_scene("res://GameScn.tscn") + get_tree().change_scene("res://ModernScn.tscn") func _on_ClassicBtn_mouse_entered(): - $ModernBG.hide() - $WordrobeBG.hide() + $Modern.hide() $ClassicBG.show() func _on_ClassicBtn_mouse_exited(): $ClassicBG.hide() - $WordrobeBG.show() - $ModernBG.show() + $Modern.show() func _on_CreditsBtn_pressed(): $WinDialogs/CreditsWin.show() diff --git a/project/src/WinDialogs.gd b/project/src/WinDialogs.gd index ab47a22..802af02 100644 --- a/project/src/WinDialogs.gd +++ b/project/src/WinDialogs.gd @@ -2,6 +2,19 @@ # 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 + +func _on_ExitBtn_pressed(): + pause_zdressup(false) + get_tree().change_scene("res://StartScn.tscn") + +func _on_SettingsBtn_pressed(): + $SettingsWin.show() + func _on_CreditsBtn_pressed(): $CreditsWin.show() @@ -15,4 +28,8 @@ func _on_MusicBtn_toggled(button_pressed): if button_pressed == true: $Music.playing = true else: - $Music.playing = false \ No newline at end of file + $Music.playing = false + +func _on_ResumeBtn_pressed(): + $PauseWin.hide() + pause_zdressup(false) \ No newline at end of file