From 741600b2ce6e10fe78a563ecefedd910ab2b9ac6 Mon Sep 17 00:00:00 2001 From: Gregory Marco Date: Sun, 18 Oct 2026 15:00:43 -0500 Subject: [PATCH] Dynamically adjust E/Space hint in Old Computer depending on input mode. --- OldComputer.tscn | 2 +- old_computer.gd | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/OldComputer.tscn b/OldComputer.tscn index 3f5d4e0..1b58591 100644 --- a/OldComputer.tscn +++ b/OldComputer.tscn @@ -101,6 +101,6 @@ text = "[center]>> PharaOS 2000 Boot Sequence >> [color=red]WARN[/color]: Detected anomalies! >> [color=red]WARN[/color]: Memory integrity at [color=red]%d%%[/color]! >> [color=green]User[/color]: Please load backup data disk ([color=green]1 of 4[/color]) ->> [color=#4278ff]Player[/color]: Press [color=#4278ff]interact [E][/color] or [color=#4278ff]jump [Space][/color] to exit." +>> [color=#4278ff]Player[/color]: Press [color=#4278ff]interact [{INTERACT}][/color] or [color=#4278ff]jump [{JUMP}][/color] to exit." fit_content = true vertical_alignment = 1 diff --git a/old_computer.gd b/old_computer.gd index 7ba3acf..e6298a1 100644 --- a/old_computer.gd +++ b/old_computer.gd @@ -6,8 +6,10 @@ var disks_loaded = [] var starting_integrity = 2 var total_integrity = starting_integrity + len(disks_wanted) +var base_text: String = "" + func _ready() -> void: - $ConsoleText.text = $ConsoleText.text % get_memory_integrity() + base_text = $ConsoleText.text % get_memory_integrity() func load_disk(disk_num: int) -> bool: if !disk_num or (disk_num in disks_loaded): @@ -34,7 +36,7 @@ func load_disk(disk_num: int) -> bool: ">> [color=green]System initialization complete[/color]. Beginning reactivation sequence." ) printline( - ">> [color=#4278ff]Player[/color]: Press [color=#4278ff][E][/color] or [color=#4278ff][Space][/color] to return to the outside world." + ">> [color=#4278ff]Player[/color]: Press [color=#4278ff][{INTERACT}][/color] or [color=#4278ff][{JUMP}][/color] to return to the outside world." ) return true @@ -51,13 +53,24 @@ func has_finished_initialization() -> bool: return disks_wanted.is_empty() func open() -> void: + render_text() visible = true $BackgroundPanel/ForegroundPanel/ScreenPanel/OldComputerShader.show() %Player2D/Parallax2D.hide() func printline(line: String) -> void: open() - $ConsoleText.text += "\n" + line + base_text += "\n" + line + render_text() + +func render_text() -> void: + var interact_key = "E" + var jump_key = "Space" + if %Player2D.controller_ui: + interact_key = "B" + jump_key = "A" + + $ConsoleText.text = base_text.replace("{INTERACT}", interact_key).replace("{JUMP}", jump_key) func close() -> void: if has_finished_initialization():