Skip to content

Commit

Permalink
Fixed a couple bugs introduced by the UI update.
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitprodigy committed Feb 28, 2024
1 parent e2dd633 commit 2c7562a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 27 deletions.
2 changes: 1 addition & 1 deletion assets/csv/quotes.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"It is in the interest of tyrants to reduce the people to ignorance and vice. For they cannot live in any country where virtue and knowledge prevail.",Samuel Adams
"I'm sure that in 20 years there will either be very large transaction volume or no volume.",Satoshi Nakamoto
"Inflation is taxation without legislation.",Milton Friedman
"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
"Poorly paid labor is inefficient labor, the world over.",Henry George
"When everybody owns something, nobody owns it, and nobody has a direct interest in maintaining or improving its condition. That is why buildings in the Soviet Union - like public housing in the United States - look decrepit within a year or two of their construction.",Milton Friedman
"Economics is haunted by more fallacies than any other study known to man. This is no accident. The inherent difficulties of the subject would be great enough in any case, but they are multiplied a thousandfold by a factor that is insignificant in, say, physics, mathematics or medicine - the special pleading of selfish interests.",Henry Hazlitt
"Nobody ever saw a dog make a fair and deliberate exchange of one bone for another with another dog. Nobody ever saw one animal by its gestures and natural cries signify to another, this is mine, that yours; I am willing to give this for that.",Adam Smith
"I'm sure that in 20 years there will either be very large transaction volume or no volume.",Satoshi Nakamoto
10 changes: 8 additions & 2 deletions ui/components/dashboard/base_dashboard_panel/ActionButton.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const state_name : Array[String] = [
]

var is_drivechain : bool = false
var shimmer_tween : Tween

@export_enum("Download", "Run", "Stop") var state : int = DOWNLOAD
@export var show_icon : bool = true
Expand Down Expand Up @@ -43,15 +44,20 @@ func set_state(new_state:int):
set_text(state_name[state])
set_button_icon(state_icon[state])
set_theme(state_theme[state])
check_state()
shimmer()
disabled = false

func check_state():
if state == DOWNLOAD and is_drivechain:
shimmer()
pass

func shimmer():
var shimmer_tween : Tween = create_tween()
if !(state == DOWNLOAD and is_drivechain):
if shimmer_tween: shimmer_tween.stop()
return
shimmer_tween = create_tween()
shimmer_tween.tween_property(self, "modulate", Color(1.0,1.0,1.0,0.5),0.5)
shimmer_tween.tween_property(self, "modulate", Color(1.0,1.0,1.0,1.5),0.5)
shimmer_tween.tween_callback(shimmer).set_delay(0.75)

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var available : bool = true
var enabled_modulate : Color
var disabled_modulate : Color


func _ready():
Appstate.connect("chain_states_changed", self.update_view)
enabled_modulate = modulate
Expand Down Expand Up @@ -91,7 +92,7 @@ func update_view():
show_running_state()

func show_waiting_on_drivechain_state():
action_button.hide()
action_button.disabled = true
#auto_mine_button.visible = false
refresh_bmm_button.visible = false
secondary_desc.visible = true
Expand Down Expand Up @@ -300,3 +301,7 @@ func _on_focus_entered():

func _on_focus_exited():
if chain_provider.chain_type == ChainProvider.c_type.MAIN: return


func _on_settings_button_pressed():
Appstate.show_chain_provider_info(chain_provider)
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ size_flags_horizontal = 0
color = Color(0.207843, 0.517647, 0.894118, 1)

[connection signal="pressed" from="Margin/Footer/ActionButton" to="." method="_on_action_button_pressed"]
[connection signal="pressed" from="Margin/Footer/SettingsButton" to="." method="_on_settings_button_pressed"]
11 changes: 7 additions & 4 deletions ui/components/left_menu/left_menu.gd
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
extends PanelContainer

@onready var dashboard_button := $HBox/DashboardButton
@onready var playground_button := $HBox/PlaygroundButton
@onready var settings_button := $HBox/SettingsButton
@onready var dashboard_button := $MarginContainer/HBox/DashboardButton
@onready var playground_button := $MarginContainer/HBox/PlaygroundButton
@onready var settings_button := $MarginContainer/HBox/SettingsButton

signal left_menu_button_pressed(v: int)

func _on_left_menu_button_toggled(button_pressed, v):
settings_button.set_pressed_no_signal(false)
return
match v:
0:
if button_pressed:
#playground_button.set_pressed_no_signal(false)
settings_button.set_pressed_no_signal(false)
#playground_button.set_pressed_no_signal(false)

#1:
# if button_pressed:
# dashboard_button.set_pressed_no_signal(false)
Expand Down
34 changes: 15 additions & 19 deletions ui/components/left_menu/left_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ size_flags_vertical = 8
size_flags_stretch_ratio = 0.0
theme_override_constants/separation = 0

[node name="CloseButton" type="Button" parent="MarginContainer/HBox"]
[node name="SettingsButton" type="Button" parent="MarginContainer/HBox"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
icon = ExtResource("2_ahqh1")
flat = true
focus_mode = 0
theme = ExtResource("1_vs06l")
toggle_mode = true
icon = ExtResource("4_cr7m3")
alignment = 0

[node name="PrevButton" type="Button" parent="MarginContainer/HBox"]
layout_mode = 2
Expand Down Expand Up @@ -82,18 +83,6 @@ toggle_mode = true
text = "PLAYGROUND"
alignment = 0

[node name="SettingsButton" type="Button" parent="MarginContainer/HBox"]
visible = false
custom_minimum_size = Vector2(0, 40)
layout_mode = 2
size_flags_vertical = 4
focus_mode = 0
theme = ExtResource("1_vs06l")
toggle_mode = true
text = "SETTINGS"
icon = ExtResource("4_cr7m3")
alignment = 0

[node name="Quotes" type="Label" parent="MarginContainer/HBox"]
custom_minimum_size = Vector2(250, 0)
layout_mode = 2
Expand All @@ -116,9 +105,16 @@ size_flags_vertical = 4
icon = ExtResource("7_k0tsh")
flat = true

[connection signal="pressed" from="MarginContainer/HBox/CloseButton" to="." method="_on_close_button_pressed"]
[node name="CloseButton" type="Button" parent="MarginContainer/HBox"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
icon = ExtResource("2_ahqh1")
flat = true

[connection signal="toggled" from="MarginContainer/HBox/SettingsButton" to="." method="_on_left_menu_button_toggled" binds= [1]]
[connection signal="pressed" from="MarginContainer/HBox/PrevButton" to="MarginContainer/HBox/Quotes" method="_on_prev_button_pressed"]
[connection signal="toggled" from="MarginContainer/HBox/DashboardButton" to="." method="_on_left_menu_button_toggled" binds= [0]]
[connection signal="toggled" from="MarginContainer/HBox/PlaygroundButton" to="." method="_on_left_menu_button_toggled" binds= [1]]
[connection signal="toggled" from="MarginContainer/HBox/SettingsButton" to="." method="_on_left_menu_button_toggled" binds= [1]]
[connection signal="pressed" from="MarginContainer/HBox/NextButton" to="MarginContainer/HBox/Quotes" method="_on_next_button_pressed"]
[connection signal="pressed" from="MarginContainer/HBox/CloseButton" to="." method="_on_close_button_pressed"]

0 comments on commit 2c7562a

Please sign in to comment.