Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starkku's pip additions: Empty frame for Tiberiums #1138

Merged
merged 9 commits into from
Feb 26, 2024
Merged
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"recommendations": [
"ms-vscode.cpptools",
"executablebookproject.myst-highlight",
"visualstudioexptteam.vscodeintellicode",
"fernandoescolar.vscode-solution-explorer",
"editorconfig.editorconfig",
"michelemelluso.gitignore",
Expand Down
4 changes: 2 additions & 2 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ Powered.KillSpawns=false ; boolean
- `SpawnsPipSize` determines the pixel increment to the next pip drawn. Defaults to `[AudioVisual]` -> `Pips.Generic.(Buildings.)Size` if not set.
- `SpawnsPipoffset` can be used to shift the starting position of spawnee pips.
- Pips for `Storage` can now also be customized via new keys in `[AudioVisual]`.
- `Pips.Tiberiums.Frames` can be used to list frames (zero-based) of `pips.shp` (for buildings) or `pips2.shp` (for others) used for tiberium types, in the listed order corresponding to tiberium type index. Defaults to 5 for tiberium type index 1, otherwise 2.
- `Pips.Tiberiums.Frames` can be used to list frames (zero-based) of `pips.shp` (for buildings) or `pips2.shp` (for others) used for tiberium types, with empty frame first and in the listed order corresponding to tiberium type index after. Defaults to 0 for empty, 5 for tiberium type index 1, otherwise 2.
- `Pips.Tiberiums.DisplayOrder` controls in which order the tiberium type pips are displayed, takes a list of tiberium type indices. Any tiberium type not listed will be displayed in sequential order after the listed ones.

In `rulesmd.ini`:
Expand All @@ -575,7 +575,7 @@ Pips.Generic.Size=4,0 ; X,Y, increment in pixels to next pip
Pips.Generic.Buildings.Size=4,2 ; X,Y, increment in pixels to next pip
Pips.Ammo.Size=4,0 ; X,Y, increment in pixels to next pip
Pips.Ammo.Buildings.Size=4,2 ; X,Y, increment in pixels to next pip
Pips.Tiberiums.Frames=2,5,2,2 ; list of integers, frames of pips.shp (buildings) or pips2.shp (others) (zero-based)
Pips.Tiberiums.Frames=0,2,5,2,2 ; list of integers, frames of pips.shp (buildings) or pips2.shp (others) (zero-based)
Pips.Tiberiums.DisplayOrder=0,2,3,1 ; list of integers, tiberium type indices

[SOMETECHNO] ; TechnoType
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/Rules/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
this->Pips_Generic_Buildings_Size.Read(exINI, GameStrings::AudioVisual, "Pips.Generic.Buildings.Size");
this->Pips_Ammo_Size.Read(exINI, GameStrings::AudioVisual, "Pips.Ammo.Size");
this->Pips_Ammo_Buildings_Size.Read(exINI, GameStrings::AudioVisual, "Pips.Ammo.Buildings.Size");
this->Pips_Tiberiums_EmptyFrame.Read(exINI, GameStrings::AudioVisual, "Pips.Tiberiums.EmptyFrame");
this->Pips_Tiberiums_Frames.Read(exINI, GameStrings::AudioVisual, "Pips.Tiberiums.Frames");
this->Pips_Tiberiums_DisplayOrder.Read(exINI, GameStrings::AudioVisual, "Pips.Tiberiums.DisplayOrder");
this->ToolTip_Background_Color.Read(exINI, GameStrings::AudioVisual, "ToolTip.Background.Color");
Expand Down Expand Up @@ -237,6 +238,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
.Process(this->Pips_Generic_Buildings_Size)
.Process(this->Pips_Ammo_Size)
.Process(this->Pips_Ammo_Buildings_Size)
.Process(this->Pips_Tiberiums_EmptyFrame)
.Process(this->Pips_Tiberiums_Frames)
.Process(this->Pips_Tiberiums_DisplayOrder)
.Process(this->AllowParallelAIQueues)
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/Rules/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class RulesExt
Valueable<Point2D> Pips_Generic_Buildings_Size;
Valueable<Point2D> Pips_Ammo_Size;
Valueable<Point2D> Pips_Ammo_Buildings_Size;
Valueable<int> Pips_Tiberiums_EmptyFrame;
ValueableVector<int> Pips_Tiberiums_Frames;
ValueableVector<int> Pips_Tiberiums_DisplayOrder;

Expand Down Expand Up @@ -135,6 +136,7 @@ class RulesExt
, Pips_Generic_Buildings_Size { { 4, 2 } }
, Pips_Ammo_Size { { 4, 0 } }
, Pips_Ammo_Buildings_Size { { 4, 2 } }
, Pips_Tiberiums_EmptyFrame { 0 }
, Pips_Tiberiums_Frames {}
, Pips_Tiberiums_DisplayOrder {}
, AllowParallelAIQueues { true }
Expand Down
2 changes: 1 addition & 1 deletion src/Ext/Techno/Hooks.Pips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ DEFINE_HOOK(0x70A1F6, TechnoClass_DrawPips_Tiberium, 0x6)

for (int i = 0; i < maxPips; i++)
{
int frame = 0;
int frame = RulesExt::Global()->Pips_Tiberiums_EmptyFrame;

for (size_t orderIndex = 0; orderIndex < tibPipCounts.size(); orderIndex++)
{
Expand Down
Loading