mirror of
https://github.com/tonytins/dressupzack
synced 2025-06-25 16:14:43 -04:00
Imported some older sprites
- Scale window - Full body clothes - Config file for custom window size (game is tiny on my new display)
This commit is contained in:
parent
6d75d04fc3
commit
71dfa4d52f
56 changed files with 1187 additions and 1170 deletions
33
scripts/config.gd
Normal file
33
scripts/config.gd
Normal file
|
@ -0,0 +1,33 @@
|
|||
extends Node
|
||||
|
||||
func debug_config():
|
||||
# If the game is in
|
||||
if OS.is_debug_build():
|
||||
return "res://config.cfg"
|
||||
else:
|
||||
return "user://config.cfg"
|
||||
|
||||
func set_config(config_file = "user://config.cfg"):
|
||||
# Create new ConfigFile object.
|
||||
var config = ConfigFile.new()
|
||||
|
||||
# Store some values.
|
||||
config.set_value("window", "height", 1024)
|
||||
config.set_value("window", "width", 768)
|
||||
|
||||
# Save it to a file (overwrite if already exists)
|
||||
if !FileAccess.file_exists(config_file):
|
||||
config.save(config_file)
|
||||
|
||||
func get_config(section, value, config_file = "user://config.cfg"):
|
||||
var config = ConfigFile.new()
|
||||
|
||||
# Load data from a file.
|
||||
var err = config.load(config_file)
|
||||
|
||||
# If the file didn't load, ignore it.
|
||||
if err != OK:
|
||||
return
|
||||
|
||||
for cfg in config.get_sections():
|
||||
return config.get_value(section, value)
|
|
@ -4,20 +4,44 @@ extends Node
|
|||
@onready var tops = $Tops
|
||||
@onready var bottoms = $Bottoms
|
||||
|
||||
|
||||
func _ready():
|
||||
var config_file = Config.debug_config()
|
||||
|
||||
if !FileAccess.file_exists(config_file):
|
||||
Config.set_config()
|
||||
|
||||
if FileAccess.file_exists(config_file):
|
||||
var window_height = Config.get_config("window", "height", config_file)
|
||||
var window_width = Config.get_config("window", "width", config_file)
|
||||
print_debug(window_height)
|
||||
print_debug(window_width)
|
||||
|
||||
if window_height && window_width != null:
|
||||
DisplayServer.window_set_size(Vector2i(window_height, window_width))
|
||||
|
||||
func _on_tops_fwd_btn_pressed():
|
||||
var current_frame = tops.get_frame()
|
||||
var current_frame = tops.frame
|
||||
tops.frame = current_frame + 1;
|
||||
|
||||
func _on_tops_bck_btn_pressed():
|
||||
var current_frame = tops.get_frame()
|
||||
var current_frame = tops.frame
|
||||
tops.frame = current_frame + -1;
|
||||
|
||||
|
||||
func _on_bottoms_bck_btn_pressed():
|
||||
var current_frame = bottoms.get_frame()
|
||||
var current_frame = bottoms.frame
|
||||
bottoms.frame = current_frame + -1;
|
||||
|
||||
|
||||
func _on_bottoms_fwd_btn_pressed():
|
||||
var current_frame = bottoms.get_frame()
|
||||
var current_frame = bottoms.frame
|
||||
bottoms.frame = current_frame + 1;
|
||||
|
||||
|
||||
func _on_fullbody_btn_pressed():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _on_separate_btn_pressed():
|
||||
pass # Replace with function body.
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
# This project is licensed under the GPL-3.0 license.
|
||||
# See the LICENSE file in the project root for more information.
|
||||
extends Node
|
||||
|
||||
var is_dragging = false
|
Loading…
Add table
Add a link
Reference in a new issue