Skip to content

Commit b205830

Browse files
authored
Allows refineries to use multiple ActiveAnim simultaneously (#1723)
### Allows refineries to use multiple ActiveAnim simultaneously - In vanilla, the refinery uses different ActiveAnims depending on the storage. You can now make it use multiple ActiveAnims simultaneously like any other building. In `artmd.ini`: ```ini [SOMEBUILDING] ; BuildingType Refinery.UseNormalActiveAnim=false ; boolean ```
1 parent c722b45 commit b205830

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ This page lists all the individual contributions to the project by their author.
546546
- Customize the scatter caused by aircraft attack mission
547547
- Customize whether `Crater=yes` animation would destroy tiberium
548548
- Targeting limitation for berzerk technos
549+
- Allows refineries to use multiple ActiveAnim simultaneously
549550
- **tyuah8**:
550551
- Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
551552
- Destroyed unit leaves sensors bugfix

docs/Fixed-or-Improved-Logics.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,16 @@ In `rulesmd.ini`:
458458
AircraftDockingDir(N)= ; Direction type (integers from 0-255)
459459
```
460460

461+
### Allows refineries to use multiple ActiveAnim simultaneously
462+
463+
- In vanilla, the refinery uses different ActiveAnims depending on the storage. You can now make it use multiple ActiveAnims simultaneously like any other building.
464+
465+
In `artmd.ini`:
466+
```ini
467+
[SOMEBUILDING] ; BuildingType
468+
Refinery.UseNormalActiveAnim=false ; boolean
469+
```
470+
461471
### Allowed / disallowed types for FactoryPlant
462472

463473
- It is now possible to customize which TechnoTypes benefit from bonuses of a `FactoryPlant=true` building by listing them on `FactoryPlant.AllowTypes` and/or `FactoryPlant.DisallowTypes`.

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ New:
404404
- [Customize limit and sound when engineer repair a building](New-or-Enhanced-Logics.md#engineer-repair-customization) (by NetsuNegi)
405405
- [Customizable debris trailer anim spawn delay](Fixed-or-Improved-Logics.md#customizable-debris-trailer-anim-spawn-delay) (by CrimRecya)
406406
- [Display banner](AI-Scripting-and-Mapping.md#display-banner) (by Morton & ststl)
407+
- Allows refineries to use multiple ActiveAnim simultaneously (by TaranDahl)
407408
408409
Vanilla fixes:
409410
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)

src/Ext/Building/Hooks.Refinery.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,17 @@ DEFINE_HOOK(0x522E4F, InfantryClass_SlaveGiveMoney_CheckBalanceAfter, 0x6)
5757

5858
return 0;
5959
}
60+
61+
DEFINE_HOOK(0x445FE4, BuildingClass_Place_RefineryActiveAnim, 0x6)
62+
{
63+
GET(BuildingTypeClass*, pType, ESI);
64+
65+
return BuildingTypeExt::ExtMap.Find(pType)->Refinery_UseNormalActiveAnim ? 0x446183 : 0;
66+
}
67+
68+
DEFINE_HOOK(0x450DAA, BuildingClass_UpdateAnimations_RefineryActiveAnim, 0x6)
69+
{
70+
GET(BuildingTypeClass*, pType, EDX);
71+
72+
return BuildingTypeExt::ExtMap.Find(pType)->Refinery_UseNormalActiveAnim ? 0x450F9E : 0;
73+
}

src/Ext/BuildingType/Body.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ void BuildingTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
224224
}
225225
}
226226

227+
this->Refinery_UseNormalActiveAnim.Read(exArtINI, pArtSection, "Refinery.UseNormalActiveAnim");
228+
227229
// Ares tag
228230
this->SpyEffect_Custom.Read(exINI, pSection, "SpyEffect.Custom");
229231
if (SuperWeaponTypeClass::Array.Count > 0)
@@ -337,6 +339,7 @@ void BuildingTypeExt::ExtData::Serialize(T& Stm)
337339
.Process(this->BunkerWallsUpSound)
338340
.Process(this->BunkerWallsDownSound)
339341
.Process(this->BuildingRepairedSound)
342+
.Process(this->Refinery_UseNormalActiveAnim)
340343
;
341344
}
342345

src/Ext/BuildingType/Body.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ class BuildingTypeExt
9292
Nullable<float> BuildingBunkerROFMult;
9393
NullableIdx<VocClass> BunkerWallsUpSound;
9494
NullableIdx<VocClass> BunkerWallsDownSound;
95+
9596
NullableIdx<VocClass> BuildingRepairedSound;
9697

98+
Valueable<bool> Refinery_UseNormalActiveAnim;
99+
97100
ExtData(BuildingTypeClass* OwnerObject) : Extension<BuildingTypeClass>(OwnerObject)
98101
, PowersUp_Owner { AffectedHouse::Owner }
99102
, PowersUp_Buildings {}
@@ -154,6 +157,7 @@ class BuildingTypeExt
154157
, BunkerWallsUpSound {}
155158
, BunkerWallsDownSound {}
156159
, BuildingRepairedSound {}
160+
, Refinery_UseNormalActiveAnim { false }
157161
{ }
158162

159163
// Ares 0.A functions

0 commit comments

Comments
 (0)