changed the menu text to let players know when a pack is being created (so they dont think it crashes)

This commit is contained in:
JHDev2006 2025-10-23 20:41:07 +01:00
parent 22a1af89d4
commit d7f56f7678
3 changed files with 16 additions and 2 deletions

View file

@ -7,6 +7,8 @@ signal fnt_file_downloaded(text: String)
var downloaded_fnt_text := []
signal pack_created
const base_info_json := {
"name": "New Pack",
"description": "Template, give me a description!",
@ -14,6 +16,7 @@ const base_info_json := {
}
func create_template() -> void:
await get_tree().process_frame
get_directories("res://Assets", files, directories)
for i in directories:
DirAccess.make_dir_recursive_absolute(i.replace("res://Assets", Global.config_path.path_join("resource_packs/new_pack")))
@ -50,6 +53,7 @@ func create_template() -> void:
file.store_string(JSON.stringify(base_info_json, "\t"))
file.close()
print("Done")
pack_created.emit()
func download_fnt_text(file_path := "") -> PackedByteArray:
var http = HTTPRequest.new()

View file

@ -19,4 +19,11 @@ func handle_inputs() -> void:
if Input.is_action_just_pressed("ui_accept"):
button_pressed.emit()
if press_sfx != "":
AudioManager.play_global_sfx(press_sfx)
play_sfx()
func play_sfx(sfx := press_sfx) -> void:
await get_tree().process_frame
AudioManager.play_global_sfx(sfx)
func set_title(text := "") -> void:
title = text