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

Removed singleton scripts

- Got rid of pause scene
This commit is contained in:
Anthony Foxclaw 2020-06-27 15:51:57 -04:00
parent 99e07176f6
commit b470b9baef
8 changed files with 1 additions and 429 deletions

View file

@ -30,12 +30,6 @@ config/macos_native_icon="res://icon.icns"
config/windows_native_icon="res://icon.ico"
name_sv="Tonys klä upp"
[autoload]
GameKit="*res://scripts/GameKit.gd"
UserSettings="*res://scripts/UserSettings.gd"
Soundtrack="*res://scripts/Soundtrack.gd"
[debug]
gdscript/completion/autocomplete_setters_and_getters=true

View file

@ -1,7 +1,6 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://scenes/characterBase.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/pause.tscn" type="PackedScene" id=2]
[ext_resource path="res://scenes/wardrobe.tscn" type="PackedScene" id=4]
[ext_resource path="res://sprites/clothes/icrazy_frame.svg" type="Texture" id=5]
[ext_resource path="res://sprites/clothes/lights.png" type="Texture" id=6]
@ -37,10 +36,3 @@ margin_left = 276.0
margin_top = 36.0
margin_right = -20.0
margin_bottom = -37.0
[node name="PauseScn" parent="UI/Base" instance=ExtResource( 2 )]
visible = false
margin_left = -150.0
margin_top = -20.0
margin_right = -150.0
margin_bottom = -20.0

View file

@ -1,147 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scripts/PauseScn.gd" type="Script" id=2]
[node name="WinDialogs" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 400.0
margin_top = 300.0
margin_right = -400.0
margin_bottom = -300.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PauseWin" type="PopupDialog" parent="."]
pause_mode = 2
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -88.0
margin_top = -57.0
margin_right = 88.0
margin_bottom = 94.0
[node name="PauseVbox" type="VBoxContainer" parent="PauseWin"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = 10.0
margin_right = -10.0
margin_bottom = -10.0
[node name="PauseLbl" type="Label" parent="PauseWin/PauseVbox"]
margin_right = 156.0
margin_bottom = 29.0
text = "KPUS"
align = 1
[node name="SettingsBtn" type="Button" parent="PauseWin/PauseVbox"]
margin_top = 33.0
margin_right = 156.0
margin_bottom = 62.0
text = "KSET"
[node name="ResumeBtn" type="Button" parent="PauseWin/PauseVbox"]
margin_top = 66.0
margin_right = 156.0
margin_bottom = 95.0
text = "KRUS"
[node name="ExitBtn" type="Button" parent="PauseWin/PauseVbox"]
margin_top = 99.0
margin_right = 156.0
margin_bottom = 128.0
text = "KEXT"
[node name="SettingsWin" type="AcceptDialog" parent="."]
pause_mode = 2
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -76.0
margin_top = -34.0
margin_right = 76.0
margin_bottom = 34.0
window_title = "KSET"
[node name="Grid" type="GridContainer" parent="SettingsWin"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -68.0
margin_top = -36.5
margin_right = 68.0
margin_bottom = -7.5
columns = 3
[node name="Languages" type="MenuButton" parent="SettingsWin/Grid"]
visible = false
margin_right = 56.0
margin_bottom = 24.0
text = "KLANG"
flat = false
items = [ "KENG", null, 0, true, false, -1, 0, null, "", false, "KSWD", null, 0, false, false, -1, 0, null, "", false ]
[node name="MusicBtn" type="CheckBox" parent="SettingsWin/Grid"]
margin_right = 66.0
margin_bottom = 21.0
pressed = true
text = "KMUS"
align = 1
[node name="LicenseWin" type="AcceptDialog" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -214.0
margin_top = -138.0
margin_right = 217.0
margin_bottom = 137.0
window_title = "KLIC"
resizable = true
[node name="LicenseTxt" type="RichTextLabel" parent="LicenseWin"]
anchor_left = 0.5
anchor_right = 0.5
margin_left = -207.5
margin_top = 8.0
margin_right = 207.5
margin_bottom = 223.0
bbcode_enabled = true
bbcode_text = "This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
[center]##########################[/center]
Tony's Dress Up (c) by Anthony Wilcox
Tony'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 = "This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
##########################
Tony's Dress Up (c) by Anthony Wilcox
Tony'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/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"]

View file

@ -1,29 +0,0 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
var version = "2.0"
func _ready():
randomize()
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://scenes/ClassicScn.tscn")
elif new_mode == "credits":
get_tree().change_scene("res://scenes/CreditsScn.tscn")
elif new_mode == "play":
get_tree().change_scene("res://scenes/GameScn.tscn")
elif new_mode == "title":
get_tree().change_scene("res://scenes/TitleScn.tscn")
func if_file_exists(file):
var fileCheck = File.new()
var fileExists = fileCheck.file_exists(file)
fileCheck

View file

@ -1,153 +0,0 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node2D
enum ClothingLayer {
TOPS,
BOTTOMS,
UNDIES,
ACCESSORY,
}
# Default clothing
onready var bottoms_placeholder = load("res://sprites/clothes/bottoms_placeholder.png")
onready var tops_placeholder = load("res://sprites/clothes/tops_placeholder.png")
onready var accessories_placeholder = load("res://sprites/clothes/tops_placeholder.png")
onready var bottoms = $Character/Bottom
onready var tops = $Character/Top
# var UndiesBtn = load("res://scenes/Clothing.tscenes")
#
#func _init():
# init_underwear()
func change_bottoms(new_bottom):
bottoms_placeholder = new_bottom
if new_bottom == null:
bottoms.texture = bottoms_placeholder
UserSettings.Bottoms = bottoms_placeholder
# if undies == load("res://sprites/clothes/owo_censor.svg"):
# change_undies(null)
bottoms.texture = bottoms_placeholder
UserSettings.Bottoms = bottoms_placeholder
func change_undies(new_undies):
$Character/Undies.texture = new_undies
UserSettings.Underwear = new_undies
func change_tops(new_top):
tops_placeholder = new_top
if new_top == null:
tops.texture = tops_placeholder
UserSettings.Tops = tops_placeholder
tops.texture = tops_placeholder
UserSettings.Tops = tops_placeholder
#func change_accessoires(new_accessory):
# accessories_placeholder = new_accessory
#
# if new_accessory == null:
# accessory.texture = accessories_placeholder
# UserSettings.Accessory = accessories_placeholder
#
# accessory.texture = accessories_placeholder
# UserSettings.Accessory = accessories_placeholder
#func init_underwear():
# var undiesFile = File.new()
# undiesFile.open("res://undies.json", undiesFile.READ)
# var undiesJson = parse_json(undiesFile.get_as_text())
#
# for object in undiesJson:
# var underwear = UndiesBtn.instance()
#
# underwear.texture = load(object.sprite)
#
func _process(delta):
# Change clothes
# ===========================================================
# if $UI/Base/Wordrobe/Accessoires/AccsScroll/AccsGrid/CanonCam.is_pressed():
# change_accessoires(load("res://sprites/clothes/camera.png"))
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/Jeans.is_pressed():
change_bottoms(load("res://sprites/clothes/jeans.svg"))
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/Sweats.is_pressed():
change_bottoms(load("res://sprites/clothes/sweat_pants.svg"))
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/BlueSkirt.is_pressed():
change_bottoms(load("res://sprites/clothes/blue_skirt.svg"))
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/FormalSkirt.is_pressed():
change_bottoms(load("res://sprites/clothes/formal_skirt.svg"))
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/BeatUpJeans.is_pressed():
change_bottoms(load("res://sprites/clothes/beat_up_jeans.svg"))
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/Briefs.is_pressed():
change_undies(load("res://sprites/clothes/briefs.svg"))
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/ZBriefs.is_pressed():
change_undies(load("res://sprites/clothes/z_briefs.svg"))
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/Fundosi.is_pressed():
change_undies(load("res://sprites/clothes/fundosi.svg"))
if $UI/Base/Wordrobe/Underwear/UndiesScroll/UndiesGrid/OwOCensor.is_pressed():
change_bottoms(null)
change_undies(load("res://sprites/clothes/owo_censor.svg"))
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/BlueCamoJeans.is_pressed():
change_bottoms(load("res://sprites/clothes/blue_camo_jeans.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/TrainHoodie.is_pressed():
change_tops(load("res://sprites/clothes/train_hoodie.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Sweatshirt.is_pressed():
change_tops(load("res://sprites/clothes/old_sweatshirt.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Raw.is_pressed():
change_tops(load("res://sprites/clothes/raw_shirt.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/ZShirt.is_pressed():
change_tops(load("res://sprites/clothes/z_shirt.png"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/WhatsNewShirt.is_pressed():
change_tops(load("res://sprites/clothes/whatsnew_shirt.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Retro.is_pressed():
change_tops(load("res://sprites/clothes/retro_shirt.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/KormShirt.is_pressed():
change_tops(load("res://sprites/clothes/korm_shirt.png"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/BikerJacket.is_pressed():
change_tops(load("res://sprites/clothes/biker_jacket.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/Atomic.is_pressed():
change_tops(load("res://sprites/clothes/atomic_shirt.svg"))
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/NLJacket.is_pressed():
change_tops(load("res://sprites/clothes/nl_jacket.png"))
# Remove clothes
# ===========================================================
# if $UI/Base/Wordrobe/Accessoires/AccsScroll/AccsGrid/RemoveAccessory.is_pressed():
# change_accessoires(null)
if $UI/Base/Wordrobe/Shirts/ShirtsScroll/ShirtsGrid/RemoveShirt.is_pressed():
change_tops(null)
if $UI/Base/Wordrobe/Pants/PantsScroll/PantsGrid/RemovePants.is_pressed():
change_bottoms(null)

View file

@ -1,34 +0,0 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
func _process(delta):
if Input.is_action_just_pressed("ui_pause"):
$PauseWin.show()
GameKit.is_game_paused(true)
func _on_ExitBtn_pressed():
GameKit.is_game_paused(false)
GameKit.switch_scenes("title")
func _on_SettingsBtn_pressed():
$SettingsWin.show()
func _on_CreditsBtn_pressed():
GameKit.switch_scenes("credits")
func _on_LicenseBtn_pressed():
$LicenseWin.show()
func _on_CloseAbtBtn_pressed():
$AboutWin.hide()
func _on_MusicBtn_toggled(button_pressed):
if button_pressed == true:
UserSettings.IsMusicPaused = true
else:
UserSettings.IsMusicPaused = false
func _on_ResumeBtn_pressed():
$PauseWin.hide()
GameKit.is_game_paused(false)

View file

@ -1,42 +0,0 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends AudioStreamPlayer
var playlist = []
var tracks = detect_music()
func _ready():
play_random_song()
connect("finished", self, "play_random_song")
func detect_music():
var files = []
var dir = Directory.new()
var music_dir = "res://music/";
dir.open(music_dir)
dir.list_dir_begin()
while true:
var file = dir.get_next()
if file == "":
break
elif not file.begins_with(".") and file.get_extension() == "ogg":
files.append(music_dir + file)
dir.list_dir_end()
return files
func play_random_song():
if tracks.size() > 0:
playlist = tracks
var rand_song = randi() % playlist.size()
print_debug(playlist)
# var audiostream = load(playlist[rand_song])
# stream = audiostream
# play()
print_debug(playlist[rand_song])
else:
print_debug("Music not found")

View file

@ -1,9 +0,0 @@
# Anthony Wilcox licenses this file to you under the MPL license.
# See the LICENSE file in the project root for more information.
extends Node
var Tops: Texture
var Bottoms: Texture
var Underwear: Texture
var Accessory: Texture
var IsMusicPaused: bool