From 7398a9ee6a996fb8e70b9b8be1d7ab4263291e5f Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Sat, 15 Nov 2025 20:12:23 +0100 Subject: [PATCH] Add Research Lab functionality and update related components --- resources/lang/en.json | 19 +++++++++++------- src/client/HostLobbyModal.ts | 2 +- src/client/InputHandler.ts | 1 + src/client/SinglePlayerModal.ts | 4 +++- src/client/graphics/layers/BuildMenu.ts | 2 ++ .../graphics/layers/PlayerInfoOverlay.ts | 5 ++++- src/client/graphics/layers/StructureLayer.ts | 20 +++++++++++++++++-- src/client/utilities/RenderUnitTypeOptions.ts | 1 + src/core/configuration/DefaultConfig.ts | 1 + src/core/execution/ExecutionManager.ts | 3 ++- src/core/execution/PlayerExecution.ts | 14 ++++++++++++- .../execution/UpgradeStructureExecution.ts | 1 + src/core/game/PlayerImpl.ts | 3 ++- src/core/game/UnitImpl.ts | 11 ++++++++++ 14 files changed, 72 insertions(+), 15 deletions(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index 8a44672f2..3697a4c0d 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -125,9 +125,10 @@ "bots": "Bots: ", "bots_disabled": "Disabled", "disable_nations": "Disable Nations", - "instant_build": "Instant build", - "infinite_gold": "Infinite gold", - "infinite_troops": "Infinite troops", + "instant_build": "Instant Build", + "instant_research": "Instant Research", + "infinite_gold": "Infinite Gold", + "infinite_troops": "Infinite Troops", "disable_nukes": "Disable Nukes", "enables_title": "Enable Settings", "start": "Start Game" @@ -168,7 +169,7 @@ "fantasy": "Other" }, "starting_gold": { - "label": "Starting gold", + "label": "Starting Gold", "default": "0 (default)", "millions": "{amount}M" }, @@ -206,9 +207,10 @@ "bots": "Bots: ", "bots_disabled": "Disabled", "disable_nations": "Disable Nations", - "instant_build": "Instant build", - "infinite_gold": "Infinite gold", - "infinite_troops": "Infinite troops", + "instant_build": "Instant Build", + "instant_research": "Instant Research", + "infinite_gold": "Infinite Gold", + "infinite_troops": "Infinite Troops", "peace_timer": "Protected Start", "peace_timer_none": "None", "peace_timer_minutes": "{minutes} minutes", @@ -262,6 +264,7 @@ "mirv": "MIRV", "hospital": "Hospital", "academy": "Military Academy", + "research_lab": "Research Lab", "airfield": "Airfield", "air_field": "Airfield", "fighter_jet": "Fighter Jet" @@ -348,6 +351,8 @@ "build_hospital_desc": "Set the hotkey to build a Hospital.", "build_academy": "Build Academy", "build_academy_desc": "Set the hotkey to build an Academy.", + "build_research_lab": "Build Research Lab", + "build_research_lab_desc": "Set the hotkey to build a Research Lab.", "build_missile_silo": "Build Missile Silo", "build_missile_silo_desc": "Set the hotkey to build a Missile Silo.", "build_sam_launcher": "Build SAM Launcher", diff --git a/src/client/HostLobbyModal.ts b/src/client/HostLobbyModal.ts index 8b96dd05b..f450f89a1 100644 --- a/src/client/HostLobbyModal.ts +++ b/src/client/HostLobbyModal.ts @@ -373,7 +373,7 @@ export class HostLobbyModal extends LitElement { .checked=${this.instantResearchHumanOnly} />
- Instant Research + ${translateText("host_modal.instant_research")}
diff --git a/src/client/InputHandler.ts b/src/client/InputHandler.ts index 0c206d9a1..630e629e2 100644 --- a/src/client/InputHandler.ts +++ b/src/client/InputHandler.ts @@ -377,6 +377,7 @@ export class InputHandler { [this.keybinds.buildAirfield]: UnitType.Airfield, [this.keybinds.buildHospital]: UnitType.Hospital, [this.keybinds.buildAcademy]: UnitType.Academy, + [this.keybinds.buildResearchLab]: UnitType.ResearchLab, [this.keybinds.buildMissileSilo]: UnitType.MissileSilo, [this.keybinds.buildSAMLauncher]: UnitType.SAMLauncher, [this.keybinds.buildDefensePost]: UnitType.DefensePost, diff --git a/src/client/SinglePlayerModal.ts b/src/client/SinglePlayerModal.ts index e7bcc296a..2df303d27 100644 --- a/src/client/SinglePlayerModal.ts +++ b/src/client/SinglePlayerModal.ts @@ -275,7 +275,9 @@ export class SinglePlayerModal extends LitElement { @change=${this.handleInstantResearchHumanOnlyChange} .checked=${this.instantResearchHumanOnly} /> -
Instant Research
+
+ ${translateText("single_modal.instant_research")} +