Skip to content

Commit a61143d

Browse files
CrimRecyaNetsuNegiCoroniaFryoneTaranDahl
authored
New Infotypes and new display method (#1287)
New InfoType: ROF timer, Reload timer, Spawn timer, Gattling timer, Produce cash timer, Passenger kill timer, Auto death timer, SW timer, IronCurtain timer, Temporal remainder, Factory process. - `InfoIndex` defines the specific `InfoType`. - In `InfoType=Spawns`, 0 - alive spawns, 1 - docked spawns, 2 - launching spawns. - In `InfoType=Tiberium`, 0 - all, 1 - the first tiberium, 2 - the second tiberium, ... - In `InfoType=SpawnTimer`, 0 - the fastest spawnee, 1 - the first spawnee, 2 - the second spawnee, ... - In `InfoType=SuperWeapon`, 0 - the first SW of all, 1 - SW, 2 - SW2, 3 - the first SWs' SW, ... - In `InfoType=FactoryProcess`, 0 - the first factory in production, 1 - primary factory, 2 - secondary factory. - If `Shape.PercentageFrame` set to true, it will only draw one frame that corresponds to total frames by percentage. - `VisibleInSpecialState` controls whether this display type will show when the owner is in ironcurtain or is attacked by a temporal weapon. - `ValueAsTimer` controls whether the value will be displayed in the form of a timer (i.e. 5:00, 25:00 or 1:00:00). In `rulesmd.ini`: ```ini 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) InfoIndex= ; integer Shape.PercentageFrame=false ; boolean VisibleInSpecialState=true ; boolean ValueAsTimer=false ; boolean ``` --------- Co-authored-by: Netsu_Negi <[email protected]> Co-authored-by: Coronia <[email protected]> Co-authored-by: Fryone <[email protected]> Co-authored-by: 航味麻酱 <[email protected]> Co-authored-by: Starkku <[email protected]> Co-authored-by: Starkku <[email protected]>
1 parent 71e2a9d commit a61143d

File tree

11 files changed

+475
-75
lines changed

11 files changed

+475
-75
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ This page lists all the individual contributions to the project by their author.
486486
- Fix an issue that spawned `Strafe` aircraft on aircraft carriers may not be able to return normally if aircraft carriers moved a short distance when the aircraft is landing
487487
- Exclusive SuperWeapon Sidebar
488488
- Fix an issue that the widespread damage caused by detonation on the bridge/ground cannot affect objects on the ground/bridge who are in the opposite case
489+
- Several new Infotypes, no display in specific status and a new single frame display method
489490
- **Ollerus**:
490491
- Build limit group enhancement
491492
- Customizable rocker amplitude

docs/User-Interface.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,27 @@ IngameScore.LoseTheme= ; Soundtrack theme ID
3535
*Default configuration of digital display using example shapes from [Phobos supplementaries](https://github.com/Phobos-developers/PhobosSupplementaries).*
3636

3737
- You can now configure various types of numerical counters to be displayed over Techno to represent its attributes, such as health points or shield points and can be turned on or off via a [new hotkey](#toggle-digital-display).
38+
- `InfoIndex` defines the specific `InfoType`.
39+
- In `InfoType=Spawns`, 0 - alive spawns, 1 - docked spawns, 2 - launching spawns.
40+
- In `InfoType=Tiberium`, 0 - all, 1 - the first tiberium, 2 - the second tiberium, ...
41+
- In `InfoType=SpawnTimer`, 0 - the fastest spawnee, 1 - the first spawnee, 2 - the second spawnee, ...
42+
- In `InfoType=SuperWeapon`, 0 - the first SW of all, 1 - SW, 2 - SW2, 3 - the first SWs' SW, ...
43+
- In `InfoType=FactoryProcess`, 0 - the first factory in production, 1 - primary factory, 2 - secondary factory.
3844
- `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.
3945
- `Offset` and `Offset.ShieldDelta` (the latter applied when a shield is active) can be used to further modify the position.
4046
- By default, values are displayed in `current/maximum` format (i.e. `20/40`).
4147
- `HideMaxValue=yes` will make the counter show only the current value (i.e. `20`), default to whether the techno is infantry or not.
4248
- `Percentage=yes` changes the format to `percent%` (i.e. `50%`).
49+
- `ValueAsTimer` controls whether the value will be displayed in the form of a timer (i.e. `0:30`, `5:00` or `1:00:00`).
4350
- `VisibleToHouses` and `VisibleToHouses.Observer` can limit visibility to specific players.
51+
- `VisibleInSpecialState` controls whether this display type will show when the owner is in ironcurtain or is attacked by a temporal weapon.
4452
- The digits can be either a custom shape (.shp) or text drawn using the game font. This depends on whether `Shape` is set.
4553
- `Text.Color`, `Text.Color.ConditionYellow` and `Text.Color.ConditionRed` allow customization of the font color. `Text.Background=yes` will additionally draw a black rectangle background.
46-
- When using shapes, a custom palette can be specified with `Palette`. `Shape.Spacing` controls pixel buffer between characters.
47-
- Frames 0-9 will be used as digits when the owner's health bar is green, 10-19 when yellow, 20-29 when red. For `/` and `%` characters, frame numbers are 30-31, 32-33, 34-35, respectively.
54+
- When using shapes, a custom palette can be specified with `Palette`. `Shape.Spacing` controls pixel buffer between characters. If `Shape.PercentageFrame` set to true, it will only draw one frame that corresponds to total frames by percentage.
55+
- Frames 0-9 will be used as digits when the owner's health bar is green, 10-19 when yellow, 20-29 when red. For `/` and `%` (or `:` if set `ValueAsTimer` to true) characters, frame numbers are 30-31, 32-33, 34-35, respectively.
4856
- Default `Offset.ShieldDelta` for `InfoType=Shield` is `0,-10`, `0,0` for others.
4957
- Default `Shape.Spacing` for buildings is `4,-2`, `4,0` for others.
50-
- `ValueScaleDivisor` can be used to adjust scale of displayed values. Both the current & maximum value will be divided by the integer number given, if higher than 1.
58+
- `ValueScaleDivisor` can be used to adjust scale of displayed values. Both the current & maximum value will be divided by the integer number given, if higher than 1. Default to 1 (or 15 when set `ValueAsTimer` to true).
5159

5260
In `rulesmd.ini`:
5361
```ini
@@ -62,7 +70,8 @@ Aircraft.DefaultDigitalDisplayTypes= ; List of DigitalDisplayTypes
6270

6371
[SOMEDIGITALDISPLAYTYPE] ; DigitalDisplayType
6472
; Generic
65-
InfoType=Health ; Displayed value enumeration (health|shield|ammo|mindcontrol|spawns|passengers|tiberium|experience|occupants|gattlingstage)
73+
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)
74+
InfoIndex= ; integer
6675
Offset=0,0 ; integers - horizontal, vertical
6776
Offset.ShieldDelta= ; integers - horizontal, vertical
6877
Align=right ; Text alignment enumeration (left|right|center/centre)
@@ -73,7 +82,9 @@ Percentage=false ; boolean
7382
HideMaxValue=false ; boolean
7483
VisibleToHouses=owner ; Affected house enumeration (none|owner/self|allies/ally|team|enemies/enemy|all)
7584
VisibleToHouses.Observer=true ; boolean
76-
ValueScaleDivisor=1 ; integer
85+
VisibleInSpecialState=true ; boolean
86+
ValueScaleDivisor= ; integer
87+
ValueAsTimer=false ; boolean
7788
; Text
7889
Text.Color=0,255,0 ; integers - Red, Green, Blue
7990
Text.Color.ConditionYellow=255,255,0 ; integers - Red, Green, Blue
@@ -83,6 +94,7 @@ Text.Background=false ; boolean
8394
Shape= ; filename with .shp extension, if not present, game-drawn text will be used instead
8495
Palette=palette.pal ; filename with .pal extension
8596
Shape.Spacing= ; integers - horizontal, vertical spacing between digits
97+
Shape.PercentageFrame=false ; boolean
8698

8799
[SOMETECHNO] ; TechnoType
88100
DigitalDisplay.Disable=false ; boolean

docs/Whats-New.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ New:
390390
- Weapon target filtering by health percentage (by NetsuNegi)
391391
- [Turretless vehicles with `Voxel=no` support use `FireUp` like infantry](New-or-Enhanced-Logics.md#turretless-shape-vehicle-fireup) (by FlyStar)
392392
- Infantry support `IsGattling=yes` (by FlyStar)
393+
- [Several new Infotypes, no display in specific status and a new single frame display method](User-Interface.md#digital-display) (by CrimRecya)
393394
394395
Vanilla fixes:
395396
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
@@ -425,7 +426,6 @@ Fixes / interactions with other extensions:
425426
- Fixed an issue where a portion of Ares's trigger event 75/77 was determined unsuccessfully (by FlyStar)
426427
- Fixed the issue where some units crashed after the deployment transformation (by ststl, FlyStar)
427428
- Fixed the bug that AlphaImage remained after unit entered tunnel (by NetsuNegi)
428-
429429
```
430430

431431
### 0.4

src/Ext/Techno/Body.Internal.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ CoordStruct TechnoExt::GetSimpleFLH(InfantryClass* pThis, int weaponIndex, bool&
145145
return FLH;
146146
}
147147

148+
void TechnoExt::ExtData::InitializeDisplayInfo()
149+
{
150+
const auto pThis = this->OwnerObject();
151+
const auto pPrimary = pThis->GetWeapon(0)->WeaponType;
152+
153+
if (pPrimary && pThis->GetTechnoType()->LandTargeting != LandTargetingType::Land_Not_OK)
154+
pThis->RearmTimer.TimeLeft = pPrimary->ROF;
155+
else if (const auto pSecondary = pThis->GetWeapon(1)->WeaponType)
156+
pThis->RearmTimer.TimeLeft = pSecondary->ROF;
157+
158+
pThis->RearmTimer.StartTime = Math::min(-2, -pThis->RearmTimer.TimeLeft);
159+
}
160+
148161
void TechnoExt::ExtData::InitializeAttachEffects()
149162
{
150163
if (auto pTypeExt = this->TypeExtData)

0 commit comments

Comments
 (0)