diff --git a/.DS_Store b/.DS_Store index f56dcf4..590bbee 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/assets/data/quotes.json b/assets/data/quotes.json index ea32892..da31d58 100644 --- a/assets/data/quotes.json +++ b/assets/data/quotes.json @@ -11,10 +11,6 @@ "quote": "Inflation is taxation without legislation.", "author": "Milton Friedman" }, - { - "quote": "Used to the conditions of a capitalistic environment, the average American takes it for granted that every year business makes something new and better accessible to him. Looking backward upon the years of his own life, he realizes that many implements that were totally unknown in the days of his youth and many others which at that time could be enjoyed only by a small minority are now standard equipment of almost every household.", - "author": "Ludwig Von Mises" - }, { "quote": "Poorly paid labor is inefficient labor, the world over.", "author": "Henry George" @@ -34,5 +30,21 @@ { "quote": "Ambition is common to all men; and those, who are unable to rise to distinction, are at least willing to reduce others to their own standard.", "author": "William Godwin" - } + }, + { + "quote": "Organizations are permanently and randomly subject to decline and decay - no matter their institutional framework.", + "author": "Albert Hirschman" + }, + { + "quote": "Monopolies don't innovate. The motto of any monopoly is: 'We don't care, because we don't have to'", + "author": "Marc Andreessen" + }, + { + "quote": "It is self-deception to think that the status quo is going to be satisfactory for everyone forever. It's already not satisfactory for a lot of people", + "author": "David Deutsch" + }, + { + "quote": "Ambition is common to all men; and those, who are unable to rise to distinction, are at least willing to reduce others to their own standard", + "author": "William Godwin" + }, ] diff --git a/source/application/application.tscn b/source/application/application.tscn index 85a02a7..102569e 100644 --- a/source/application/application.tscn +++ b/source/application/application.tscn @@ -9,8 +9,8 @@ [ext_resource type="Texture2D" uid="uid://itqhnp8fc877" path="res://assets/images/help-circle-outline-svgrepo-com.svg" id="4_a3gdc"] [ext_resource type="Texture2D" uid="uid://dgqkqb642nnfx" path="res://assets/images/exit-svgrepo-com.svg" id="4_ry4n6"] [ext_resource type="Script" path="res://source/application/mnemonic.gd" id="4_sm74a"] -[ext_resource type="PackedScene" uid="uid://bm4wk2nic02cm" path="res://ui/components/fast_withdraw/fast_withdrawal.tscn" id="7_y15xs"] -[ext_resource type="Script" path="res://ui/components/fast_withdraw/fast_withdrawal_format.gd" id="8_xa106"] +[ext_resource type="PackedScene" uid="uid://duvvgc45h86gp" path="res://source/fast_withdrawal/fast_withdraw-new.tscn" id="9_al4dm"] +[ext_resource type="PackedScene" uid="uid://dwhtby81ylt3s" path="res://ui/components/left_menu/left_menu.tscn" id="11_x7vrd"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qsl1u"] bg_color = Color(0, 0, 0, 1) @@ -41,198 +41,203 @@ grow_horizontal = 2 grow_vertical = 2 theme_override_constants/margin_top = 8 -[node name="TabContainer" type="TabContainer" parent="MarginContainer"] -custom_minimum_size = Vector2(816, 544) +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] layout_mode = 2 + +[node name="TabContainer" type="TabContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 script = ExtResource("2_6g70o") -[node name="Wallet" type="TabContainer" parent="MarginContainer/TabContainer"] +[node name="Wallet" type="TabContainer" parent="MarginContainer/VBoxContainer/TabContainer"] layout_mode = 2 tabs_visible = false script = ExtResource("3_rk7qs") -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/TabContainer/Wallet"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet"] layout_mode = 2 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer"] layout_mode = 2 -[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] +[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2"] layout_mode = 2 size_flags_horizontal = 3 -[node name="Control3" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] -custom_minimum_size = Vector2(2.08165e-12, 60) +[node name="Control3" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 40) layout_mode = 2 -[node name="Label" type="Label" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] custom_minimum_size = Vector2(2.08165e-12, 45) layout_mode = 2 theme_override_font_sizes/font_size = 32 text = "RESTORE WALLET" horizontal_alignment = 1 -[node name="Control" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] custom_minimum_size = Vector2(2.08165e-12, 40) layout_mode = 2 -[node name="MnemonicIn" type="TextEdit" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +[node name="MnemonicIn" type="TextEdit" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] custom_minimum_size = Vector2(2.08165e-12, 100) layout_mode = 2 placeholder_text = "Enter 12 words separated by a space" wrap_mode = 1 autowrap_mode = 2 -[node name="Control2" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] custom_minimum_size = Vector2(2.08165e-12, 50) layout_mode = 2 -[node name="Load" type="Button" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] +[node name="Load" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer2/VBoxContainer"] custom_minimum_size = Vector2(2.08165e-12, 60) layout_mode = 2 text = "LOAD WALLET" -[node name="Control" type="Panel" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] +[node name="Control" type="Panel" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] custom_minimum_size = Vector2(8, 2.08165e-12) layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_qsl1u") -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer"] +[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="Control3" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] -custom_minimum_size = Vector2(2.08165e-12, 60) +[node name="Control3" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +custom_minimum_size = Vector2(2.08165e-12, 40) layout_mode = 2 -[node name="Label2" type="Label" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] custom_minimum_size = Vector2(2.08165e-12, 45) layout_mode = 2 theme_override_font_sizes/font_size = 32 text = "CREATE WALLET" horizontal_alignment = 1 -[node name="Control" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] custom_minimum_size = Vector2(2.08165e-12, 40) layout_mode = 2 -[node name="Create" type="Button" parent="MarginContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] +[node name="Create" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2"] custom_minimum_size = Vector2(2.08165e-12, 220) layout_mode = 2 text = "CREATE NEW WALLET" -[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/TabContainer/Wallet"] +[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet"] visible = false layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer2"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2"] layout_mode = 2 -[node name="BoxContainer" type="VBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer"] +[node name="BoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] layout_mode = 2 -[node name="Return" type="Button" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +[node name="Return" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] layout_mode = 2 icon = ExtResource("4_ry4n6") -[node name="LineEdit" type="LineEdit" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +[node name="LineEdit" type="LineEdit" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 placeholder_text = "Input random string or fast create" max_length = 64 expand_to_text_length = true -[node name="Random" type="Button" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +[node name="Random" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] custom_minimum_size = Vector2(2.08165e-12, 50) layout_mode = 2 text = "Fast Create" -[node name="Help" type="Button" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +[node name="Help" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] layout_mode = 2 icon = ExtResource("4_a3gdc") -[node name="Hide" type="CheckButton" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] +[node name="Hide" type="CheckButton" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer"] layout_mode = 2 text = "Hide" -[node name="Spacer" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] -custom_minimum_size = Vector2(2.08165e-12, 20) +[node name="Spacer3" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 5) layout_mode = 2 -[node name="GridContainer" type="GridContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +[node name="GridContainer" type="GridContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] layout_mode = 2 script = ExtResource("4_sm74a") -[node name="Spacer2" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] -custom_minimum_size = Vector2(2.08165e-12, 20) +[node name="Spacer2" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 5) layout_mode = 2 -[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer"] layout_mode = 2 size_flags_vertical = 3 -[node name="BIP39" type="VBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] +[node name="BIP39" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] layout_mode = 2 size_flags_horizontal = 3 +size_flags_vertical = 0 -[node name="Header" type="Label" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/BIP39"] +[node name="Header" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/BIP39"] layout_mode = 2 text = "BIP 39 Information" horizontal_alignment = 1 -[node name="Spacer" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] +[node name="Spacer" type="Control" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] layout_mode = 2 -[node name="Paths" type="VBoxContainer" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] +[node name="Paths" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2"] layout_mode = 2 size_flags_horizontal = 3 +size_flags_vertical = 0 -[node name="Header" type="Label" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths"] +[node name="Header" type="Label" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths"] layout_mode = 2 text = "BIP 32 HD Information" horizontal_alignment = 1 -[node name="LaunchPopUp" type="Button" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths"] -custom_minimum_size = Vector2(2.08165e-12, 100) +[node name="LaunchPopUp" type="Button" parent="MarginContainer/VBoxContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer/BoxContainer/HBoxContainer2/Paths"] +custom_minimum_size = Vector2(2.08165e-12, 50) layout_mode = 2 size_flags_vertical = 10 text = "CREATE WALLET" -[node name="Spacer2" type="Control" parent="MarginContainer/TabContainer/Wallet/MarginContainer2/VBoxContainer"] -custom_minimum_size = Vector2(2.08165e-12, 20) -layout_mode = 2 - -[node name="Nodes" parent="MarginContainer/TabContainer" instance=ExtResource("2_xvhh7")] +[node name="Nodes" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("2_xvhh7")] visible = false layout_mode = 2 script = ExtResource("4_1w6t5") -[node name="Fast Withdrawal" parent="MarginContainer/TabContainer" instance=ExtResource("7_y15xs")] +[node name="Fast Withdraw" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("9_al4dm")] visible = false layout_mode = 2 -script = ExtResource("8_xa106") -[node name="Tools" type="MarginContainer" parent="MarginContainer/TabContainer"] +[node name="Tools" type="MarginContainer" parent="MarginContainer/VBoxContainer/TabContainer"] visible = false layout_mode = 2 -[node name="Settings" parent="MarginContainer/TabContainer" instance=ExtResource("2_qna4f")] +[node name="Settings" parent="MarginContainer/VBoxContainer/TabContainer" instance=ExtResource("2_qna4f")] visible = false layout_mode = 2 +[node name="Menu" parent="MarginContainer/VBoxContainer" instance=ExtResource("11_x7vrd")] +custom_minimum_size = Vector2(2.08165e-12, 90) +layout_mode = 2 +size_flags_vertical = 1 + [node name="ChainProviderInfoLayer" type="CanvasLayer" parent="."] -[editable path="MarginContainer/TabContainer/Nodes"] -[editable path="MarginContainer/TabContainer/Nodes/ScrollContainer/Window/NodePanel1"] +[editable path="MarginContainer/VBoxContainer/TabContainer/Nodes"] +[editable path="MarginContainer/VBoxContainer/TabContainer/Nodes/ScrollContainer/Window/NodePanel1"] diff --git a/source/application/mnemonic.gd b/source/application/mnemonic.gd index 05e9239..1ae24ff 100644 --- a/source/application/mnemonic.gd +++ b/source/application/mnemonic.gd @@ -15,9 +15,9 @@ func setup_grid(): for child in get_children(): child.queue_free() - var font = load("res://assets/fonts/Satoshi-Bold.otf") + var font = load(header_font_path) var small_font = font.duplicate() - var default_size = 16 # Set this to your desired default font size + var default_size = 14 # Set this to your desired default font size var small_size = int(default_size * 0.7) # Adjust this factor to get the desired size # Set up the grid diff --git a/source/application/wallet_creator.gd b/source/application/wallet_creator.gd index 044157b..88c44a4 100644 --- a/source/application/wallet_creator.gd +++ b/source/application/wallet_creator.gd @@ -95,9 +95,14 @@ func _on_return_button_pressed(): clear_all_output() func save_wallet_data(): - var file = FileAccess.open("res://wallet_master_seeds.txt", FileAccess.WRITE) - var json_string = JSON.stringify(current_wallet_data) - file.store_line(json_string) + var seed_data = { + "seed_hex": current_wallet_data["seed"], + "seed_binary": current_wallet_data["bip39_bin"], + "mnemonic": current_wallet_data["mnemonic"] + } + var file = FileAccess.open("res://starters/wallet_master_seed.txt", FileAccess.WRITE) + var json_string = JSON.stringify(seed_data) + file.store_string(json_string) file.close() func _create_wallet(input: String): @@ -380,6 +385,12 @@ func _on_background_gui_input(event): func _on_popup_yes_pressed(): save_wallet_data() + + var Bitcoin = BitcoinWallet.new() + var sidechain_slots = get_sidechain_info() + var sidechain_data = Bitcoin.generate_sidechain_starters(current_wallet_data["seed"], current_wallet_data["mnemonic"], sidechain_slots) + save_sidechain_info(sidechain_data) + _on_popup_close_pressed() func _on_popup_close_pressed() -> void: @@ -400,12 +411,42 @@ func _toggle_output_visibility(is_visible: bool): var bip39_info_label = bip39_panel.get_node("BIP39Info") if bip39_info_label: - bip39_info_label.visible = is_visible + if is_visible: + # Restore the full content + update_bip39_panel(current_wallet_data) + else: + # Keep only headers visible + var headers_text = """[table=2] +[cell][color=white][b][u]BIP39 Hex:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Bin: + + + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum:[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]BIP39 Checksum Hex:[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + bip39_info_label.text = headers_text - # Toggle visibility for Launch panel info var launch_info_label = launch_panel.get_node("VBoxContainer/LaunchInfo") if launch_info_label: - launch_info_label.visible = is_visible + if is_visible: + # Restore the full content + update_launch_panel(current_wallet_data) + else: + # Keep only headers visible + var headers_text = """[table=2] +[cell][color=white][b][u]HD Key Data: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Master Key: + +[/u][/b][/color][/cell] [cell][/cell] +[cell][color=white][b][u]Chain Code: + +[/u][/b][/color][/cell] [cell][/cell] +[/table]""" + launch_info_label.text = headers_text func _on_load_button_pressed(): var wallet = BitcoinWallet.new() @@ -427,17 +468,25 @@ func _on_load_button_pressed(): return print("Wallet generated successfully:") - # Write wallet info to file - var file = FileAccess.open("res://wallet_master_seeds.txt", FileAccess.WRITE) - if file: - var json_string = JSON.stringify(result) - file.store_line(json_string) - file.close() - if tabs: - tabs.current_tab = 1 - print("Wallet information saved to wallet_master_seeds.txt") - else: - print("Error: Unable to write to wallet_master_seeds.txt") + # Save master wallet data in the new format + var seed_data = { + "mnemonic": result["mnemonic"], + "seed_binary": result["bip39_bin"], + "seed_hex": result["seed"] + } + var file = FileAccess.open("res://starters/wallet_master_seed.txt", FileAccess.WRITE) + var json_string = JSON.stringify(seed_data) + file.store_string(json_string) + file.close() + + # Generate and save sidechain starters + var sidechain_slots = get_sidechain_info() + var sidechain_data = wallet.generate_sidechain_starters(result["seed"], result["mnemonic"], sidechain_slots) + save_sidechain_info(sidechain_data) + + if tabs: + tabs.current_tab = 1 + print("Wallet and sidechain information saved.") func _on_fast_button_pressed(): entropy_in.text = "" @@ -445,3 +494,30 @@ func _on_fast_button_pressed(): var entropy = wallet_generator.fast_create() entropy_in.text = entropy _on_entropy_in_changed(entropy) + +func get_sidechain_info(): + var sidechain_info = [] + var file = FileAccess.open("res://chain_providers.cfg", FileAccess.READ) + if file: + var current_section = "" + while !file.eof_reached(): + var line = file.get_line().strip_edges() + if line.begins_with("[") and line.ends_with("]"): + current_section = line.substr(1, line.length() - 2) + elif line.begins_with("slot=") and current_section != "drivechain": + var slot = line.split("=")[1].to_int() + if slot != -1: + sidechain_info.append(slot) + return sidechain_info + +func save_sidechain_info(sidechain_data): + for key in sidechain_data.keys(): + if key.begins_with("sidechain_"): + var slot = key.split("_")[1] + var filename = "res://starters/sidechain_%s_starter.txt" % slot + var file = FileAccess.open(filename, FileAccess.WRITE) + if file: + file.store_string(JSON.stringify(sidechain_data[key])) + file.close() + else: + print("Failed to save sidechain starter information for slot ", slot) diff --git a/source/fast_withdrawal/fast_withdraw-new.gd b/source/fast_withdrawal/fast_withdraw-new.gd new file mode 100644 index 0000000..e22540f --- /dev/null +++ b/source/fast_withdrawal/fast_withdraw-new.gd @@ -0,0 +1,133 @@ +extends Control + +const SERVER_LOCALHOST : String = "127.0.0.1" +const SERVER_L2L_GA : String = "172.105.148.135" +const PORT : int = 8382 + +var invoice_address : String = "" +var connected_to_server : bool = false +var selected_chain : String = "" + +signal fast_withdraw_server_connection_status_changed + +func _ready() -> void: + $LabelConnectionStatus.visible = false + + selected_chain = $"/root/Net".FAST_WITHDRAW_CHAIN_TESTCHAIN + + multiplayer.connected_to_server.connect(_on_connected_to_withdrawal_server) + multiplayer.connection_failed.connect(_on_failed_connect_to_withdrawal_server) + multiplayer.server_disconnected.connect(_on_disconnected_from_withdrawal_server) + + $"/root/Net".fast_withdraw_invoice.connect(_on_fast_withdraw_invoice) + $"/root/Net".fast_withdraw_complete.connect(_on_fast_withdraw_complete) + + +func _on_connected_to_withdrawal_server() -> void: + if $"/root/Net".print_debug_net: + print("Connected to fast withdraw server") + + $LabelConnectionStatus.text = "Connected" + + connected_to_server = true + fast_withdraw_server_connection_status_changed.emit() + + +func _on_disconnected_from_withdrawal_server() -> void: + if $"/root/Net".print_debug_net: + print("Disonnected from fast withdraw server") + + $LabelConnectionStatus.text = "Disconnected" + $LabelInvoice.text = "" + connected_to_server = false + fast_withdraw_server_connection_status_changed.emit() + + +func _on_failed_connect_to_withdrawal_server() -> void: + if $"/root/Net".print_debug_net: + print("Failed to connect to fast withdraw server") + + $LabelConnectionStatus.text = "Not Connected" + + connected_to_server = false + fast_withdraw_server_connection_status_changed.emit() + + +func connect_to_withdrawal_server() -> void: + # Create fast withdraw client + var peer = ENetMultiplayerPeer.new() + if $CheckButtonLocalhost.is_pressed(): + if $"/root/Net".print_debug_net: + print("Using fast withdraw server: localhost") + + var error = peer.create_client(SERVER_LOCALHOST, PORT) + if error and $"/root/Net".print_debug_net: + print_debug("Error: ", error) + else: + if $"/root/Net".print_debug_net: + print("Using fast withdraw server: L2L-GA") + var error = peer.create_client(SERVER_L2L_GA, PORT) + if error and $"/root/Net".print_debug_net: + print_debug("Error: ", error) + + $LabelConnectionStatus.text = "Connecting..." + + multiplayer.multiplayer_peer = peer + + +func _on_fast_withdraw_invoice(amount : float, destination: String) -> void: + if $"/root/Net".print_debug_net: + print("Received fast withdraw invoice!") + print("Amount: ", amount) + print("Destination: ", destination) + + var invoice_text = "Fast withdraw request received! Invoice created:\n" + invoice_text += str("Send ", amount, " L2 coins to ", destination, "\n") + invoice_text += "Once you have paid enter the L2 txid and hit invoice paid" + + invoice_address = destination + + $LabelInvoice.text = invoice_text + + +func _on_fast_withdraw_complete(txid: String, amount : float, destination: String) -> void: + if $"/root/Net".print_debug_net: + print("Fast withdraw complete!") + print("TxID: ", txid) + print("Amount: ", amount) + print("Destination: ", destination) + + var output : String = "Withdraw complete!\n" + output += "Mainchain payout txid:\n" + txid + "\n" + output += "Amount: " + str(amount) + "\n" + output += "Destination: " + destination + "\n" + $LabelComplete.text = output + + if multiplayer.multiplayer_peer: + multiplayer.multiplayer_peer.close() + + +func _on_button_copy_address_pressed() -> void: + DisplayServer.clipboard_set(invoice_address) + + +func _on_button_invoice_paid_pressed() -> void: + # Tell the server we paid + var txid : String = $LineEditTXID.text + $"/root/Net".invoice_paid.rpc_id(1, selected_chain, txid, $SpinBoxAmount.value, $LineEditMainchainAddress.text) + + +func _on_button_request_invoice_pressed() -> void: + # Establish connection with fast withdraw server + connect_to_withdrawal_server() + $LabelConnectionStatus.visible = true + + await fast_withdraw_server_connection_status_changed + + # Send fast withdraw request only to server + $"/root/Net".request_fast_withdraw.rpc_id(1, $SpinBoxAmount.value, selected_chain, $LineEditMainchainAddress.text) + + +func _on_chain_selection_button_item_selected(index): + var selection_index = $ChainSelectionButton.get_selected() + selected_chain = $ChainSelectionButton.get_item_text(selection_index) diff --git a/source/fast_withdrawal/fast_withdraw-new.tscn b/source/fast_withdrawal/fast_withdraw-new.tscn new file mode 100644 index 0000000..247416e --- /dev/null +++ b/source/fast_withdrawal/fast_withdraw-new.tscn @@ -0,0 +1,179 @@ +[gd_scene load_steps=2 format=3 uid="uid://duvvgc45h86gp"] + +[ext_resource type="Script" path="res://ui/components/fast_withdraw/fast_withdraw.gd" id="1_4itd0"] + +[node name="FastWithdraw" type="VBoxContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_4itd0") + +[node name="Control2" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(10, 2.08165e-12) +layout_mode = 2 + +[node name="LineEditMainchainAddress" type="LineEdit" parent="HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Enter mainchain address" +expand_to_text_length = true + +[node name="Control2" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 + +[node name="Label" type="Label" parent="HBoxContainer"] +layout_mode = 2 +text = "Amount to withdraw: +" + +[node name="Control3" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(20, 2.08165e-12) +layout_mode = 2 + +[node name="SpinBoxAmount" type="SpinBox" parent="HBoxContainer"] +layout_mode = 2 +min_value = 1.0 +value = 1.0 +suffix = "BTC" + +[node name="Control4" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(10, 2.08165e-12) +layout_mode = 2 + +[node name="Control5" type="Control" parent="HBoxContainer"] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="Control" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 10) +layout_mode = 2 + +[node name="Label2" type="Label" parent="."] +layout_mode = 2 +text = " Sidechain to withdraw from: +" + +[node name="Control6" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control2" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(25, 2.08165e-12) +layout_mode = 2 + +[node name="ChainSelectionButton" type="OptionButton" parent="HBoxContainer2"] +layout_mode = 2 +item_count = 3 +selected = 0 +popup/item_0/text = "Testchain" +popup/item_0/id = 0 +popup/item_1/text = "Thunder" +popup/item_1/id = 1 +popup/item_2/text = "ZSide" +popup/item_2/id = 2 + +[node name="Control3" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="ButtonRequestInvoice" type="Button" parent="HBoxContainer2"] +layout_mode = 2 +text = "Request fast withdrawal test invoice" + +[node name="Control4" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="LabelConnectionStatus" type="Label" parent="HBoxContainer2"] +layout_mode = 2 +text = "Not Connected" + +[node name="Control5" type="Control" parent="HBoxContainer2"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="LabelInvoice" type="Label" parent="."] +layout_mode = 2 + +[node name="LabelComplete" type="Label" parent="."] +layout_mode = 2 + +[node name="ButtonCopyAddress" type="Button" parent="."] +custom_minimum_size = Vector2(200, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 4 +text = "Copy Address +" + +[node name="Control3" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="Control4" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer4" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control5" type="Control" parent="HBoxContainer4"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="LineEditTXID" type="LineEdit" parent="HBoxContainer4"] +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Enter L2 payment txid" +expand_to_text_length = true + +[node name="Control6" type="Control" parent="HBoxContainer4"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="Control5" type="Control" parent="."] +custom_minimum_size = Vector2(2.08165e-12, 5) +layout_mode = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Control5" type="Control" parent="HBoxContainer3"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[node name="ButtonInvoicePaid" type="Button" parent="HBoxContainer3"] +layout_mode = 2 +text = "Invoice Paid" + +[node name="Control6" type="Control" parent="HBoxContainer3"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="CheckButtonLocalhost" type="CheckButton" parent="HBoxContainer3"] +layout_mode = 2 +text = "Debug server" + +[node name="Control7" type="Control" parent="HBoxContainer3"] +custom_minimum_size = Vector2(15, 2.08165e-12) +layout_mode = 2 + +[connection signal="pressed" from="HBoxContainer2/ButtonRequestInvoice" to="." method="_on_button_request_invoice_pressed"] +[connection signal="pressed" from="ButtonCopyAddress" to="." method="_on_button_copy_address_pressed"] +[connection signal="pressed" from="HBoxContainer3/ButtonInvoicePaid" to="." method="_on_button_invoice_paid_pressed"] diff --git a/source/fast_withdrawal/fast_withdrawal.tscn b/source/fast_withdrawal/fast_withdrawal.tscn index 44ac8a3..7734062 100644 --- a/source/fast_withdrawal/fast_withdrawal.tscn +++ b/source/fast_withdrawal/fast_withdrawal.tscn @@ -1,4 +1,4 @@ -[gd_scene format=3 uid="uid://bm4wk2nic02cm"] +[gd_scene format=3 uid="uid://q0oe03uvidck"] [node name="Wallet" type="MarginContainer"] custom_minimum_size = Vector2(835, 553) diff --git a/source/fast_withdrawal/fast_withdrawal_format.gd b/source/fast_withdrawal/fast_withdrawal_format.gd deleted file mode 100644 index 49b2741..0000000 --- a/source/fast_withdrawal/fast_withdrawal_format.gd +++ /dev/null @@ -1,17 +0,0 @@ -extends MarginContainer - -const CUSTOM_FONT_PATH = "res://assets/fonts/Satoshi-Bold.otf" - -func _ready(): - apply_custom_font() - -func apply_custom_font(): - var custom_font = load(CUSTOM_FONT_PATH) - if custom_font: - apply_font_recursive(self, custom_font) - -func apply_font_recursive(node: Node, font: Font): - if node is Label or node is Button or node is LineEdit or node is TextEdit: - node.add_theme_font_override("font", font) - for child in node.get_children(): - apply_font_recursive(child, font) diff --git a/source/fast_withdrawal/heading.gd b/source/fast_withdrawal/heading.gd deleted file mode 100644 index e69de29..0000000 diff --git a/source/nodes/nodes.tscn b/source/nodes/nodes.tscn index 5592269..bbeff2b 100644 --- a/source/nodes/nodes.tscn +++ b/source/nodes/nodes.tscn @@ -3,7 +3,13 @@ [ext_resource type="PackedScene" uid="uid://cq65ocurdi7c1" path="res://source/nodes/node_panel/node_panel.tscn" id="1_qsgf1"] [node name="Nodes" type="MarginContainer"] -custom_minimum_size = Vector2(835, 553) +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 [node name="ScrollContainer" type="ScrollContainer" parent="."] layout_mode = 2 diff --git a/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd b/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd index bd83e7d..29d1463 100644 --- a/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd +++ b/source/settings/display_settings/screen_options/screen_resolution/screen_resolution.gd @@ -5,12 +5,18 @@ extends HBoxContainer func _ready(): resolution_list_button.item_selected.connect(_on_resolution_selected) set_default_resolution() + remove_non_default_options() func set_default_resolution(): if resolution_list_button.get_item_count() > 6: # Ensure there are at least 6 items apply_resolution(6) # Apply the 6th resolution in the list (index 5) resolution_list_button.select(6) # Select the 6th item in the OptionButton +func remove_non_default_options(): + var default_resolution = resolution_list_button.get_item_text(6) + resolution_list_button.clear() + resolution_list_button.add_item(default_resolution) + func _on_resolution_selected(index: int): var resolution = apply_resolution(index) reposition_window_to_screen_center(resolution) diff --git a/source/settings/settings.tscn b/source/settings/settings.tscn index 98b0b14..100bab9 100644 --- a/source/settings/settings.tscn +++ b/source/settings/settings.tscn @@ -5,7 +5,8 @@ [ext_resource type="PackedScene" uid="uid://bcajgwunu16on" path="res://source/settings/display_settings/display_settings.tscn" id="2_bic18"] [node name="Settings" type="MarginContainer"] -custom_minimum_size = Vector2(835, 553) +size_flags_horizontal = 3 +size_flags_vertical = 3 script = ExtResource("1_folyo") [node name="Window" type="VBoxContainer" parent="."] diff --git a/ui/components/fast_withdraw/fast_withdraw.tscn b/ui/components/fast_withdraw/fast_withdraw.tscn index 33b4918..a52341a 100644 --- a/ui/components/fast_withdraw/fast_withdraw.tscn +++ b/ui/components/fast_withdraw/fast_withdraw.tscn @@ -110,9 +110,9 @@ offset_right = 216.0 offset_bottom = 50.0 text = "Not Connected" -[connection signal="pressed" from="ButtonRequestInvoice" to="." method="_on_button_test_pressed"] [connection signal="pressed" from="ButtonRequestInvoice" to="." method="_on_button_request_invoice_pressed"] -[connection signal="pressed" from="ButtonInvoicePaid" to="." method="_on_button_test_complete_pressed"] +[connection signal="pressed" from="ButtonRequestInvoice" to="." method="_on_button_test_pressed"] [connection signal="pressed" from="ButtonInvoicePaid" to="." method="_on_button_invoice_paid_pressed"] +[connection signal="pressed" from="ButtonInvoicePaid" to="." method="_on_button_test_complete_pressed"] [connection signal="pressed" from="ButtonCopyAddress" to="." method="_on_button_copy_address_pressed"] [connection signal="pressed" from="ButtonConnect" to="." method="_on_button_connect_pressed"] diff --git a/ui/components/fast_withdraw/fast_withdrawal.tscn b/ui/components/fast_withdraw/fast_withdrawal.tscn index 373aabe..b40c2fe 100644 --- a/ui/components/fast_withdraw/fast_withdrawal.tscn +++ b/ui/components/fast_withdraw/fast_withdrawal.tscn @@ -1,4 +1,6 @@ -[gd_scene format=3 uid="uid://bm4wk2nic02cm"] +[gd_scene load_steps=2 format=3 uid="uid://bm4wk2nic02cm"] + +[ext_resource type="PackedScene" uid="uid://duvvgc45h86gp" path="res://source/fast_withdrawal/fast_withdraw-new.tscn" id="1_5d7sy"] [node name="Fast Withdrawal" type="MarginContainer"] custom_minimum_size = Vector2(835, 553) @@ -8,94 +10,5 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Window" type="VBoxContainer" parent="."] -layout_mode = 2 -theme_override_constants/separation = 16 - -[node name="ConnectionContainer" type="HBoxContainer" parent="Window"] -layout_mode = 2 -theme_override_constants/separation = 16 - -[node name="ButtonConnect" type="Button" parent="Window/ConnectionContainer"] -custom_minimum_size = Vector2(107, 40) -layout_mode = 2 -focus_mode = 0 -text = "connect -" - -[node name="LabelConnectionStatus" type="Label" parent="Window/ConnectionContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -text = "Not Connected" - -[node name="CheckButtonLocalhost" type="CheckButton" parent="Window/ConnectionContainer"] -custom_minimum_size = Vector2(319, 0) -layout_mode = 2 -focus_mode = 0 -text = "Use localhost (debug) server" -flat = true -alignment = 1 - -[node name="HBoxContainer" type="HBoxContainer" parent="Window"] -layout_mode = 2 -theme_override_constants/separation = 16 - -[node name="LineEditMainchainAddress" type="LineEdit" parent="Window/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -placeholder_text = "Enter mainchain address" - -[node name="Label" type="Label" parent="Window/HBoxContainer"] -layout_mode = 2 -text = "Amount to withdraw: -" - -[node name="SpinBoxAmount" type="SpinBox" parent="Window/HBoxContainer"] -layout_mode = 2 -min_value = 1.0 -value = 1.0 -suffix = "BTC" - -[node name="VBoxContainer" type="VBoxContainer" parent="Window"] -layout_mode = 2 - -[node name="ButtonRequestInvoice" type="Button" parent="Window/VBoxContainer"] -custom_minimum_size = Vector2(378, 40) -layout_mode = 2 -size_flags_horizontal = 0 -focus_mode = 0 -text = "Request fast withdrawal test invoice" - -[node name="HBoxContainer" type="HBoxContainer" parent="Window/VBoxContainer"] -layout_mode = 2 - -[node name="LabelInvoice" type="Label" parent="Window/VBoxContainer/HBoxContainer"] -custom_minimum_size = Vector2(0, 64) -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="ButtonCopyAddress" type="Button" parent="Window/VBoxContainer/HBoxContainer"] -custom_minimum_size = Vector2(157, 40) -layout_mode = 2 -size_flags_vertical = 8 -focus_mode = 0 -text = "Copy Address -" - -[node name="VBoxContainer2" type="VBoxContainer" parent="Window"] -layout_mode = 2 -theme_override_constants/separation = 16 - -[node name="LineEditTXID" type="LineEdit" parent="Window/VBoxContainer2"] -layout_mode = 2 -placeholder_text = "Enter L2 payment txid" - -[node name="ButtonInvoicePaid" type="Button" parent="Window/VBoxContainer2"] -custom_minimum_size = Vector2(142, 40) -layout_mode = 2 -size_flags_horizontal = 0 -focus_mode = 0 -text = "Invoice Paid" - -[node name="LabelComplete" type="Label" parent="Window/VBoxContainer2"] +[node name="FastWithdraw" parent="." instance=ExtResource("1_5d7sy")] layout_mode = 2 diff --git a/ui/components/left_menu/left_menu.gd b/ui/components/left_menu/left_menu.gd index d11c71f..baa5ecf 100644 --- a/ui/components/left_menu/left_menu.gd +++ b/ui/components/left_menu/left_menu.gd @@ -4,15 +4,21 @@ extends PanelContainer @onready var author_label: Label = $MarginContainer/HBox/Author @onready var next_button: Button = $MarginContainer/HBox/NextButton @onready var prev_button: Button = $MarginContainer/HBox/PrevButton - -var quotes: Array = [] # Changed to untyped Array +var quotes: Array = [] var current_quote_index: int = 0 +var quote_timer: Timer func _ready() -> void: load_quotes() change_quote(0) next_button.pressed.connect(self._on_next_button_pressed) prev_button.pressed.connect(self._on_prev_button_pressed) + + quote_timer = Timer.new() + quote_timer.timeout.connect(self._on_quote_timer_timeout) + quote_timer.set_wait_time(10) + add_child(quote_timer) + quote_timer.start() func load_quotes(): var file_path = "res://assets/data/quotes.json" @@ -28,7 +34,7 @@ func load_quotes(): if error_parse == OK: var data = json.get_data() if data is Array: - quotes = data # Directly assign the parsed data + quotes = data else: push_error("JSON data is not an array") else: @@ -41,8 +47,17 @@ func change_quote(index: int): return var quote_data = quotes[index] if quote_data is Dictionary and quote_data.has("quote") and quote_data.has("author"): - quotes_label.text = "\"" + quote_data["quote"] + "\"" + var quote_text = quote_data["quote"] + quotes_label.text = "\"" + quote_text + "\"" author_label.text = "- " + quote_data["author"] + + var word_count = quote_text.split(" ").size() + if word_count < 30: + quotes_label.add_theme_font_size_override("font_size", 17) + elif word_count < 50: + quotes_label.add_theme_font_size_override("font_size", 14) + else: + quotes_label.add_theme_font_size_override("font_size", 13) else: push_error("Invalid quote data format") @@ -59,7 +74,17 @@ func fade_quote(index: int): func _on_next_button_pressed(): current_quote_index = (current_quote_index + 1) % quotes.size() fade_quote(current_quote_index) + reset_quote_timer() func _on_prev_button_pressed(): current_quote_index = (current_quote_index - 1 + quotes.size()) % quotes.size() fade_quote(current_quote_index) + reset_quote_timer() + +func _on_quote_timer_timeout(): + current_quote_index = (current_quote_index + 1) % quotes.size() + fade_quote(current_quote_index) + +func reset_quote_timer(): + quote_timer.stop() + quote_timer.start() diff --git a/ui/components/left_menu/left_menu.tscn b/ui/components/left_menu/left_menu.tscn index a4c9852..ead1a98 100644 --- a/ui/components/left_menu/left_menu.tscn +++ b/ui/components/left_menu/left_menu.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=9 format=3 uid="uid://dwhtby81ylt3s"] +[gd_scene load_steps=8 format=3 uid="uid://dwhtby81ylt3s"] [ext_resource type="Script" path="res://ui/components/left_menu/left_menu.gd" id="1_yja75"] [ext_resource type="Texture2D" uid="uid://blq6pvspmkcbj" path="res://assets/images/prev.svg" id="3_3lhq3"] [ext_resource type="Texture2D" uid="uid://c5ddyq86urmmy" path="res://assets/images/next.svg" id="7_k0tsh"] [ext_resource type="Script" path="res://ui/components/left_menu/Quotes.gd" id="7_kx1k8"] -[ext_resource type="PackedScene" uid="uid://b5wmjp1psgsvr" path="res://ui/components/fast_withdraw/fast_withdraw.tscn" id="10_kuvno"] [ext_resource type="FontFile" uid="uid://ciu7chyqqs4k7" path="res://assets/fonts/Saira_Expanded-Bold.ttf" id="11_6qy05"] [ext_resource type="FontFile" uid="uid://dgxbgdcr3s84u" path="res://assets/fonts/Saira_Expanded-Regular.ttf" id="12_nwgc3"] @@ -17,11 +16,11 @@ anchors_preset = 12 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -offset_top = -43.0 +offset_top = -123.0 grow_horizontal = 2 grow_vertical = 0 size_flags_horizontal = 3 -size_flags_vertical = 8 +size_flags_vertical = 6 theme_override_styles/panel = SubResource("StyleBoxFlat_c8gs8") script = ExtResource("1_yja75") @@ -33,9 +32,7 @@ theme_override_constants/margin_right = 8 theme_override_constants/margin_bottom = 8 [node name="HBox" type="HBoxContainer" parent="MarginContainer"] -custom_minimum_size = Vector2(200, 0) layout_mode = 2 -size_flags_vertical = 8 size_flags_stretch_ratio = 0.0 theme_override_constants/separation = 8 @@ -44,41 +41,23 @@ layout_mode = 2 text = "Prev" [node name="Quotes" type="Label" parent="MarginContainer/HBox"] -visible = false custom_minimum_size = Vector2(250, 0) layout_mode = 2 size_flags_horizontal = 3 -theme_override_font_sizes/font_size = 10 -text = "\"Used to the conditions of a capitalistic environment, the average American takes it for granted that every year business makes something new and better accessible to him. Looking backward upon the years of his own life, he realizes that many implements that were totally unknown in the days of his youth and many others which at that time could be enjoyed only by a small minority are now standard equipment of almost every household.\" ---Ludwig von Mises" -horizontal_alignment = 2 +size_flags_vertical = 1 +theme_override_font_sizes/font_size = 13 +horizontal_alignment = 1 +vertical_alignment = 1 autowrap_mode = 2 [node name="Author" type="Label" parent="MarginContainer/HBox"] layout_mode = 2 - -[node name="Spacer3" type="Control" parent="MarginContainer/HBox"] -layout_mode = 2 -size_flags_horizontal = 3 +theme_override_font_sizes/font_size = 16 [node name="NextButton" type="Button" parent="MarginContainer/HBox"] layout_mode = 2 text = "Next" -[node name="FastWithdrawWindow" type="Window" parent="."] -title = "Fast Withdrawal" -initial_position = 2 -size = Vector2i(800, 500) -visible = false -wrap_controls = true -transient = true -exclusive = true -unresizable = true -content_scale_mode = 1 -content_scale_aspect = 4 - -[node name="FastWithdraw" parent="FastWithdrawWindow" instance=ExtResource("10_kuvno")] - [node name="QuotesDialog" type="AcceptDialog" parent="."] title = "QUOTES" initial_position = 2 @@ -142,6 +121,5 @@ autowrap_mode = 2 script = ExtResource("7_kx1k8") author_label = NodePath("../Header/Author") -[connection signal="close_requested" from="FastWithdrawWindow" to="." method="_on_fast_withdraw_window_close_requested"] [connection signal="pressed" from="QuotesDialog/Box/Header/PrevButton" to="QuotesDialog/Box/Quotes" method="_on_prev_button_pressed"] [connection signal="pressed" from="QuotesDialog/Box/Header/NextButton" to="QuotesDialog/Box/Quotes" method="_on_next_button_pressed"] diff --git a/wallet_master_seeds.txt b/wallet_master_seeds.txt deleted file mode 100644 index 22bd227..0000000 --- a/wallet_master_seeds.txt +++ /dev/null @@ -1 +0,0 @@ -{"bip39_bin":"11001010100101111000000100010010110010100001101110111101110010101111101011000010001100011011001110011010001000111101110001001101","bip39_csum":"1011","bip39_csum_hex":"b","bip39_hex":"ca978112ca1bbdcafac231b39a23dc4d","chain_code":"9250b090a8c02ee9569da131dab44dc054d1317882d5385cfb2d4b6fc9700e31","hd_key_data":"b10fdfad72f12115b89c1a0baf3bc37889e882828605b1c30535bbdfdca7d195","master_key":"b19ac2c4ead10c83a8c3d0fd0c09878907ccc0bfc3cc643059273f98bd55cd49","mnemonic":"skin rose dwarf neither rookie tornado twelve economy receive speed warfare opinion","seed":"046342d648a9d352f23500812cda959dcc82539ebab2514674bd607641a1f822f38d290353a0d73067f9e7eac86642eda39f69f66a51b7d0d8eba9c9caa1ba96"}