Skip to content

Commit

Permalink
remove the undo button if no action possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ARKANYOTA committed Aug 27, 2024
1 parent faa96a5 commit 11d6397
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/scripts/ui/game_gui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ func show_correct_game_gui():
# Called when the node enters the scene tree for the first time.
func _ready():
hide_gui()

func _process(_delta):
var scene = get_tree().get_current_scene()
if scene == null:
return

if (not scene is Level) or (scene is Level and len(scene.actions) == 0):
$Control/LevelActions/UndoButton.hide()
else:
$Control/LevelActions/UndoButton.show()

func show_level_select():
$Control/LevelSelectPauseButton.hide()
Expand Down

0 comments on commit 11d6397

Please sign in to comment.