1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-05-07 14:04:48 -04:00

Rewrote more code

- Detatched LicenseWin node from PauseScn so it could be instanced by TitleScn and in other parts of the game.
This commit is contained in:
Anthony Wilcox 2019-06-11 01:17:42 -04:00
parent e9b2cb5eaf
commit 6eaa5e08e0
9 changed files with 112 additions and 117 deletions

View file

@ -56,6 +56,7 @@
</Compile> </Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="src\GameScn.cs" /> <Compile Include="src\GameScn.cs" />
<Compile Include="src\PauseScn.cs" />
<Compile Include="src\Soundtrack.cs" /> <Compile Include="src\Soundtrack.cs" />
<Compile Include="src\TitleScn.cs" /> <Compile Include="src\TitleScn.cs" />
</ItemGroup> </ItemGroup>
@ -68,5 +69,8 @@
<ItemGroup> <ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" /> <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="project.licenseheader" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View file

@ -4,7 +4,7 @@
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=2] [ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=2]
[ext_resource path="res://scn/Character.tscn" type="PackedScene" id=3] [ext_resource path="res://scn/Character.tscn" type="PackedScene" id=3]
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=4] [ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/Soundtrack.gd" type="Script" id=5] [ext_resource path="res://src/Soundtrack.cs" type="Script" id=5]
[node name="Credits" type="Node"] [node name="Credits" type="Node"]
script = ExtResource( 1 ) script = ExtResource( 1 )
@ -62,10 +62,3 @@ position = Vector2( 68.8273, 256.845 )
[node name="Music" type="AudioStreamPlayer" parent="."] [node name="Music" type="AudioStreamPlayer" parent="."]
script = ExtResource( 5 ) script = ExtResource( 5 )
[node name="Version" type="Label" parent="."]
margin_left = 950.908
margin_top = 568.64
margin_right = 990.908
margin_bottom = 582.64
text = "Version"

View file

@ -0,0 +1,56 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=1]
[node name="LicenseWin" type="AcceptDialog"]
editor/display_folded = true
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -202.0
margin_top = -137.5
margin_right = 202.0
margin_bottom = 137.5
theme = ExtResource( 1 )
window_title = "KLIC"
resizable = true
[node name="LicenseTxt" type="RichTextLabel" parent="."]
anchor_left = 0.5
anchor_right = 0.5
margin_left = -194.0
margin_top = 8.0
margin_right = 194.0
margin_bottom = 239.0
bbcode_enabled = true
bbcode_text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
[center]##########################[/center]
Nathan's Dress Up (c) by Anthony Wilcox
Nathan's Dress Up is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License.
You should have received a copy of the license along with this work.
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."
text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
##########################
Nathan's Dress Up (c) by Anthony Wilcox
Nathan's Dress Up is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License.
You should have received a copy of the license along with this work.
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=2] [gd_scene load_steps=3 format=2]
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=1] [ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=1]
[ext_resource path="res://src/PauseScn.gd" type="Script" id=2] [ext_resource path="res://src/PauseScn.cs" type="Script" id=2]
[node name="WinDialogs" type="Control"] [node name="WinDialogs" type="Control"]
anchor_left = 0.5 anchor_left = 0.5
@ -148,58 +148,6 @@ margin_right = 65.0
margin_bottom = 24.0 margin_bottom = 24.0
text = "KMUS" text = "KMUS"
align = 1 align = 1
[node name="LicenseWin" type="AcceptDialog" parent="."]
editor/display_folded = true
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -202.0
margin_top = -137.5
margin_right = 202.0
margin_bottom = 137.5
window_title = "KLIC"
resizable = true
[node name="LicenseTxt" type="RichTextLabel" parent="LicenseWin"]
anchor_left = 0.5
anchor_right = 0.5
margin_left = -194.0
margin_top = 8.0
margin_right = 194.0
margin_bottom = 238.0
bbcode_enabled = true
bbcode_text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
[center]##########################[/center]
Nathan's Dress Up (c) by Anthony Wilcox
Nathan's Dress Up is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License.
You should have received a copy of the license along with this work.
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."
text = "Nathan's Dress Up is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Nathan's Dress Up is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Nathan's Dress Up. If not, see: https://www.gnu.org/licenses/
##########################
Nathan's Dress Up (c) by Anthony Wilcox
Nathan's Dress Up is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License.
You should have received a copy of the license along with this work.
If not, see <http://creativecommons.org/licenses/by-sa/4.0/>."
[connection signal="pressed" from="PauseWin/PauseVbox/SettingsBtn" to="." method="_on_SettingsBtn_pressed"] [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/ResumeBtn" to="." method="_on_ResumeBtn_pressed"]
[connection signal="pressed" from="PauseWin/PauseVbox/ExitBtn" to="." method="_on_ExitBtn_pressed"] [connection signal="pressed" from="PauseWin/PauseVbox/ExitBtn" to="." method="_on_ExitBtn_pressed"]

View file

@ -3,7 +3,7 @@
[ext_resource path="res://src/TitleScn.cs" type="Script" id=1] [ext_resource path="res://src/TitleScn.cs" type="Script" id=1]
[ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=2] [ext_resource path="res://styles/DressUpTheme.res" type="Theme" id=2]
[ext_resource path="res://sprites/title.svg" type="Texture" id=3] [ext_resource path="res://sprites/title.svg" type="Texture" id=3]
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=4] [ext_resource path="res://scn/LicenseWin.tscn" type="PackedScene" id=4]
[node name="Start" type="Node"] [node name="Start" type="Node"]
script = ExtResource( 1 ) script = ExtResource( 1 )
@ -50,56 +50,7 @@ margin_right = 136.0
margin_bottom = 71.0 margin_bottom = 71.0
text = "KLIC" text = "KLIC"
[node name="ModePanel" type="WindowDialog" parent="MenuRf"] [node name="LicenseWin" parent="." instance=ExtResource( 4 )]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -73.0
margin_top = -46.0
margin_right = 73.0
margin_bottom = 46.0
[node name="PlayVbox" type="VBoxContainer" parent="MenuRf/ModePanel"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 5.0
margin_top = 5.0
margin_right = -5.0
margin_bottom = -5.0
[node name="ModeLbl" type="Label" parent="MenuRf/ModePanel/PlayVbox"]
margin_right = 136.0
margin_bottom = 14.0
text = "KGMO"
align = 1
[node name="ModernBtn" type="Button" parent="MenuRf/ModePanel/PlayVbox"]
margin_top = 18.0
margin_right = 136.0
margin_bottom = 38.0
text = "Modern"
[node name="ClassicBtn" type="Button" parent="MenuRf/ModePanel/PlayVbox"]
margin_top = 42.0
margin_right = 136.0
margin_bottom = 62.0
text = "KCLS"
[node name="WinDialogs" parent="." instance=ExtResource( 4 )]
margin_left = 97.0
margin_top = 37.0
margin_right = 97.0
margin_bottom = 37.0
[node name="Version" type="Label" parent="."]
margin_left = 950.908
margin_top = 568.64
margin_right = 990.908
margin_bottom = 582.64
text = "Version"
[connection signal="pressed" from="MenuRf/StartVbox/PlayBtn" to="." method="_on_PlayBtn_pressed"] [connection signal="pressed" from="MenuRf/StartVbox/PlayBtn" to="." method="_on_PlayBtn_pressed"]
[connection signal="pressed" from="MenuRf/StartVbox/CreditsBtn" to="." method="_on_CreditsBtn_pressed"] [connection signal="pressed" from="MenuRf/StartVbox/CreditsBtn" to="." method="_on_CreditsBtn_pressed"]
[connection signal="pressed" from="MenuRf/StartVbox/LicenseBtn" to="." method="_on_LicenseBtn_pressed"] [connection signal="pressed" from="MenuRf/StartVbox/LicenseBtn" to="." method="_on_LicenseBtn_pressed"]
[connection signal="pressed" from="MenuRf/ModePanel/PlayVbox/ModernBtn" to="." method="_on_ModernBtn_pressed"]
[connection signal="pressed" from="MenuRf/ModePanel/PlayVbox/ClassicBtn" to="." method="_on_ClassicBtn_pressed"]

View file

@ -1,4 +1,5 @@
extends Node extends Node
func _ready(): func _ready():
$Version.text = GameKit.version # $Version.text = GameKit.version
pass

43
project/src/PauseScn.cs Normal file
View file

@ -0,0 +1,43 @@
using Godot;
public class PauseScn : Control
{
void IsGamePaused(bool isPaused)
{
if (isPaused)
GetTree().Paused = true;
else
GetTree().Paused = false;
}
public override void _Ready()
{
}
public override void _Process(float delta)
{
if (Input.IsActionPressed("ui_pause"))
{
GetNode<Popup>("PauseWin").Show();
IsGamePaused(true);
}
}
void _on_ExitBtn_pressed()
{
IsGamePaused(false);
GetTree().ChangeScene("res://scn/TitleScn.tscn");
}
void _on_SettingsBtn_pressed()
{
GetNode<Popup>("SettingsWin").Show();
}
void _on_ResumeBtn_pressed()
{
GetNode<Popup>("PauseWin").Hide();
IsGamePaused(false);
}
}

View file

@ -11,9 +11,8 @@ public class TitleScn : Node {
void _on_CreditsBtn_pressed() { void _on_CreditsBtn_pressed() {
GetTree().ChangeScene("res://scn/CreditsScn.tscn"); GetTree().ChangeScene("res://scn/CreditsScn.tscn");
} }
void _on_LicenseBtn_pressed()
void _on_LicenseBtn_pressed() { {
var licenseWin = GetNode<Control> ("WinDialogs/LicenseWin"); GetNode<Popup>("LicenseWin").Show();
licenseWin.Show ();
} }
} }