Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ This page lists all the individual contributions to the project by their author.
- Framework for dynamic sight
- Fix voxel projectile and animation lighting issues
- Export interface for external call
- Allow chat box in singleplayer
- **solar-III (凤九歌)**
- Target scanning delay customization (documentation)
- Skip target scanning function calling for unarmed technos (documentation)
Expand Down
1 change: 1 addition & 0 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
<ClCompile Include="src\Misc\Hooks.INIInheritance.cpp" />
<ClCompile Include="src\Misc\Hooks.LaserDraw.cpp" />
<ClCompile Include="src\Misc\Hooks.LightEffects.cpp" />
<ClCompile Include="src\Misc\Hooks.MessageList.cpp" />
<ClCompile Include="src\Misc\Hooks.Overlay.cpp" />
<ClCompile Include="src\Misc\Hooks.PCX.cpp" />
<ClCompile Include="src\Misc\Hooks.Timers.cpp" />
Expand Down
10 changes: 10 additions & 0 deletions docs/User-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ IngameScore.LoseTheme= ; Soundtrack theme ID

## Battle screen UI/UX

### Allow chat box in singleplayer

- In vanilla, the in-game chat box is disabled in singleplayer scenarios. You can now enable it by setting `[General] -> AllowChatBoxInSinglePlayer` to true.

In `rulesmd.ini`:
```ini
[General]
AllowChatBoxInSinglePlayer=false ; boolean
```

### Allow draw SuperWeapon timer as percentage

- Superweapon cd timer can now draw as percentage.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ HideShakeEffects=false ; boolean
- [Customizable Berzerk mission](Fixed-or-Improved-Logics.md#enhanced-berzerk-behavior) (by TaranDahl)
- [Tank Bunker foundation and state update delay improvements](Fixed-or-Improved-Logics.md#tank-bunker-improvements) (by Starkku)
- [Custom cruise missiles](New-or-Enhanced-Logics.md#custom-cruise-missiles) (by Noble_Fish)
- [Allow chat box in singleplayer](User-Interface.md#allow-chat-box-in-singleplayer) (by TaranDahl)

#### Vanilla fixes:
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
Expand Down
3 changes: 3 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/CREDITS.po
Original file line number Diff line number Diff line change
Expand Up @@ -2758,6 +2758,9 @@ msgstr "修复了 Voxel 抛射体和动画的光照问题"
msgid "Export interface for external call"
msgstr "用于外部调用的导出接口"

msgid "Allow chat box in singleplayer"
msgstr "允许在单人模式使用聊天框"

msgid "**solar-III (凤九歌)**"
msgstr "**solar-III(凤九歌)**"

Expand Down
11 changes: 11 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/User-Interface.po
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ msgstr "在 `rulesmd.ini`:"
msgid "Battle screen UI/UX"
msgstr "战斗界面 UI/UX"

msgid "Allow chat box in singleplayer"
msgstr "允许在单人模式使用聊天框"

msgid ""
"In vanilla, the in-game chat box is disabled in singleplayer scenarios. "
"You can now enable it by setting `[General] -> "
"AllowChatBoxInSinglePlayer` to true."
msgstr ""
"原版中,游戏内聊天框在单人模式下被禁用。现在可以将 `[General] -> "
"AllowChatBoxInSinglePlayer` 设为 `true` 来启用。"

msgid "Allow draw SuperWeapon timer as percentage"
msgstr "允许以百分比形式绘制超武计时器"

Expand Down
5 changes: 5 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Whats-New.po
Original file line number Diff line number Diff line change
Expand Up @@ -2052,6 +2052,11 @@ msgid ""
msgstr ""
"[坦克碉堡面积和状态更新间隔改进](Fixed-or-Improved-Logics.md#tank-bunker-improvements) (by Starkku)"

msgid ""
"[Allow chat box in singleplayer](User-Interface.md#allow-chat-box-in-"
"singleplayer) (by TaranDahl)"
msgstr "[允许在单人模式使用聊天框](User-Interface.md#allow-chat-box-in-singleplayer)(by TaranDahl)"

msgid "Vanilla fixes:"
msgstr "原版问题修复:"

Expand Down
3 changes: 3 additions & 0 deletions src/Ext/Rules/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)

this->BunkerStateUpdateDelay.Read(exINI, GameStrings::General, "BunkerStateUpdateDelay");

this->AllowChatBoxInSinglePlayer.Read(exINI, GameStrings::General, "AllowChatBoxInSinglePlayer");

// Section AITargetTypes
int itemsCount = pINI->GetKeyCount("AITargetTypes");
for (int i = 0; i < itemsCount; ++i)
Expand Down Expand Up @@ -790,6 +792,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
.Process(this->TeamDelays_Count)
.Process(this->BerzerkMission)
.Process(this->BunkerStateUpdateDelay)
.Process(this->AllowChatBoxInSinglePlayer)
;
}

Expand Down
4 changes: 4 additions & 0 deletions src/Ext/Rules/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ class RulesExt

Valueable<int> BunkerStateUpdateDelay;

Valueable<bool> AllowChatBoxInSinglePlayer;

ExtData(RulesClass* OwnerObject) : Extension<RulesClass>(OwnerObject)
, Storage_TiberiumIndex { -1 }
, HarvesterDumpAmount { 0.0f }
Expand Down Expand Up @@ -690,6 +692,8 @@ class RulesExt
, BerzerkMission { Mission::Hunt }

, BunkerStateUpdateDelay { 15 }

, AllowChatBoxInSinglePlayer { false }
{ }

virtual ~ExtData() = default;
Expand Down
33 changes: 33 additions & 0 deletions src/Misc/Hooks.MessageList.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <Ext/Rules/Body.h>

DEFINE_HOOK(0x55E477, Game_ComScenarioDialog_ChatBox, 0x5)
{
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
return 0x55E48D;

return 0;
}

DEFINE_HOOK(0x55E62F, Game_ComScenarioDialog_ChatBox2, 0x6)
{
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
return 0x55E637;

return 0;
}

DEFINE_HOOK(0x55E693, Game_ComScenarioDialog_ChatBox3, 0x6)
{
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
return 0x55E69B;

return 0;
}

DEFINE_HOOK(0x55E746, Game_ComScenarioDialog_ChatBox4, 0x5)
{
if (RulesExt::Global()->AllowChatBoxInSinglePlayer)
return 0x55E77B;

return 0;
}
Loading