From 294bea82f60123b16ace2b2993c039f9279e398b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=AA=E5=91=B3=E9=BA=BB=E9=85=B1?= <93972760+TaranDahl@users.noreply.github.com> Date: Tue, 23 Jun 2026 19:31:06 +0800 Subject: [PATCH 1/3] core --- CREDITS.md | 1 + Phobos.vcxproj | 2 ++ docs/New-or-Enhanced-Logics.md | 10 ++++++++++ docs/Whats-New.md | 1 + docs/locale/zh_CN/LC_MESSAGES/CREDITS.po | 3 +++ .../zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po | 11 +++++++++++ docs/locale/zh_CN/LC_MESSAGES/Whats-New.po | 7 +++++++ src/Ext/Beacon/Hooks.cpp | 9 +++++++++ src/Ext/Rules/Body.cpp | 2 ++ src/Ext/Rules/Body.h | 2 ++ 10 files changed, 48 insertions(+) create mode 100644 src/Ext/Beacon/Hooks.cpp diff --git a/CREDITS.md b/CREDITS.md index b9f6702256..f3fe21c7e0 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -732,6 +732,7 @@ This page lists all the individual contributions to the project by their author. - Bunkerable checks dehardcode - Prevent the units with locomotors that cause problems from entering the tank bunker - No turret unit turn to the target + - Allow beacon placement hotkey in single player - Units are now unable to kick out from a factory that is in construction process - Fix issues caused by incorrect reference removal (f.ex. If the unit cloaks/enters transport, it cannot gain experience from previously launched spawners/C4/projectiles) - Recycle spawner in long-range diff --git a/Phobos.vcxproj b/Phobos.vcxproj index 71182c168e..97f5afc0cb 100644 --- a/Phobos.vcxproj +++ b/Phobos.vcxproj @@ -57,6 +57,8 @@ + + diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 1907a46c23..333217060f 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1096,6 +1096,16 @@ ReturnWeapon.ApplyFirepowerMult=false ; boolean ## Super Weapons +### Allow beacon placement hotkey in single player + +- In vanilla, the beacon placement hotkey is restricted to multiplayer games only. Now you can allow using the beacon placement hotkey in single player and skirmish modes by setting `AllowBeaconInSinglePlayer` to true. + +In `rulesmd.ini`: +```ini +[General] +AllowBeaconInSinglePlayer=false ; boolean +``` + ### AI Superweapon delay timer - By default AI houses only process superweapon logic e.g checks if it can fire any superweapons firing them at randomized intervals of 106 to 112 game frames. This behaviour can now be customized by setting explicit delay, or disabling it entirely. Values of 0 and below disable the delay and cause AI houses to check superweapons on every game frame. diff --git a/docs/Whats-New.md b/docs/Whats-New.md index efbd57b084..0afc847459 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -407,6 +407,7 @@ HideShakeEffects=false ; boolean - [No rearm and reload in EMP or temporal](New-or-Enhanced-Logics.md#no-rearm-and-reload-in-emp-or-temporal) (by CrimRecya) - [Technos recount current burst index when change the firing weapon](New-or-Enhanced-Logics.md#recount-burst-index) (by CrimRecya) - Shield armor inheritance customization (by Ollerus) +- [Allow beacon placement hotkey in single player](New-or-Enhanced-Logics.md#allow-beacon-placement-hotkey-in-single-player) (by TaranDahl) - [Damaged unit image changes](New-or-Enhanced-Logics.md#damaged-unit-image-changes) (by Fryone) - [Customizable spawns queue](New-or-Enhanced-Logics.md#customizable-spawns-queue) (by TwinkleStar) - [Initial spawns number](New-or-Enhanced-Logics.md#initial-spawns-number) (by TwinkleStar) diff --git a/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po b/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po index ab0d5657a9..9de3f90aae 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po +++ b/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po @@ -2445,6 +2445,9 @@ msgid "" "tank bunker" msgstr "防止使用了可能导致问题的运动模式的单位进入坦克碉堡" +msgid "Allow beacon placement hotkey in single player" +msgstr "允许在单人模式下使用信标放置快捷键" + msgid "" "Units are now unable to kick out from a factory that is in construction " "process" diff --git a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po index 9d33ae96ce..046a18b307 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po +++ b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po @@ -2800,6 +2800,17 @@ msgstr "`ReturnWeapon.ApplyFirepowerMult` 决定归返武器的伤害是否受 msgid "Super Weapons" msgstr "超级武器" +msgid "Allow beacon placement hotkey in single player" +msgstr "允许在单人模式下使用信标放置快捷键" + +msgid "" +"In vanilla, the beacon placement hotkey is restricted to multiplayer games " +"only. Now you can allow using the beacon placement hotkey in single player " +"and skirmish modes by setting `AllowBeaconInSinglePlayer` to true." +msgstr "" +"在原版中,信标放置快捷键仅限于多人游戏使用。现在你可以通过将 " +"`AllowBeaconInSinglePlayer` 设置为 true 来允许在单人模式和遭遇战中使用信标放置快捷键。" + msgid "AI Superweapon delay timer" msgstr "AI 超级武器发射延迟" diff --git a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po index 4752cab55a..c4facc9c6b 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po +++ b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po @@ -862,6 +862,13 @@ msgstr "" msgid "Shield armor inheritance customization (by Ollerus)" msgstr "自定义护盾继承单位护甲(by Ollerus)" +msgid "" +"[Allow beacon placement hotkey in single player](New-or-Enhanced-" +"Logics.md#allow-beacon-placement-hotkey-in-single-player) (by TaranDahl)" +msgstr "" +"[允许在单人模式下使用信标放置快捷键](New-or-Enhanced-Logics.md#allow-" +"beacon-placement-hotkey-in-single-player)(by TaranDahl)" + msgid "" "[Damaged unit image changes](New-or-Enhanced-Logics.md#damaged-unit-" "image-changes) (by Fryone)" diff --git a/src/Ext/Beacon/Hooks.cpp b/src/Ext/Beacon/Hooks.cpp new file mode 100644 index 0000000000..fa5290f369 --- /dev/null +++ b/src/Ext/Beacon/Hooks.cpp @@ -0,0 +1,9 @@ +#include + +DEFINE_HOOK(0x5370A0, BeaconPlacementCommandClass_ExecuteSub_Start, 0x5) +{ + if (RulesExt::Global()->AllowBeaconInSinglePlayer) + return 0x5370AE; + + return 0; +} diff --git a/src/Ext/Rules/Body.cpp b/src/Ext/Rules/Body.cpp index 5ddb243507..05e75b4509 100644 --- a/src/Ext/Rules/Body.cpp +++ b/src/Ext/Rules/Body.cpp @@ -179,6 +179,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI) this->EnablePowerSurplus.Read(exINI, GameStrings::AI, "EnablePowerSurplus"); this->PowerSurplus_ScaleToDrainAmount.Read(exINI, GameStrings::AI, "PowerSurplus.ScaleToDrainAmount"); + this->AllowBeaconInSinglePlayer.Read(exINI, GameStrings::General, "AllowBeaconInSinglePlayer"); this->AllowDeployControlledMCV.Read(exINI, GameStrings::General, "AllowDeployControlledMCV"); this->TypeSelectUseIFVMode.Read(exINI, GameStrings::General, "TypeSelectUseIFVMode"); @@ -592,6 +593,7 @@ void RulesExt::ExtData::Serialize(T& Stm) .Process(this->ForbidParallelAIQueues_Vehicle) .Process(this->EnablePowerSurplus) .Process(this->PowerSurplus_ScaleToDrainAmount) + .Process(this->AllowBeaconInSinglePlayer) .Process(this->AllowDeployControlledMCV) .Process(this->TypeSelectUseIFVMode) .Process(this->IronCurtain_KeptOnDeploy) diff --git a/src/Ext/Rules/Body.h b/src/Ext/Rules/Body.h index 97198c0bcb..bf9f971e90 100644 --- a/src/Ext/Rules/Body.h +++ b/src/Ext/Rules/Body.h @@ -125,6 +125,7 @@ class RulesExt Valueable DrainMoneyDisplay_OnTarget; Valueable DrainMoneyDisplay_OnTarget_UseDisplayIncome; + Valueable AllowBeaconInSinglePlayer; Valueable AllowDeployControlledMCV; Valueable TypeSelectUseIFVMode; @@ -459,6 +460,7 @@ class RulesExt , EnablePowerSurplus { false } , PowerSurplus_ScaleToDrainAmount { 0 } + , AllowBeaconInSinglePlayer { false } , AllowDeployControlledMCV { false } , TypeSelectUseIFVMode { false } From c068871fffb04fb6dad6941e9fbcef9760006449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=AA=E5=91=B3=E9=BA=BB=E9=85=B1?= <93972760+TaranDahl@users.noreply.github.com> Date: Tue, 23 Jun 2026 19:42:17 +0800 Subject: [PATCH 2/3] core --- docs/New-or-Enhanced-Logics.md | 4 ++-- docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po | 4 ++-- src/Ext/Beacon/Hooks.cpp | 2 +- src/Ext/Rules/Body.cpp | 4 ++-- src/Ext/Rules/Body.h | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 333217060f..94e2d73db5 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1098,12 +1098,12 @@ ReturnWeapon.ApplyFirepowerMult=false ; boolean ### Allow beacon placement hotkey in single player -- In vanilla, the beacon placement hotkey is restricted to multiplayer games only. Now you can allow using the beacon placement hotkey in single player and skirmish modes by setting `AllowBeaconInSinglePlayer` to true. +- In vanilla, the beacon placement hotkey is restricted to multiplayer games only. Now you can allow using the beacon placement hotkey in single player and skirmish modes by setting `AllowBeaconHotKeyInSinglePlayer` to true. In `rulesmd.ini`: ```ini [General] -AllowBeaconInSinglePlayer=false ; boolean +AllowBeaconHotKeyInSinglePlayer=false ; boolean ``` ### AI Superweapon delay timer diff --git a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po index 046a18b307..ff61df46eb 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po +++ b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po @@ -2806,10 +2806,10 @@ msgstr "允许在单人模式下使用信标放置快捷键" msgid "" "In vanilla, the beacon placement hotkey is restricted to multiplayer games " "only. Now you can allow using the beacon placement hotkey in single player " -"and skirmish modes by setting `AllowBeaconInSinglePlayer` to true." +"and skirmish modes by setting `AllowBeaconHotKeyInSinglePlayer` to true." msgstr "" "在原版中,信标放置快捷键仅限于多人游戏使用。现在你可以通过将 " -"`AllowBeaconInSinglePlayer` 设置为 true 来允许在单人模式和遭遇战中使用信标放置快捷键。" +"`AllowBeaconHotKeyInSinglePlayer` 设置为 true 来允许在单人模式和遭遇战中使用信标放置快捷键。" msgid "AI Superweapon delay timer" msgstr "AI 超级武器发射延迟" diff --git a/src/Ext/Beacon/Hooks.cpp b/src/Ext/Beacon/Hooks.cpp index fa5290f369..33099b2ee5 100644 --- a/src/Ext/Beacon/Hooks.cpp +++ b/src/Ext/Beacon/Hooks.cpp @@ -2,7 +2,7 @@ DEFINE_HOOK(0x5370A0, BeaconPlacementCommandClass_ExecuteSub_Start, 0x5) { - if (RulesExt::Global()->AllowBeaconInSinglePlayer) + if (RulesExt::Global()->AllowBeaconHotKeyInSinglePlayer) return 0x5370AE; return 0; diff --git a/src/Ext/Rules/Body.cpp b/src/Ext/Rules/Body.cpp index 05e75b4509..8b48ff61d6 100644 --- a/src/Ext/Rules/Body.cpp +++ b/src/Ext/Rules/Body.cpp @@ -179,7 +179,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI) this->EnablePowerSurplus.Read(exINI, GameStrings::AI, "EnablePowerSurplus"); this->PowerSurplus_ScaleToDrainAmount.Read(exINI, GameStrings::AI, "PowerSurplus.ScaleToDrainAmount"); - this->AllowBeaconInSinglePlayer.Read(exINI, GameStrings::General, "AllowBeaconInSinglePlayer"); + this->AllowBeaconHotKeyInSinglePlayer.Read(exINI, GameStrings::General, "AllowBeaconHotKeyInSinglePlayer"); this->AllowDeployControlledMCV.Read(exINI, GameStrings::General, "AllowDeployControlledMCV"); this->TypeSelectUseIFVMode.Read(exINI, GameStrings::General, "TypeSelectUseIFVMode"); @@ -593,7 +593,7 @@ void RulesExt::ExtData::Serialize(T& Stm) .Process(this->ForbidParallelAIQueues_Vehicle) .Process(this->EnablePowerSurplus) .Process(this->PowerSurplus_ScaleToDrainAmount) - .Process(this->AllowBeaconInSinglePlayer) + .Process(this->AllowBeaconHotKeyInSinglePlayer) .Process(this->AllowDeployControlledMCV) .Process(this->TypeSelectUseIFVMode) .Process(this->IronCurtain_KeptOnDeploy) diff --git a/src/Ext/Rules/Body.h b/src/Ext/Rules/Body.h index bf9f971e90..a85ad4a798 100644 --- a/src/Ext/Rules/Body.h +++ b/src/Ext/Rules/Body.h @@ -125,7 +125,7 @@ class RulesExt Valueable DrainMoneyDisplay_OnTarget; Valueable DrainMoneyDisplay_OnTarget_UseDisplayIncome; - Valueable AllowBeaconInSinglePlayer; + Valueable AllowBeaconHotKeyInSinglePlayer; Valueable AllowDeployControlledMCV; Valueable TypeSelectUseIFVMode; @@ -460,7 +460,7 @@ class RulesExt , EnablePowerSurplus { false } , PowerSurplus_ScaleToDrainAmount { 0 } - , AllowBeaconInSinglePlayer { false } + , AllowBeaconHotKeyInSinglePlayer { false } , AllowDeployControlledMCV { false } , TypeSelectUseIFVMode { false } From 709f7c1e8c419304e09fa0d7c6f8938ac38ca0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=AA=E5=91=B3=E9=BA=BB=E9=85=B1?= <93972760+TaranDahl@users.noreply.github.com> Date: Tue, 23 Jun 2026 20:27:23 +0800 Subject: [PATCH 3/3] Update Hooks.cpp --- src/Ext/Beacon/Hooks.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Ext/Beacon/Hooks.cpp b/src/Ext/Beacon/Hooks.cpp index 33099b2ee5..f69792e8e9 100644 --- a/src/Ext/Beacon/Hooks.cpp +++ b/src/Ext/Beacon/Hooks.cpp @@ -7,3 +7,5 @@ DEFINE_HOOK(0x5370A0, BeaconPlacementCommandClass_ExecuteSub_Start, 0x5) return 0; } + +DEFINE_JUMP(LJMP, 0x430CD4, 0x430CEA);