Renamed assets, worked on the clock and map, started improving assets.

This commit is contained in:
2025-10-23 09:32:14 -04:00
parent 8811c851f9
commit 379fa4bd70
71 changed files with 747 additions and 513 deletions

View File

@@ -5,12 +5,14 @@ var player : Player = null
var panel : GamePanel = null
var player_profile : Window = null
var quest_log : QuestLog = null
var top_menu : TopMenu = null
var menu : GameMenu = null
var open : bool = false
var end_shift_confirmation : ConfirmationDialog
var end_shift_confirm_template = preload("res://templates/end_shift_confirmation.tscn")
var player_profile_template = preload("res://templates/player_profile_window.tscn")
var last_screenshot : Image
var shifts : Array[float] = []
var current_shift = -1
func _ready() -> void:
player_data = Adventurer.new()
Quest.load_quest_list()
@@ -46,10 +48,14 @@ func toggle_player_profile():
add_child(player_profile)
player_profile.setup(player.data)
func start_shift(shift_num) -> void:
current_shift = shift_num
panel.reset_timer(shifts[shift_num])
func end_shift() -> void:
take_screenshot()
open = false
open = !open
start_shift(wrap(current_shift+1, 0, len(shifts)))
if player_profile != null:
toggle_player_profile()
panel.switch_panel(open)
@@ -66,7 +72,7 @@ func end_shift() -> void:
#window.per
Guild.hall.process_mode = Node.PROCESS_MODE_DISABLED
Guild.hall.visible = false
top_menu.hide()
menu.hide()
panel.get_parent().global_position = Vector2i(5,5)
window.size = Vector2i(415,700)
panel.populate_quest_views()
@@ -86,26 +92,30 @@ func test_save() -> void:
take_screenshot()
var save_dict = {
"savetime": Time.get_datetime_string_from_system(),
"screenshot": last_screenshot
"screenshot": last_screenshot.save_png_to_buffer().hex_encode()
}
#Save the guild data
save_dict["guildname"] = Guild.name
save_dict["guildlevel"] = Guild.level
#Save the player data
if player:
save_dict["playername"] = player.data.full_name()
save_dict["playerlevel"] = player.data.level
save_dict.player = player.save()
#Save the employee data
#Save the adventurer data
var members = Guild.save_members()
if len(members) > 0:
save_dict.members = members
#Save the quest data
#Save the quest progress
var quests = Guild.save_quests()
if len(quests) > 0:
save_dict.quests = quests
var save_file = FileAccess.open("user://savefile.save", FileAccess.WRITE)
save_file.store_line(JSON.stringify(save_dict))
save_file.store_line(JSON.stringify(save_dict, "\t"))
func get_savefile_data(filename : String) -> Dictionary:
var load_file = FileAccess.open("user://" + filename, FileAccess.READ)
var json = JSON.new()
var json_string = load_file.get_line()
var json_string = load_file.get_as_text()
var parse_result = json.parse(json_string)
if not parse_result == OK:
printerr("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line())
@@ -114,14 +124,7 @@ func get_savefile_data(filename : String) -> Dictionary:
var ss : String = json.data.screenshot
#print(ss.data)
image.load_png_from_buffer(ss.hex_decode())
var data_dict = {
"playername": json.data.playername,
"playerlevel": json.data.playerlevel,
"guildname": json.data.guildname,
"guildlevel": json.data.guildlevel,
"savetime": json.data.savetime,
"screenshot": image
}
var data_dict = json.data.duplicate_deep()
return data_dict
func test_load(filename : String) -> void: