Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
update wallet window popup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Platt authored and Marc Platt committed Jan 2, 2025
1 parent c524d5f commit a07f028
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions cusf_launcher/script/main_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -634,19 +634,17 @@ func _on_delete_wallet_starters_confirmed():
# Delete all files in the wallet_starters directory
var dir = DirAccess.open(starters_dir)
if dir:
# First delete all files in the directory
var files = dir.get_files()
for file in files:
var file_path = starters_dir.path_join(file)
dir.remove(file_path)

# Move up one directory to delete the wallet_starters folder itself
var parent_dir = DirAccess.open(user_data_dir)
if parent_dir:
parent_dir.remove(starters_dir)

# Show the minimal wallet window since no wallet exists now
var minimal_wallet_scene = preload("res://scene/minimal_wallet.tscn")
var minimal_wallet = minimal_wallet_scene.instantiate()
add_child.call_deferred(minimal_wallet)
minimal_wallet.visible = true
dir.remove(file)
# Go up one level to delete the directory itself
dir = DirAccess.open(user_data_dir)
if dir:
dir.remove("wallet_starters")

# Show the minimal wallet window since no wallet exists
var minimal_wallet_scene = load("res://scene/minimal_wallet.tscn")
var minimal_wallet = minimal_wallet_scene.instantiate()
get_tree().root.add_child(minimal_wallet)

$MarginContainer/VBoxContainer/HBoxContainerPageAndPageButtons/PanelContainerPages/SettingPage/VBoxContainer/DeleteWalletStartersConfirmationDialog.hide()

0 comments on commit a07f028

Please sign in to comment.