Skip to content

Commit 04237ea

Browse files
committed
man override esc for upgrades
1 parent be09d02 commit 04237ea

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

scenes/main_scene.tscn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ grow_horizontal = 2
542542
grow_vertical = 2
543543

544544
[node name="InventoryMenu" parent="UI/CenterContainer" instance=ExtResource("14_4bgka")]
545-
visible = false
546545
layout_mode = 2
547546

548547
[node name="BossDialog" type="PanelContainer" parent="UI/CenterContainer"]
@@ -619,7 +618,6 @@ text = "Respawn
619618
"
620619

621620
[node name="PauseMenu" parent="UI/CenterContainer" instance=ExtResource("17_k3g67")]
622-
visible = false
623621
layout_mode = 2
624622

625623
[node name="Cheats" parent="UI" instance=ExtResource("13_4w45t")]

scripts/upgrades.gd

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func create_upgrade_button(key):
274274

275275
var indicator_style = StyleBoxFlat.new()
276276
indicator_style.bg_color = Color(0.545, 0.545, 0.545) # bright gray for unachieved levels
277-
277+
278278
if i < current_level:
279279
# Filled level
280280
indicator_style.bg_color = Color(0.3, 0.7, 1.0) # Bright blue for achieved levels
@@ -429,12 +429,11 @@ func update_button_state(key):
429429
var indicator = level_indicators[i]
430430
var indicator_style = indicator.get_theme_stylebox("panel")
431431

432+
# Empty level
433+
indicator_style.bg_color = Color(0.307, 0.307, 0.307, 0.5)
432434
if i < current_level:
433435
# Filled level
434436
indicator_style.bg_color = Color(0.3, 0.7, 1.0)
435-
else:
436-
# Empty level
437-
indicator_style.bg_color = Color(0.2, 0.2, 0.25, 0.5)
438437

439438
# Update cost/level info
440439
if is_max_level:
@@ -535,13 +534,7 @@ func refresh_all_upgrades():
535534

536535
# Add variable to track visibility changes
537536
var was_visible = false
538-
539-
# Also use _unhandled_key_input to catch the ESC key directly if the shortcut doesn't work
540-
func _unhandled_key_input(event):
541-
if event is InputEventKey and event.keycode == KEY_ESCAPE and event.pressed and not event.echo:
542-
if GameState.isDocked and visible:
543-
close_upgrade_menu()
544-
get_viewport().set_input_as_handled()
537+
var man_override = false
545538

546539
# Function to close the upgrade menu
547540
func close_upgrade_menu():
@@ -551,8 +544,10 @@ func close_upgrade_menu():
551544

552545
func _process(_delta):
553546
if GameState.isDocked:
554-
visible = true
547+
if !man_override:
548+
visible = true
555549
if Input.is_action_pressed("esc"):
550+
man_override = true
556551
close_upgrade_menu()
557552
return
558553

@@ -566,3 +561,4 @@ func _process(_delta):
566561
else:
567562
visible = false
568563
was_visible = false
564+
man_override = false

0 commit comments

Comments
 (0)