Add Unit Passengers Display#2272
Conversation
- Show passenger cameo icons and counts above vehicles when selected
- Toggle via hotkey Toggle Unit Passengers with CSF-configurable messages
- Two modes: Permanent (ShowUnitPassengers=true) and Toggleable (ShowUnitPassengers.Toggleable=true)
- Icons use CAMEO_PAL, arranged bottom-to-top with fixed bottom boundary
New INI tags:
[AudioVisual] ShowUnitPassengers, ShowUnitPassengers.Toggleable,
ShowUnitPassengers.EnabledMessage, ShowUnitPassengers.DisabledMessage
[TechnoType] ShowPassengers, ShowPassengers.Toggleable,
Passengers.PerRow, Passengers.BottomOffset
c1aba96 to
5e17992
Compare
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
1bfa9f5 to
5d6ddbc
Compare
|
I think this should be T1 level... |
34bec10 to
bdedc8c
Compare
I raised the level because she is a first-time contributor. |
|
To Chinese users:
|
|
I think this is should be T1 level...
This is not appropriate. |
1d133f4 to
8fac7ff
Compare
- Show passenger cameo icons (SHP/PCX) and counts above vehicles when selected - Toggle via hotkey Toggle Unit Passengers with CSF-configurable messages - Two modes: Permanent (ShowUnitPassengers=true) and Toggleable (ShowUnitPassengers.Toggleable=true) - Icons use CAMEO_PAL/SHP, with PCX cameo fallback, arranged bottom-to-top with fixed bottom boundary New INI tags: [AudioVisual] ShowUnitPassengers, ShowUnitPassengers.Toggleable [TechnoType] ShowPassengers, ShowPassengers.PerRow, ShowPassengers.BottomOffset
8fac7ff to
1f1f0db
Compare
|
Here are the additional test items. |
| this->ShadowIndex_Frame.Read(exArtINI, pArtSection, "ShadowIndex.Frame"); | ||
|
|
||
| this->AltCameoPCX.Read(pArtINI, pArtSection, "AltCameoPCX"); | ||
| this->CameoPCX.Read(pArtINI, pArtSection, "CameoPCX"); |
There was a problem hiding this comment.
It is suggested to place it before AltCameoPCX in Ares' order, rather than after it.
There was a problem hiding this comment.
Moved CameoPCX.Read before AltCameoPCX.Read.
There was a problem hiding this comment.
Do not ignore the corresponding content in Ext\TechnoType\Body.h and .Process(this->CameoPCX) in Ext\TechnoType\Body.cpp.
There was a problem hiding this comment.
The CameoPalette used for Shape cameo looks strange sandwiched between two PCX cameo entries. Also, in the serialization, declaration, and initialization sections, you still haven't placed CameoPCX and AltCameoPCX together.
| bool Phobos::Config::ShowPlacementPreview = false; | ||
| bool Phobos::Config::EnableSelectBox = false; | ||
| bool Phobos::Config::DigitalDisplay_Enable = false; | ||
| bool Phobos::Config::UnitPassengers_Enable = false; |
There was a problem hiding this comment.
Should this feature add configuration items in RA2MD.INI for CnCNet Client and others to enable or disable?
There was a problem hiding this comment.
Emm,Idon't know…
It seems other features that use hotkeys don't do this.
There was a problem hiding this comment.
Really? Take Phobos::Config::DigitalDisplay_Enable in the previous line as an example. Many of them are here.
Phobos::Config::ToolTipDescriptions = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ToolTipDescriptions", true);
Phobos::Config::ToolTipBlur = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ToolTipBlur", false);
Phobos::Config::PrioritySelectionFiltering = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "PrioritySelectionFiltering", true);
Phobos::Config::PriorityDeployFiltering = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "PriorityDeployFiltering", true);
Phobos::Config::TypeSelectUseIFVMode = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "TypeSelectUseIFVMode", true);
Phobos::Config::ShowPlacementPreview = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowPlacementPreview", true);
Phobos::Config::MessageApplyHoverState = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "MessageApplyHoverState", false);
Phobos::Config::MessageDisplayInCenter = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "MessageDisplayInCenter", false);
Phobos::Config::MessageDisplayInCenter_BoardOpacity = CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "MessageDisplayInCenter.BoardOpacity", 40);
Phobos::Config::MessageDisplayInCenter_LabelsCount = CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "MessageDisplayInCenter.LabelsCount", 6);
Phobos::Config::MessageDisplayInCenter_RecordsCount = CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "MessageDisplayInCenter.RecordsCount", 12);
Phobos::Config::RealTimeTimers = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "RealTimeTimers", false);
Phobos::Config::RealTimeTimers_Adaptive = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "RealTimeTimers.Adaptive", false);
Phobos::Config::EnableSelectBox = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "EnableSelectBox", false);
Phobos::Config::DigitalDisplay_Enable = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "DigitalDisplay.Enable", false);
Phobos::Config::SaveGameOnScenarioStart = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "SaveGameOnScenarioStart", true);
Phobos::Config::ShowBriefing = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowBriefing", true);
Phobos::Config::ShowPowerDelta = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowPowerDelta", true);
Phobos::Config::ShowHarvesterCounter = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowHarvesterCounter", true);
Phobos::Config::ShowWeedsCounter = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowWeedsCounter", true);
Phobos::Config::HideLightFlashEffects = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "HideLightFlashEffects", false);
Phobos::Config::HideLaserTrailEffects = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "HideLaserTrailEffects", false);
Phobos::Config::HideShakeEffects = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "HideShakeEffects", false);
Phobos::Config::ShowFlashOnSelecting = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowFlashOnSelecting", false);
Phobos::Config::SuperWeaponSidebar_RequiredSignificance = CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "SuperWeaponSidebar.RequiredSignificance", 0);
// Custom game speeds, 6 - i so that GS6 is index 0, just like in the engine
Phobos::Config::CampaignDefaultGameSpeed = 6 - CCINIClass::INI_RA2MD.ReadInteger(phobosSection, "CampaignDefaultGameSpeed", 4);
if (Phobos::Config::CampaignDefaultGameSpeed > 6 || Phobos::Config::CampaignDefaultGameSpeed < 0)
{
Phobos::Config::CampaignDefaultGameSpeed = 2;
}
{
const byte temp = (byte)Phobos::Config::CampaignDefaultGameSpeed;
Patch::Apply_RAW(0x55D77A, { temp }); // We overwrite the instructions that force GameSpeed to 2 (GS4)
Patch::Apply_RAW(0x55D78D, { temp }); // when speed control is off. Doesn't need a hook.
}
Phobos::Config::ShowDesignatorRange = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowDesignatorRange", false);
Phobos::Config::ShowPowerPlantEnhancerRange = CCINIClass::INI_RA2MD.ReadBool(phobosSection, "ShowPowerPlantEnhancerRange", false);
CCINICThere was a problem hiding this comment.
Please check the logic priority.
You can refer to the method here for improvement.
| if (passengerCounts.empty()) | ||
| return; | ||
|
|
||
| const auto bracketPos = GetFootSelectBracketPosition(pThis, Anchor(HorizontalPosition::Center, VerticalPosition::Top)); |
There was a problem hiding this comment.
Does it not have any specific handling for BuildingType?
There was a problem hiding this comment.
A specific handling has been added to BuildingType before calling GetFootSelectBracketPosition
There was a problem hiding this comment.
Actually, buildings have a dedicated GetBuildingSelectBracketPosition().
- Move ToggleUnitPassengers include and MakeCommand to end of lists - Place CameoPCX.Read before AltCameoPCX.Read per Ares convention - Cache bottomOffset.Get() to avoid repeated calls - Remove redundant passengerCounts.empty() check (already guards on NumPassengers)
|
To testers: At the current stage, the following need to be tested:
|
- Rename fallback strings to 'Unit Passenger Icons' per review feedback - Merge three Whats-New lines into one summary line with anchor link
…ngelog New features belong in Changelog > #### New:, not Breaking changes
- Add abstract_cast<FootClass*> guard to prevent crash on BuildingType passengers - Read UnitPassengers.Enable from [Phobos] section in RA2MD.INI - Use pFoot instead of pThis for GetFootSelectBracketPosition
…s to Changelog" This reverts commit 7e442ae.
- Move ShowUnitPassengers reads to end of Rules/Body.cpp LoadFromINIFile - Add blank line between BunkerStateUpdateDelay and ShowUnitPassengers in Rules/Body.h - Move DrawUnitPassengers declaration after ApplyKillDriver in Techno/Body.h - Ensure proper blank line spacing in Hooks.Pips.cpp
6443e68 to
92365a5
Compare
Perhaps my inspiration came from a YR-based mod called Extreme Starry, but regardless, this feature provides players with a more convenient way to view the passengers inside vehicles.
New INI tags:
In
rulesmd.ini:Em……One picture to show the feature.Awa


Just like this:
Toggleable:
Permanent: