Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Credits
- **ChrisLv_CN** - interceptor logic, LaserTrails, laser fixes, general assistance (work relicensed under [following permission](images/ChrisLv-relicense.png))
- **Xkein** - general assistance, YRpp edits
- **thomassneddon** - general assistance
- **Starkku** - Warhead shield penetration & breaking, strafing aircraft weapon customization, vehicle DeployFire fixes/improvements, stationary VehicleTypes, Burst logic improvements, TechnoType auto-firing weapons, Secondary weapon fallback customization, weapon target type filtering, AreaFire targeting customization, CreateUnit improvements, Attached animation & jumpjet unit layer customization, IsSimpleDeployer improvements, Shield modification warheads, Warhead decloaking toggle, Warp(In/Out)Weapon, Grinder improvements / additions
- **Starkku** - Warhead shield penetration & breaking, strafing aircraft weapon customization, vehicle DeployFire fixes/improvements, stationary VehicleTypes, Burst logic improvements, TechnoType auto-firing weapons, Secondary weapon fallback customization, weapon target type filtering, AreaFire targeting customization, CreateUnit improvements, Attached animation & jumpjet unit layer customization, IsSimpleDeployer improvements, Shield modification warheads, Warhead decloaking toggle, Warp(In/Out)Weapon, Grinder improvements / additions, Attached animation position customization
- **SukaHati (Erzoid)** - Minimum interceptor guard range
- **Morton (MortonPL)** - XDrawOffset, Shield passthrough & absorption, building LimboDelivery, fix for Image in art rules, power delta counter
- **mevitar** - honorary shield tester *triple* award
Expand Down
14 changes: 12 additions & 2 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@ HideIfNoOre.Threshold=0 ; integer, minimal ore growth stage

In `artmd.ini`:
```ini
[SOMEANIM] ; AnimationType
Layer.UseObjectLayer= ; boolean
[SOMEANIM] ; AnimationType
Layer.UseObjectLayer= ; boolean
```

### Attached animation position customization

- You can now customize whether or not animations attached to objects are centered at the object's actual center rather than the bottom of their top-leftmost cell (cell #0).

In `artmd.ini`:
```ini
[SOMEANIM] ; AnimationType
UseCenterCoordsIfAttached=false ; boolean
```

## Buildings
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ New:
- Weapons fired on warping in / out (by Starkku)
- `Storage.TiberiumIndex` for customizing resource storage in structures (by FS-21)
- Grinder improvements & customizations (by Starkku)
- Attached animation position customization (by Starkku)

Vanilla fixes:
- Fixed laser drawing code to allow for thicker lasers in house color draw mode (by Kerbiter, ChrisLv_CN)
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/AnimType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void AnimTypeExt::ExtData::LoadFromINIFile(CCINIClass* pINI)
this->XDrawOffset.Read(exINI, pID, "XDrawOffset");
this->HideIfNoOre_Threshold.Read(exINI, pID, "HideIfNoOre.Threshold");
this->Layer_UseObjectLayer.Read(exINI, pID, "Layer.UseObjectLayer");
this->UseCenterCoordsIfAttached.Read(exINI, pID, "UseCenterCoordsIfAttached");
}

const void AnimTypeExt::ProcessDestroyAnims(UnitClass* pThis, TechnoClass* pKiller)
Expand Down Expand Up @@ -108,6 +109,7 @@ void AnimTypeExt::ExtData::Serialize(T& Stm)
.Process(this->XDrawOffset)
.Process(this->HideIfNoOre_Threshold)
.Process(this->Layer_UseObjectLayer)
.Process(this->UseCenterCoordsIfAttached)
;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Ext/AnimType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AnimTypeExt
Valueable<int> XDrawOffset;
Valueable<int> HideIfNoOre_Threshold;
Nullable<bool> Layer_UseObjectLayer;
Valueable<bool> UseCenterCoordsIfAttached;

ExtData(AnimTypeClass* OwnerObject) : Extension<AnimTypeClass>(OwnerObject)
, Palette { CustomPalette::PaletteMode::Temperate }
Expand All @@ -41,6 +42,7 @@ class AnimTypeExt
, XDrawOffset { 0 }
, HideIfNoOre_Threshold { 0 }
, Layer_UseObjectLayer {}
, UseCenterCoordsIfAttached { false }
{ }

virtual ~ExtData() = default;
Expand Down
18 changes: 18 additions & 0 deletions src/Ext/AnimType/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,23 @@ DEFINE_HOOK(0x424CB0, AnimClass_In_Which_Layer_AttachedObjectLayer, 0x6)
return ReturnValue;
}

return 0;
}

DEFINE_HOOK(0x424C49, AnimClass_AttachTo_BuildingCoords, 0x5)
{
GET(AnimClass*, pThis, ESI);
GET(ObjectClass*, pObject, EDI);
GET(CoordStruct*, pCoords, EAX);

auto pExt = AnimTypeExt::ExtMap.Find(pThis->Type);

if (pExt->UseCenterCoordsIfAttached)
{
pCoords = pObject->GetCenterCoord(pCoords);
pCoords->X += 128;
pCoords->Y += 128;
}

return 0;
}