From 46250f0117113c87a40c0a425c9c3c0f957d0f8b Mon Sep 17 00:00:00 2001 From: FS-21 Date: Mon, 7 Sep 2026 11:29:20 +0200 Subject: [PATCH] initial commit Palette fix for veins. Now works like in TS if I'm not wrong. --- CREDITS.md | 1 + docs/Fixed-or-Improved-Logics.md | 1 + docs/Whats-New.md | 1 + docs/locale/zh_CN/LC_MESSAGES/CREDITS.po | 3 +++ .../zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po | 5 +++++ docs/locale/zh_CN/LC_MESSAGES/Whats-New.po | 5 +++++ src/Misc/Hooks.VeinholeMonster.cpp | 15 +++++++++++++++ 7 files changed, 31 insertions(+) diff --git a/CREDITS.md b/CREDITS.md index 0e52901bd1..13b74e811e 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -161,6 +161,7 @@ This page lists all the individual contributions to the project by their author. - Unit & infantry auto-conversion on ammo change - Restore the ScriptType action#24 `Play speech` from Tiberian Sun - Modify ammo on impact + - Tiberium veins overlay palette fix - **Starkku**: - Misc. minor bugfixes & improvements - AI script actions: diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 5b37a43262..d0524637d5 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -331,6 +331,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Fixed the issue where vehicles always finish turret resetting first before turn to a new attack target, now it should turn to new target immediately. - Fixed the bug that computer player record cannot be log normally in non English mode. - Fixed the bug that setting `WalkRate=0` on a TechnoType crashed the game (integer divide-by-zero) the moment an object of that type started moving; `WalkRate=0` is now treated like `IdleRate=0`: the walk animation/footstep tick never fires, so a moving unit behaves as if standing still. +- Fixed the bug where Tiberium veins overlay used the wrong palette instead of matching the Veinhole Monster. ## Fixes / interactions with other extensions diff --git a/docs/Whats-New.md b/docs/Whats-New.md index f7e461381a..432f5c4fb2 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -454,6 +454,7 @@ HideShakeEffects=false ; boolean - Fixed the bug where `Ranged=true` causes projectiles using the new Trajectory to ignore settings such as `BounceTimes` (by Noble_Fish) - Fixed `DiscardOn=entry` AttachEffects not triggering `ExpireWeapon` with on-discard trigger on entry (by Starkku) - Fixed several shield respawn/self heal issues (by Ollerus) +- Fixed the bug where Tiberium veins overlay used the wrong palette instead of matching the Veinhole Monster (by FS-21) #### Fixes / interactions with other extensions: - Allowed `SW.ShowCameo` and `SW.ManualFire` to work independently of `SW.AutoFire` (by Noble_Fish) diff --git a/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po b/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po index e5eb5bc694..5f2c2f3dea 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po +++ b/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po @@ -477,6 +477,9 @@ msgstr "复原了《泰伯利亚之日》中的动作脚本 `24 - 播放语音`" msgid "Modify ammo on impact" msgstr "修改弹药弹头" +msgid "Tiberium veins overlay palette fix" +msgstr "泰伯利亚静脉蔓延地表色板修复" + msgid "**Starkku**:" msgstr "**Starkku**:" 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 325682eaf3..535fa0b804 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 @@ -1724,6 +1724,11 @@ msgstr "" "修复了单位设置 `WalkRate=0` 时一开始移动游戏就会崩溃的 Bug(整数除零);现在 `WalkRate=0` 与 " "`IdleRate=0` 同样处理——移动动画/移动音效永不触发,移动中的单位表现为静止(滑行)。" +msgid "" +"Fixed the bug where Tiberium veins overlay used the wrong palette instead of " +"matching the Veinhole Monster." +msgstr "修复了泰伯利亚静脉蔓延地表使用了错误的色板而未能与静脉孔怪物匹配的 Bug。" + msgid "Fixes / interactions with other extensions" msgstr "修复或与其他扩展的交互" diff --git a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po index 3dbbe0b5d1..17f4c265fa 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po +++ b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po @@ -996,6 +996,11 @@ msgstr "" msgid "Fixed several shield respawn/self heal issues (by Ollerus)" msgstr "修复了护盾重生/自愈的一系列问题(by Ollerus)" +msgid "" +"Fixed the bug where Tiberium veins overlay used the wrong palette instead of " +"matching the Veinhole Monster (by FS-21)" +msgstr "修复了泰伯利亚静脉蔓延地表使用了错误的色板而未能与静脉孔怪物匹配的 Bug(by FS-21)" + msgid "Fixes / interactions with other extensions:" msgstr "其他扩展引擎相关的修复/交互:" diff --git a/src/Misc/Hooks.VeinholeMonster.cpp b/src/Misc/Hooks.VeinholeMonster.cpp index 0ab9b72755..36075278e0 100644 --- a/src/Misc/Hooks.VeinholeMonster.cpp +++ b/src/Misc/Hooks.VeinholeMonster.cpp @@ -1,11 +1,26 @@ #include +#include +#include #include /// /// Veinhole Monster /// +// Sets the drawer for veins overlay to match OpenTS and the Veinhole Monster +DEFINE_HOOK_AGAIN(0x47FA5C, CellClass_Draw_Overlay_VeinsPalette, 0x6) +DEFINE_HOOK(0x47FA1F, CellClass_Draw_Overlay_VeinsPalette, 0x6) +{ + if (auto const pPlayer = HouseClass::CurrentPlayer) + { + if (auto const pScheme = ColorScheme::Array.GetItemOrDefault(pPlayer->ColorSchemeIndex)) + R->EDX(pScheme->LightConvert); + } + + return R->Origin() + 0x6; +} + // Loads the veinhole monster art // Call removed from YR by WW DEFINE_HOOK(0x4AD097, DisplayClass_ReadIni_LoadVeinholeArt, 0x6)