mirror of
https://github.com/tonytins/dressupzack
synced 2025-06-25 08:04:43 -04:00
Removed singleton scripts
- Got rid of pause scene
This commit is contained in:
parent
99e07176f6
commit
b470b9baef
8 changed files with 1 additions and 429 deletions
|
@ -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
|
|
@ -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)
|
|
@ -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)
|
|
@ -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")
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue