From 7ac33e74d276a36f9ae7393a91cc404de3b90ee1 Mon Sep 17 00:00:00 2001 From: Coronia <2217891145@qq.com> Date: Tue, 21 Oct 2025 22:34:40 +0800 Subject: [PATCH 1/2] hide --- CREDITS.md | 1 + docs/User-Interface.md | 6 +++++- docs/Whats-New.md | 3 +++ src/Ext/Bullet/Hooks.DetonateLogics.cpp | 3 +++ src/New/Entity/LaserTrailClass.cpp | 3 +++ src/Phobos.INI.cpp | 4 ++++ src/Phobos.h | 2 ++ 7 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CREDITS.md b/CREDITS.md index a571707ce4..02dfc8c503 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -575,6 +575,7 @@ This page lists all the individual contributions to the project by their author. - Randomized anims for several behaviors - Fix customized `WarpAway` anim's wrong definition - Shield respawn animation and weapon + - Toggle off laser trail and shake effects - **NaotoYuuki** - Vertical & meteor trajectory projectile prototypes - **handama** - AI script action to `16005 Jump Back To Previous Script` - **TaranDahl (航味麻酱)**: diff --git a/docs/User-Interface.md b/docs/User-Interface.md index 927fdd9a1d..4a501fe333 100644 --- a/docs/User-Interface.md +++ b/docs/User-Interface.md @@ -188,12 +188,14 @@ HealthBar.Permanent=false ; boolean HealthBar.Permanent.PipScale=false ; boolean ``` -### Light flash effect toggling +### Visual effects toggling - It is possible to toggle certain light flash effects off. These light flash effects include: - Combat light effects (`Bright=true`) and everything that uses same functionality e.g Iron Curtain / Force Field impact flashes. - Alpha images attached to ParticleSystems or Particles that are generated through a Warhead's `Particle` if `[AudioVisual] -> WarheadParticleAlphaImageIsLightFlash` or on Warhead `Particle.AlphaImageIsLightFlash` is set to true, latter defaults to former. - Additionally these alpha images are not created if `[AudioVisual] -> LightFlashAlphaImageDetailLevel` is higher than current detail level, regardless of the `HideLightFlashEffects` setting. +- It is possible to toggle shake screen effects (`ShakeX/Ylo/hi`) off. +- Phobos's [Laser Trail effects](New-or-Enhanced-Logics.md#laser-trails) can also be toggled off. In `rulesmd.ini`: ```ini @@ -209,6 +211,8 @@ In `RA2MD.INI`: ```ini [Phobos] HideLightFlashEffects=false ; boolean +HideLaserTrailEffects=false ; boolean +HideShakeEffects=false ; boolean ``` ### Low priority for box selection diff --git a/docs/Whats-New.md b/docs/Whats-New.md index a0e81a4a8d..b40c28886b 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -107,6 +107,8 @@ ToolTipDescriptions=true ; boolean ToolTipBlur=false ; boolean SaveGameOnScenarioStart=true ; boolean HideLightFlashEffects=false ; boolean +HideLaserTrailEffects=false ; boolean +HideShakeEffects=false ; boolean ``` ### For Map Editor (Final Alert 2) @@ -452,6 +454,7 @@ New: - [Unlimbo Detonate warhead](New-or-Enhanced-Logics.md#unlimbo-detonate-warhead) (by FlyStar) - [Attack](New-or-Enhanced-Logics.md#attack-technos-underground) and [damage](New-or-Enhanced-Logics.md#damage-technos-underground) technos underground (by TaranDahl) - Fast access structure (by FlyStar) +- Toggle off laser trail and shake effects (by Ollerus) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya) diff --git a/src/Ext/Bullet/Hooks.DetonateLogics.cpp b/src/Ext/Bullet/Hooks.DetonateLogics.cpp index 7a68a207a2..20da0afffb 100644 --- a/src/Ext/Bullet/Hooks.DetonateLogics.cpp +++ b/src/Ext/Bullet/Hooks.DetonateLogics.cpp @@ -31,6 +31,9 @@ DEFINE_HOOK(0x4690D4, BulletClass_Logics_NewChecks, 0x6) } // Check for ScreenShake + if (Phobos::Config::HideShakeEffects) + return SkipShaking; + auto&& [_, visible] = TacticalClass::Instance->CoordsToClient(*pCoords); if (pExt->ShakeIsLocal && !visible) diff --git a/src/New/Entity/LaserTrailClass.cpp b/src/New/Entity/LaserTrailClass.cpp index a6fecf9343..5fb97396b4 100644 --- a/src/New/Entity/LaserTrailClass.cpp +++ b/src/New/Entity/LaserTrailClass.cpp @@ -7,6 +7,9 @@ // Returns true if drawn, false otherwise. bool LaserTrailClass::Update(CoordStruct location) { + if (Phobos::Config::HideLaserTrailEffects) + return false; + bool result = false; if (!this->LastLocation.isset()) diff --git a/src/Phobos.INI.cpp b/src/Phobos.INI.cpp index 7eba705806..ffded10550 100644 --- a/src/Phobos.INI.cpp +++ b/src/Phobos.INI.cpp @@ -70,6 +70,8 @@ bool Phobos::Config::ShowHarvesterCounter = false; bool Phobos::Config::ShowPowerDelta = true; bool Phobos::Config::ShowWeedsCounter = false; bool Phobos::Config::HideLightFlashEffects = true; +bool Phobos::Config::HideLaserTrailEffects = true; +bool Phobos::Config::HideShakeEffects = true; bool Phobos::Config::ShowFlashOnSelecting = false; bool Phobos::Config::UnitPowerDrain = false; int Phobos::Config::SuperWeaponSidebar_RequiredSignificance = 0; @@ -102,6 +104,8 @@ DEFINE_HOOK(0x5FACDF, OptionsClass_LoadSettings_LoadPhobosSettings, 0x5) Phobos::Config::ShowHarvesterCounter = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowHarvesterCounter", true); Phobos::Config::ShowWeedsCounter = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowWeedsCounter", true); Phobos::Config::HideLightFlashEffects = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "HideLightFlashEffects", false); + Phobos::Config::HideLaserTrailEffects = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "HideLaserTrailEffects", false); + Phobos::Config::HideShakeEffects = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "HideShakeEffects", false); Phobos::Config::ShowFlashOnSelecting = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowFlashOnSelecting", false); Phobos::Config::SuperWeaponSidebar_RequiredSignificance = CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "SuperWeaponSidebar.RequiredSignificance", 0); diff --git a/src/Phobos.h b/src/Phobos.h index 35478fde27..e925be2e77 100644 --- a/src/Phobos.h +++ b/src/Phobos.h @@ -106,6 +106,8 @@ class Phobos static bool ShowWeedsCounter; static bool ShowPlanningPath; static bool HideLightFlashEffects; + static bool HideLaserTrailEffects; + static bool HideShakeEffects; static bool ShowFlashOnSelecting; static bool UnitPowerDrain; static int SuperWeaponSidebar_RequiredSignificance; From 8f4e339b4dd9b0ec0e91f73a0ce4eb095be4f49f Mon Sep 17 00:00:00 2001 From: Coronia <2217891145@qq.com> Date: Wed, 22 Oct 2025 00:49:39 +0800 Subject: [PATCH 2/2] allow laser trails to omit the global disabling --- docs/User-Interface.md | 9 ++++++++- src/New/Entity/LaserTrailClass.cpp | 2 +- src/New/Type/LaserTrailTypeClass.cpp | 2 ++ src/New/Type/LaserTrailTypeClass.h | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/User-Interface.md b/docs/User-Interface.md index 4a501fe333..81c0b35b26 100644 --- a/docs/User-Interface.md +++ b/docs/User-Interface.md @@ -194,8 +194,9 @@ HealthBar.Permanent.PipScale=false ; boolean - Combat light effects (`Bright=true`) and everything that uses same functionality e.g Iron Curtain / Force Field impact flashes. - Alpha images attached to ParticleSystems or Particles that are generated through a Warhead's `Particle` if `[AudioVisual] -> WarheadParticleAlphaImageIsLightFlash` or on Warhead `Particle.AlphaImageIsLightFlash` is set to true, latter defaults to former. - Additionally these alpha images are not created if `[AudioVisual] -> LightFlashAlphaImageDetailLevel` is higher than current detail level, regardless of the `HideLightFlashEffects` setting. -- It is possible to toggle shake screen effects (`ShakeX/Ylo/hi`) off. +- It is possible to toggle shake screen effects (`ShakeX/Ylo/hi`) off by setting `HideShakeEffects=true`. - Phobos's [Laser Trail effects](New-or-Enhanced-Logics.md#laser-trails) can also be toggled off. + - If a LaserTrailType has `CanBeHidden=false`, it can't be toggled off by setting `HideLaserTrailEffects=true`. In `rulesmd.ini`: ```ini @@ -207,6 +208,12 @@ LightFlashAlphaImageDetailLevel=0 ; integer Particle.AlphaImageIsLightFlash= ; boolean ``` +In `artmd.ini`: +```ini +[SOMETRAIL] ; LaserTrailType name +CanBeHidden=true ; boolean +``` + In `RA2MD.INI`: ```ini [Phobos] diff --git a/src/New/Entity/LaserTrailClass.cpp b/src/New/Entity/LaserTrailClass.cpp index 5fb97396b4..9565663d32 100644 --- a/src/New/Entity/LaserTrailClass.cpp +++ b/src/New/Entity/LaserTrailClass.cpp @@ -7,7 +7,7 @@ // Returns true if drawn, false otherwise. bool LaserTrailClass::Update(CoordStruct location) { - if (Phobos::Config::HideLaserTrailEffects) + if (Phobos::Config::HideLaserTrailEffects && this->Type->CanBeHidden) return false; bool result = false; diff --git a/src/New/Type/LaserTrailTypeClass.cpp b/src/New/Type/LaserTrailTypeClass.cpp index 7db42710d6..fbe6e52535 100644 --- a/src/New/Type/LaserTrailTypeClass.cpp +++ b/src/New/Type/LaserTrailTypeClass.cpp @@ -48,6 +48,7 @@ void LaserTrailTypeClass::LoadFromINI(CCINIClass* pINI) this->CloakVisible.Read(exINI, section, "CloakVisible"); this->CloakVisible_DetectedOnly.Read(exINI, section, "CloakVisible.DetectedOnly"); this->DroppodOnly.Read(exINI, section, "DropPodOnly"); + this->CanBeHidden.Read(exINI, section, "CanBeHidden"); } template @@ -71,6 +72,7 @@ void LaserTrailTypeClass::Serialize(T& Stm) .Process(this->CloakVisible) .Process(this->CloakVisible_DetectedOnly) .Process(this->DroppodOnly) + .Process(this->CanBeHidden) ; } diff --git a/src/New/Type/LaserTrailTypeClass.h b/src/New/Type/LaserTrailTypeClass.h index 70925642fe..bb96615536 100644 --- a/src/New/Type/LaserTrailTypeClass.h +++ b/src/New/Type/LaserTrailTypeClass.h @@ -23,6 +23,7 @@ class LaserTrailTypeClass final : public Enumerable Valueable CloakVisible; Valueable CloakVisible_DetectedOnly; Valueable DroppodOnly; + Valueable CanBeHidden; LaserTrailTypeClass(const char* pTitle = NONE_STR) : Enumerable(pTitle) , DrawType { LaserTrailDrawType::Laser } @@ -42,6 +43,7 @@ class LaserTrailTypeClass final : public Enumerable , CloakVisible { false } , CloakVisible_DetectedOnly { false } , DroppodOnly { false } + , CanBeHidden { true } { } void LoadFromINI(CCINIClass* pINI);