Skip to content

Commit 3911eac

Browse files
committed
core
fix
1 parent b81a1dd commit 3911eac

9 files changed

Lines changed: 72 additions & 0 deletions

File tree

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ This page lists all the individual contributions to the project by their author.
810810
- Framework for dynamic sight
811811
- Fix voxel projectile and animation lighting issues
812812
- Export interface for external call
813+
- Allow chat box in singleplayer
813814
- **solar-III (凤九歌)**
814815
- Target scanning delay customization (documentation)
815816
- Skip target scanning function calling for unarmed technos (documentation)

Phobos.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
<ClCompile Include="src\Misc\Hooks.INIInheritance.cpp" />
233233
<ClCompile Include="src\Misc\Hooks.LaserDraw.cpp" />
234234
<ClCompile Include="src\Misc\Hooks.LightEffects.cpp" />
235+
<ClCompile Include="src\Misc\Hooks.MessageList.cpp" />
235236
<ClCompile Include="src\Misc\Hooks.Overlay.cpp" />
236237
<ClCompile Include="src\Misc\Hooks.PCX.cpp" />
237238
<ClCompile Include="src\Misc\Hooks.Timers.cpp" />

docs/User-Interface.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ SuperWeaponTimer.Percentage=false ; boolean
4343
ShowTimer.Percentage= ; boolean
4444
```
4545

46+
### Allow chat box in singleplayer
47+
48+
- In vanilla, the in-game chat box is disabled in singleplayer scenarios. You can now enable it by setting `[General] -> AllowChatBoxInSinglePlayer` to true.
49+
- `AllowChatBoxInSinglePlayer` controls whether the chat box is available in singleplayer mode. Defaults to `false`.
50+
51+
In `rulesmd.ini`:
52+
```ini
53+
[General]
54+
AllowChatBoxInSinglePlayer=false ; boolean
55+
```
56+
4657
### Custom health bars display
4758

4859
![image](_static/images/healthbar.hide-01.png)

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ HideShakeEffects=false ; boolean
594594
- [Customize whether technos with `Locomotor=Fly` wobble](Fixed-or-Improved-Logics.md#customize-whether-technos-with-locomotor-fly-wobble) (by Noble_Fish)
595595
- [Customize the landing animation of technos that have `Locomotor=Fly`](Fixed-or-Improved-Logics.md#customize-the-landing-animation-of-technos-that-have-locomotor-fly) (by Noble_Fish)
596596
- [Allow infantry to perform type conversion when deploying and undeploying](New-or-Enhanced-Logics.md#allow-infantry-to-perform-type-conversion-when-deploying-and-undeploying) (by Noble_Fish)
597+
- [Allow chat box in singleplayer](User-Interface.md#allow-chat-box-in-singleplayer) (by TaranDahl)
597598
598599
#### Vanilla fixes:
599600
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)

docs/locale/zh_CN/LC_MESSAGES/User-Interface.po

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,22 @@ msgstr "允许以百分比形式绘制超武计时器"
110110
msgid "Superweapon cd timer can now draw as percentage."
111111
msgstr "现在超武冷却计时器可以以百分比的形式绘制。"
112112

113+
msgid "Allow chat box in singleplayer"
114+
msgstr "允许在单人模式使用聊天框"
115+
116+
msgid ""
117+
"In vanilla, the in-game chat box is disabled in singleplayer scenarios. "
118+
"You can now enable it by setting `[General] -> "
119+
"AllowChatBoxInSinglePlayer` to true."
120+
msgstr ""
121+
"原版中,游戏内聊天框在单人模式下被禁用。现在可以将 `[General] -> "
122+
"AllowChatBoxInSinglePlayer` 设为 `true` 来启用。"
123+
124+
msgid ""
125+
"`AllowChatBoxInSinglePlayer` controls whether the chat box is available in "
126+
"singleplayer mode. Defaults to `false`."
127+
msgstr "`AllowChatBoxInSinglePlayer` 控制是否在单人模式下启用聊天框,默认 `false`。"
128+
113129
msgid "Custom health bars display"
114130
msgstr "自定义血条显示"
115131

docs/locale/zh_CN/LC_MESSAGES/Whats-New.po

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,11 @@ msgstr ""
20242024
"[自定义 `Locomotor=Fly` 单位的降落动画](Fixed-or-Improved-Logics.md#customize-the-landing-"
20252025
"animation-of-technos-that-have-locomotor-fly)(by Noble_Fish)"
20262026

2027+
msgid ""
2028+
"[Allow chat box in singleplayer](User-Interface.md#allow-chat-box-in-"
2029+
"singleplayer) (by TaranDahl)"
2030+
msgstr "[允许在单人模式使用聊天框](User-Interface.md#allow-chat-box-in-singleplayer)(by TaranDahl)"
2031+
20272032
msgid "Vanilla fixes:"
20282033
msgstr "原版问题修复:"
20292034

src/Ext/Rules/Body.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
180180
this->PowerSurplus_ScaleToDrainAmount.Read(exINI, GameStrings::AI, "PowerSurplus.ScaleToDrainAmount");
181181

182182
this->AllowDeployControlledMCV.Read(exINI, GameStrings::General, "AllowDeployControlledMCV");
183+
this->AllowChatBoxInSinglePlayer.Read(exINI, GameStrings::General, "AllowChatBoxInSinglePlayer");
183184

184185
this->TypeSelectUseIFVMode.Read(exINI, GameStrings::General, "TypeSelectUseIFVMode");
185186

@@ -723,6 +724,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
723724
.Process(this->AnimCraterDestroyTiberium)
724725
.Process(this->BerzerkTargeting)
725726
.Process(this->AllowBerzerkOnAllies)
727+
.Process(this->AllowChatBoxInSinglePlayer)
726728
.Process(this->TintColorIronCurtain)
727729
.Process(this->TintColorForceShield)
728730
.Process(this->TintColorBerserk)

src/Ext/Rules/Body.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ class RulesExt
282282

283283
Valueable<AffectedHouse> BerzerkTargeting;
284284
Valueable<bool> AllowBerzerkOnAllies;
285+
Valueable<bool> AllowChatBoxInSinglePlayer;
285286

286287
Valueable<bool> AttackMove_IgnoreWeaponCheck;
287288
Nullable<bool> AttackMove_StopWhenTargetAcquired;
@@ -598,6 +599,7 @@ class RulesExt
598599

599600
, BerzerkTargeting { AffectedHouse::All }
600601
, AllowBerzerkOnAllies { false }
602+
, AllowChatBoxInSinglePlayer { false }
601603

602604
, TintColorIronCurtain { 0 }
603605
, TintColorForceShield { 0 }

src/Misc/Hooks.MessageList.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <Ext/Rules/Body.h>
2+
3+
DEFINE_HOOK(0x55E477, Game_ComScenarioDialog_ChatBox, 0x5)
4+
{
5+
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
6+
return 0x55E48D;
7+
8+
return 0;
9+
}
10+
11+
DEFINE_HOOK(0x55E62F, Game_ComScenarioDialog_ChatBox2, 0x6)
12+
{
13+
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
14+
return 0x55E637;
15+
16+
return 0;
17+
}
18+
19+
DEFINE_HOOK(0x55E693, Game_ComScenarioDialog_ChatBox3, 0x6)
20+
{
21+
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
22+
return 0x55E69B;
23+
24+
return 0;
25+
}
26+
27+
DEFINE_HOOK(0x55E746, Game_ComScenarioDialog_ChatBox4, 0x5)
28+
{
29+
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
30+
return 0x55E77B;
31+
32+
return 0;
33+
}

0 commit comments

Comments
 (0)