diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 8f36ad37e4..0931cde673 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -2087,6 +2087,14 @@ TypeSelectUseIFVMode=false ; boolean WeaponGroupAsN= ; string, default to N if [General] -> TypeSelectUseIFVMode=true, and 0 if false ``` +- This behavior is designed to be toggleable by users. For now you can only do that externally via client or manually. + +In `RA2MD.INI`: +```ini +[Phobos] +TypeSelectUseIFVMode=true ; boolean +``` + ### Customizing crushing tilt and slowdown - Vehicles with `Crusher=true` and `OmniCrusher=true` / `MovementZone=CrusherAll` were hardcoded to tilt when crushing vehicles / walls respectively. This now obeys `TiltsWhenCrushes` but can be customized individually for these two scenarios using `TiltsWhenCrusher.Vehicles` and `TiltsWhenCrusher.Overlays`, which both default to `TiltsWhenCrushes`. diff --git a/docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po b/docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po index 01fc3379c4..25738e0a42 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po +++ b/docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po @@ -4479,6 +4479,14 @@ msgid "" "weapons, which makes type selection on IFVs work the same as before." msgstr "若设为 false 则 `WeaponGroupAsN` 将默认为 0 以保持原有行为。" +msgid "" +"This behavior is designed to be toggleable by users. For now you can only" +" do that externally via client or manually." +msgstr "此行为设计为可由用户切换。目前你只能通过客户端或进行手动设置。" + +msgid "In `RA2MD.INI`:" +msgstr "在 `RA2MD.INI`:" + msgid "Customizing crushing tilt and slowdown" msgstr "自定义碾压倾斜和减速" diff --git a/src/Misc/Selection.cpp b/src/Misc/Selection.cpp index d2b938e4db..3018260c0c 100644 --- a/src/Misc/Selection.cpp +++ b/src/Misc/Selection.cpp @@ -138,7 +138,7 @@ class ExtSelection char* gunnerID = pTypeExt->WeaponGroupAs[pTechno->CurrentWeaponNumber]; if (!GeneralUtils::IsValidString(gunnerID)) - sprintf_s(gunnerID, 0x20, "%d", RulesExt::Global()->TypeSelectUseIFVMode ? pTechno->CurrentWeaponNumber + 1 : 0); + sprintf_s(gunnerID, 0x20, "%d", RulesExt::Global()->TypeSelectUseIFVMode && Phobos::Config::TypeSelectUseIFVMode ? pTechno->CurrentWeaponNumber + 1 : 0); if (std::ranges::none_of(ExtSelection::IFVGroups, [gunnerID](const char* pID) { return !_stricmp(pID, gunnerID); })) break; @@ -188,7 +188,7 @@ DEFINE_FUNCTION_JUMP(LJMP, 0x6D9FF0, ExtSelection::Tactical_MakeFilteredSelectio DEFINE_HOOK(0x73298D, TypeSelectExecute_UseIFVMode, 0x5) { - const bool useIFVMode = RulesExt::Global()->TypeSelectUseIFVMode; + const bool useIFVMode = RulesExt::Global()->TypeSelectUseIFVMode && Phobos::Config::TypeSelectUseIFVMode; for (const auto pObject : ObjectClass::CurrentObjects) { diff --git a/src/Phobos.INI.cpp b/src/Phobos.INI.cpp index c9bc501bdc..6126cbf829 100644 --- a/src/Phobos.INI.cpp +++ b/src/Phobos.INI.cpp @@ -47,6 +47,7 @@ bool Phobos::Config::ToolTipDescriptions = true; bool Phobos::Config::ToolTipBlur = false; bool Phobos::Config::PrioritySelectionFiltering = true; bool Phobos::Config::PriorityDeployFiltering = true; +bool Phobos::Config::TypeSelectUseIFVMode = true; bool Phobos::Config::DevelopmentCommands = true; bool Phobos::Config::SuperWeaponSidebarCommands = false; bool Phobos::Config::ShowPlanningPath = false; @@ -90,6 +91,7 @@ DEFINE_HOOK(0x5FACDF, OptionsClass_LoadSettings_LoadPhobosSettings, 0x5) Phobos::Config::ToolTipBlur = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ToolTipBlur", false); Phobos::Config::PrioritySelectionFiltering = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "PrioritySelectionFiltering", true); Phobos::Config::PriorityDeployFiltering = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "PriorityDeployFiltering", true); + Phobos::Config::TypeSelectUseIFVMode = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "TypeSelectUseIFVMode", true); Phobos::Config::ShowPlacementPreview = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowPlacementPreview", true); Phobos::Config::MessageApplyHoverState = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "MessageApplyHoverState", false); Phobos::Config::MessageDisplayInCenter = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "MessageDisplayInCenter", false); diff --git a/src/Phobos.h b/src/Phobos.h index 2e794bd388..a080df0018 100644 --- a/src/Phobos.h +++ b/src/Phobos.h @@ -82,6 +82,7 @@ class Phobos static bool ToolTipBlur; static bool PrioritySelectionFiltering; static bool PriorityDeployFiltering; + static bool TypeSelectUseIFVMode; static bool DevelopmentCommands; static bool SuperWeaponSidebarCommands; static bool ArtImageSwap;