fix popup shifting
This commit is contained in:
parent
c8bd0412f3
commit
3369c37a00
4 changed files with 23 additions and 26 deletions
|
@ -33,7 +33,6 @@ onready var easy_button = $Panel/VBoxContainer/Difficulty/Easy
|
|||
onready var normal_button = $Panel/VBoxContainer/Difficulty/Normal
|
||||
onready var hard_button = $Panel/VBoxContainer/Difficulty/Hard
|
||||
onready var custom_button = $Panel/VBoxContainer/HBoxContainer/Custom
|
||||
onready var edit_button = $Panel/Edit
|
||||
|
||||
onready var columns_spinbox = $EditPanel/VBoxContainer/Columns/SpinBox
|
||||
onready var rows_spinbox = $EditPanel/VBoxContainer/Rows/SpinBox
|
||||
|
@ -59,7 +58,7 @@ func _ready():
|
|||
edit_panel.set("custom_styles/panel", modified_panel_style)
|
||||
panel.show()
|
||||
edit_panel.hide()
|
||||
edit_button.hide()
|
||||
edit_panel.hide()
|
||||
|
||||
var button_max_width: int = $EditPanel/VBoxContainer.rect_size.x / 3.5
|
||||
var button_width := min(200, button_max_width)
|
||||
|
@ -70,14 +69,12 @@ func _ready():
|
|||
custom_button.rect_min_size.x = button_width
|
||||
|
||||
func fade_in():
|
||||
rect_pivot_offset = rect_size / 2
|
||||
tween.remove_all()
|
||||
tween.interpolate_property(self, "rect_scale", Vector2(fade_scale_factor, fade_scale_factor), Vector2.ONE, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
|
||||
tween.interpolate_property(self, "modulate:a", 0.0, 1.0, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
|
||||
tween.start()
|
||||
|
||||
func fade_out():
|
||||
rect_pivot_offset = rect_size / 2
|
||||
tween.remove_all()
|
||||
tween.interpolate_property(self, "rect_scale", Vector2.ONE, Vector2(fade_scale_factor, fade_scale_factor), fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
|
||||
tween.interpolate_property(self, "modulate:a", 1.0, 0.0, fade_duration, Tween.TRANS_LINEAR, Tween.EASE_IN)
|
||||
|
@ -193,9 +190,6 @@ func _on_NewGamePanel_about_to_show():
|
|||
rows_spinbox.value = preferences.get_value("game", "custom_rows", normal_rows)
|
||||
iterations_spinbox.value = preferences.get_value("game", "custom_shuffle_iterations", normal_iterations)
|
||||
|
||||
if custom_button.pressed:
|
||||
edit_button.show()
|
||||
|
||||
_update_description()
|
||||
|
||||
# $Panel/Start.grab_focus()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue