Skip to content
Closed
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
4 changes: 3 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -932,5 +932,7 @@ This page lists all the individual contributions to the project by their author.
- **Chang_zhi**:
- Interop export interface for accessing scenario local/global variables
- Add `ClampToScreen` tag for `BannerType` to control whether banner position is clamped to the visible area
- **Nuke**:
- Reload speed adjustment on promotion
- New `InfoType=EmptyReload` for digital display
- **obsidianus** - Automatic conversion based on health
- **Nuke** - Reload speed adjustment on promotion
5 changes: 4 additions & 1 deletion docs/User-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ The game first takes the absolute value of the difference between the actual cre
- 1 - primary factory,
- 2 - secondary factory.
<br><br>
- `InfoType=EmptyReload` displays the empty reload timer while the Techno has no ammo left, and 0 otherwise.
If `EmptyReload` is not positive, the effective duration falls back to `Reload`.
<br><br>
- `Anchor.Horizontal` and `Anchor.Vertical` set the anchor point from which the display is drawn (depending on `Align`) relative to unit's center/selection box. For buildings, `Anchor.Building` is used instead.
- `Offset` and `Offset.ShieldDelta` (the latter applied when a shield is active) can be used to further modify the position.
- By default, values are displayed in `current/maximum` format (i.e. `20/40`).
Expand Down Expand Up @@ -153,7 +156,7 @@ DigitalDisplay.Health.FakeAtDisguise=true ; boolean

[SOMEDIGITALDISPLAYTYPE] ; DigitalDisplayType
; Generic
InfoType=Health ; Displayed value enumeration (Health|Shield|Ammo|Mindcontrol|Spawns|Passengers|Tiberium|Experience|Occupants|GattlingStage|ROF|Reload|SpawnTimer|GattlingTimer|ProduceCash|PassengerKill|AutoDeath|SuperWeapon|IronCurtain|TemporalLife|FactoryProcess)
InfoType=Health ; Displayed value enumeration (Health|Shield|Ammo|Mindcontrol|Spawns|Passengers|Tiberium|Experience|Occupants|GattlingStage|ROF|Reload|SpawnTimer|GattlingTimer|ProduceCash|PassengerKill|AutoDeath|SuperWeapon|IronCurtain|TemporalLife|FactoryProcess|EmptyReload)
InfoIndex= ; integer
Offset=0,0 ; integers - horizontal, vertical
Offset.ShieldDelta= ; integers - horizontal, vertical
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ HideShakeEffects=false ; boolean
:open:

#### New:
- [New `InfoType=EmptyReload` for digital display](User-Interface.md#digital-display) (by Nuke)

#### Vanilla fixes:

Expand Down
12 changes: 12 additions & 0 deletions src/Ext/Techno/Body.Visuals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,18 @@ void TechnoExt::GetValuesForDisplay(TechnoClass* pThis, TechnoTypeClass* pType,
maxValue = timer.TimeLeft ? timer.TimeLeft : ((pThis->Ammo || pType->EmptyReload <= 0) ? pType->Reload : pType->EmptyReload);
break;
}
case DisplayInfoType::EmptyReload:
{
if (pType->Ammo <= 0)
return;

const auto& timer = pThis->ReloadTimer;
value = (pThis->Ammo == 0) ? timer.GetTimeLeft() : 0;
maxValue = timer.TimeLeft
? timer.TimeLeft
: (pType->EmptyReload > 0 ? pType->EmptyReload : pType->Reload);
break;
}
case DisplayInfoType::SpawnTimer:
{
const auto pSpawnManager = pThis->SpawnManager;
Expand Down
3 changes: 2 additions & 1 deletion src/Utilities/Enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ enum class DisplayInfoType : BYTE
SuperWeapon = 17,
IronCurtain = 18,
TemporalLife = 19,
FactoryProcess = 20
FactoryProcess = 20,
EmptyReload = 21
};

enum class DisplayShowType : unsigned char
Expand Down
4 changes: 4 additions & 0 deletions src/Utilities/TemplateDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,10 @@ if(_strcmpi(parser.value(), #name) == 0){ value = __uuidof(name ## LocomotionCla
{
value = DisplayInfoType::Reload;
}
else if (_strcmpi(str, "emptyreload") == 0)
{
value = DisplayInfoType::EmptyReload;
}
else if (_strcmpi(str, "spawntimer") == 0)
{
value = DisplayInfoType::SpawnTimer;
Expand Down
Loading