Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new wallet location and mainchain starter. requires updated godot engine #109

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified resource/theme/black.theme
Binary file not shown.
22 changes: 16 additions & 6 deletions source/application/wallet_creator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func save_wallet_data():
return

var user_data_dir = OS.get_user_data_dir()
var file = FileAccess.open(user_data_dir.path_join("starters/wallet_master_seed.txt"), FileAccess.WRITE)
var file = FileAccess.open(user_data_dir.path_join("wallet_starters/wallet_master_seed.txt"), FileAccess.WRITE)
var json_string = JSON.stringify(seed_data)
file.store_string(json_string)
file.close()
Expand Down Expand Up @@ -482,7 +482,7 @@ func _on_load_button_pressed():
"seed_hex": result["seed"]
}
var user_data_dir = OS.get_user_data_dir()
var file = FileAccess.open(user_data_dir.path_join("starters/wallet_master_seed.txt"), FileAccess.WRITE)
var file = FileAccess.open(user_data_dir.path_join("wallet_starters/wallet_master_seed.txt"), FileAccess.WRITE)
var json_string = JSON.stringify(seed_data)
file.store_string(json_string)
file.close()
Expand Down Expand Up @@ -522,13 +522,23 @@ func save_sidechain_info(sidechain_data):
if key.begins_with("sidechain_"):
var slot = key.split("_")[1]
var user_data_dir = OS.get_user_data_dir()
var filename = user_data_dir.path_join("starters/sidechain_%s_starter.txt" % slot)
var filename = user_data_dir.path_join("wallet_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)
elif key.begins_with("mainchain"):
var user_data_dir = OS.get_user_data_dir()
var filename = user_data_dir.path_join("wallet_starters/mainchain_starter.txt")
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 mainchain")


func reset_wallet_tab():

Expand All @@ -545,7 +555,7 @@ func _on_tab_changed(tab):

func ensure_starters_directory():
var user_data_dir = OS.get_user_data_dir()
var starters_dir = user_data_dir.path_join("starters")
var starters_dir = user_data_dir.path_join("wallet_starters")
var dir = DirAccess.open(user_data_dir)
if not dir.dir_exists("starters"):
dir.make_dir("starters")
if not dir.dir_exists("wallet_starters"):
dir.make_dir("wallet_starters")
1 change: 1 addition & 0 deletions source/fast_withdrawal/fast_withdraw-new.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ layout_mode = 2

[node name="ChainSelectionButton" type="OptionButton" parent="HBoxContainer2"]
layout_mode = 2
theme_override_font_sizes/font_size = 14
item_count = 3
selected = 0
popup/item_0/text = "Testchain"
Expand Down
8 changes: 8 additions & 0 deletions source/nodes/node_panel/node_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ func update_sidechain_view():
download_button.disabled = not drivechain_running
if not drivechain_running:
download_button.modulate = Color(0.5, 0.5, 0.5) # Grey out the button
heading_label.modulate = Color(0.5, 0.5, 0.5) # Grey out the heading text
description_label.modulate = Color(0.5, 0.5, 0.5) # Grey out the description text
else:
download_button.modulate = Color(1, 1, 1) # Normal color
heading_label.modulate = Color(1, 1, 1) # Normal color for heading text
description_label.modulate = Color(1, 1, 1) # Normal color for description text
update_button_state()

func update_overlay():
Expand All @@ -115,9 +119,13 @@ func update_overlay():
if drivechain_running:
overlay.color = Color(1, 1, 1, 0)
overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE
heading_label.modulate = Color(1, 1, 1) # Normal color for heading text
description_label.modulate = Color(1, 1, 1) # Normal color for description text
else:
overlay.color = Color(1, 1, 1, 0.5) # Semi-transparent white
overlay.mouse_filter = Control.MOUSE_FILTER_STOP
heading_label.modulate = Color(0.5, 0.5, 0.5) # Grey out the heading text
description_label.modulate = Color(0.5, 0.5, 0.5) # Grey out the description text

func update_button_state():
var drivechain_provider = Appstate.get_drivechain_provider()
Expand Down
Binary file removed starters/.DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion starters/STARTERS.md

This file was deleted.

21 changes: 15 additions & 6 deletions ui/components/left_menu/left_menu.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[gd_scene load_steps=8 format=3 uid="uid://dwhtby81ylt3s"]
[gd_scene load_steps=6 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://c865fxarlp4e1" path="res://assets/images/left-arrow-svgrepo-com.png" id="2_5g8my"]
[ext_resource type="Texture2D" uid="uid://4ulwmgydwoi2" path="res://assets/images/right-arrow-next-svgrepo-com (2).png" id="3_2rq81"]
[ext_resource type="Script" path="res://ui/components/left_menu/Quotes.gd" id="7_kx1k8"]
[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"]
Expand Down Expand Up @@ -38,12 +36,18 @@ theme_override_constants/separation = 8

[node name="PrevButton" type="Button" parent="MarginContainer/HBox"]
texture_filter = 4
layout_direction = 1
layout_mode = 2
size_flags_horizontal = 4
size_flags_horizontal = 0
size_flags_vertical = 4
icon = ExtResource("2_5g8my")
theme_override_font_sizes/font_size = 38
text = "<"
flat = true

[node name="Control" type="Control" parent="MarginContainer/HBox"]
custom_minimum_size = Vector2(5, 2.08165e-12)
layout_mode = 2

[node name="Quotes" type="Label" parent="MarginContainer/HBox"]
custom_minimum_size = Vector2(250, 0)
layout_direction = 3
Expand All @@ -54,12 +58,17 @@ theme_override_font_sizes/font_size = 13
vertical_alignment = 1
autowrap_mode = 2

[node name="Control2" type="Control" parent="MarginContainer/HBox"]
custom_minimum_size = Vector2(5, 2.08165e-12)
layout_mode = 2

[node name="NextButton" type="Button" parent="MarginContainer/HBox"]
texture_filter = 4
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 4
icon = ExtResource("3_2rq81")
theme_override_font_sizes/font_size = 38
text = ">"
flat = true

[node name="QuotesDialog" type="AcceptDialog" parent="."]
Expand Down
Loading