-
-
Notifications
You must be signed in to change notification settings - Fork 144
Add Passengers/Occupants Cameo Display #2272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
5e17992
1f1f0db
acf66e8
f8694e2
929925e
833bc82
7e442ae
4853568
42d0d0b
db52a4f
92365a5
ee05b3a
074849c
c2314d0
801330c
04e0649
35a61cd
2b7b980
0900197
a2bf97b
6cf1934
7820299
a01c29a
424ce73
2a35501
a956050
54f9776
d00b4f5
e8f1a88
e19bb92
2518c80
5fad5fc
3e4230a
fa96886
6c9ed24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -487,6 +487,41 @@ In `RA2MD.INI`: | |
| ShowPowerPlantEnhancerRange=false ; boolean | ||
| ``` | ||
|
|
||
| ### Unit Passengers Display | ||
|
|
||
| - You can now configure the game to display the passengers contained within a vehicle above it when selected. Each passenger type is shown as its Cameo icon with a count number in the upper-right corner. | ||
| - Two activation modes: | ||
| - **Permanent mode**: Set `ShowUnitPassengers=true` (global) or `ShowPassengers=true` (per-vehicle) to always show the display, regardless of the hotkey state. | ||
| - **Toggleable mode**: Set `ShowUnitPassengers.Toggleable=true` (global) and use the [Toggle Unit Passengers](#toggle-unit-passengers) hotkey to switch the display on/off. Per-vehicle `ShowPassengers.Toggleable` can override the global setting. | ||
| - When the feature is toggled via the hotkey, a message is shown in the top-left corner of the screen. The message text can be customized via CSF labels. | ||
| - Icons are arranged in horizontal rows from left to right, with the bottom row fixed at the bottom boundary. If the number of passenger types exceeds `Passengers.PerRow`, additional rows are drawn above the bottom row. | ||
|
|
||
| In `rulesmd.ini`: | ||
| ```ini | ||
| [AudioVisual] | ||
| ShowUnitPassengers=false ; boolean, permanently shows passengers for all vehicles (ignores hotkey). Defaults to false | ||
| ShowUnitPassengers.Toggleable=false ; boolean, allows hotkey to toggle the display. Defaults to false | ||
| ShowUnitPassengers.EnabledMessage= ; CSF entry key, message shown when the feature is enabled via hotkey | ||
| ShowUnitPassengers.DisabledMessage= ; CSF entry key, message shown when the feature is disabled via hotkey | ||
|
TaranDahl marked this conversation as resolved.
Outdated
|
||
|
|
||
| [SOMETECHNO] ; TechnoType | ||
| ShowPassengers= ; boolean, permanently show/hide for this vehicle (overrides global). Not set = follow global | ||
|
DeathFishAtEase marked this conversation as resolved.
Outdated
|
||
| ShowPassengers.Toggleable= ; boolean, override global toggleable setting for this vehicle. Not set = follow global | ||
|
TaranDahl marked this conversation as resolved.
Outdated
|
||
| Passengers.PerRow=5 ; integer, max icons per row before wrapping, defaults to 5 | ||
| Passengers.BottomOffset=0,0 ; X,Y, bottom boundary offset from selection bracket, defaults to 0,0 | ||
|
TaranDahl marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
Comment on lines
+574
to
+580
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No CustomPCX?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh wow, that makes sense... I forgot again. Something like a banner, hmm — yes, we do need support for custom PCX. But WAIT…
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Any difference with the CameoPCX?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It has been added…But I haven't tested whether it works properly (I think it should). |
||
|
|
||
| In `RA2MD.CSF`: | ||
|
|
||
| ; Hotkey UI labels | ||
| TXT_UNIT_PASSENGERS Toggle Unit Passengers | ||
| TXT_UNIT_PASSENGERS_DESC Show/hide unit passengers display. | ||
|
|
||
| ; Optional: customize the enabled/disabled messages | ||
| ; (must match the labels set in ShowUnitPassengers.EnabledMessage / DisabledMessage) | ||
| MSG:UnitPassengersEnabled Unit Passengers display: Enabled | ||
| MSG:UnitPassengersDisabled Unit Passengers display: Disabled | ||
|
TaranDahl marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Hotkey Commands | ||
|
|
||
| ### `[ ]` Display Damage Numbers | ||
|
|
@@ -519,6 +554,11 @@ ShowPowerPlantEnhancerRange=false ; boolean | |
| - Switches on/off [digital display types](#digital-display). | ||
| - For localization add `TXT_DIGITAL_DISPLAY` and `TXT_DIGITAL_DISPLAY_DESC` into your `.csf` file. | ||
|
|
||
| ### `[ ]` Toggle Unit Passengers | ||
|
|
||
| - Switches on/off [unit passengers display](#unit-passengers-display). | ||
| - For localization add `TXT_UNIT_PASSENGERS` and `TXT_UNIT_PASSENGERS_DESC` into your `.csf` file. | ||
|
|
||
| ### `[ ]` Next Idle Harvester | ||
|
|
||
| - Selects and centers the camera on the next TechnoType that is counted via the [harvester counter](#harvester-counter) and is currently idle. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #include "ToggleUnitPassengers.h" | ||
|
|
||
| #include <Utilities/GeneralUtils.h> | ||
| #include <Ext/Rules/Body.h> | ||
| #include <MessageListClass.h> | ||
| #include <HouseClass.h> | ||
|
|
||
| const char* ToggleUnitPassengersCommandClass::GetName() const | ||
| { | ||
| return "Toggle Unit Passengers"; | ||
| } | ||
|
|
||
| const wchar_t* ToggleUnitPassengersCommandClass::GetUIName() const | ||
| { | ||
| return GeneralUtils::LoadStringUnlessMissing("TXT_UNIT_PASSENGERS", L"Toggle Unit Passengers"); | ||
| } | ||
|
|
||
| const wchar_t* ToggleUnitPassengersCommandClass::GetUICategory() const | ||
| { | ||
| return CATEGORY_INTERFACE; | ||
| } | ||
|
|
||
| const wchar_t* ToggleUnitPassengersCommandClass::GetUIDescription() const | ||
| { | ||
| return GeneralUtils::LoadStringUnlessMissing("TXT_UNIT_PASSENGERS_DESC", L"Show/hide unit passengers display."); | ||
| } | ||
|
|
||
| void ToggleUnitPassengersCommandClass::Execute(WWKey eInput) const | ||
| { | ||
| Phobos::Config::UnitPassengers_Enable = !Phobos::Config::UnitPassengers_Enable; | ||
|
|
||
| auto PrintMessage = [](const wchar_t* pMessage) | ||
| { | ||
| MessageListClass::Instance.PrintMessage( | ||
| pMessage, | ||
| RulesClass::Instance->MessageDelay, | ||
| HouseClass::CurrentPlayer->ColorSchemeIndex, | ||
| true | ||
| ); | ||
| }; | ||
|
|
||
| const auto pRulesExt = RulesExt::Global(); | ||
|
|
||
| if (Phobos::Config::UnitPassengers_Enable) | ||
| { | ||
| const auto& msg = pRulesExt->ShowUnitPassengers_EnabledMessage; | ||
| if (msg.isset()) | ||
| PrintMessage(GeneralUtils::LoadStringUnlessMissing(msg.Get().Label, L"Unit Passengers display: Enabled")); | ||
| } | ||
| else | ||
| { | ||
| const auto& msg = pRulesExt->ShowUnitPassengers_DisabledMessage; | ||
| if (msg.isset()) | ||
| PrintMessage(GeneralUtils::LoadStringUnlessMissing(msg.Get().Label, L"Unit Passengers display: Disabled")); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #pragma once | ||
|
|
||
| #include "Commands.h" | ||
|
|
||
| class ToggleUnitPassengersCommandClass : public CommandClass | ||
| { | ||
| public: | ||
| virtual const char* GetName() const override; | ||
| virtual const wchar_t* GetUIName() const override; | ||
| virtual const wchar_t* GetUICategory() const override; | ||
| virtual const wchar_t* GetUIDescription() const override; | ||
| virtual void Execute(WWKey eInput) const override; | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.