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
9 changes: 5 additions & 4 deletions docs/User-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,10 @@ MissingCameo=XXICON.SHP ; filename - including the .shp/.pcx extension
In `uimd.ini`:
```ini
[Sidebar]
HarvesterCounter.Show=false ; boolean
HarvesterCounter.Label=<none> ; CSF entry key
HarvesterCounter.ConditionYellow=99% ; floating point value, percents
HarvesterCounter.ConditionRed=50% ; floating point value, percents
HarvesterCounter.Show=false ; boolean
HarvesterCounter.Label=<none> ; CSF entry key
HarvesterCounter.ConditionYellow=99% ; floating point value, percents
HarvesterCounter.ConditionRed=50% ; floating point value, percents
```

In `rulesmd.ini`:
Expand All @@ -651,6 +651,7 @@ Harvester.Counted= ; boolean

[SOMESIDE] ; Side
Sidebar.HarvesterCounter.Offset=0,0 ; X,Y, pixels relative to default
Sidebar.HarvesterCounter.ColorGreen= ; integer - Red,Green,Blue, default to [Side] -> ToolTipColor=
Sidebar.HarvesterCounter.ColorYellow=255,255,0 ; integer - Red,Green,Blue
Sidebar.HarvesterCounter.ColorRed=255,0,0 ; integer - Red,Green,Blue
```
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ New:
- [Customize default mirage disguises per vehicletypes](New-or-Enhanced-Logics.md#default-mirage-disguise-for-individual-vehicletypes) (by NetsuNegi)
- [Allow customize jumpjet properties on warhead](Fixed-or-Improved-Logics.md#customizing-locomotor-warhead) (by NetsuNegi)
- Customize effects range of power plant enhancer (by NetsuNegi)
- Allow each side to customize the color when the proportion of working miners is higher than `HarvesterCounter.ConditionYellow` (by Noble_Fish)

Vanilla fixes:
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
Expand Down
26 changes: 14 additions & 12 deletions src/Ext/Side/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ void SideExt::ExtData::LoadFromINIFile(CCINIClass* pINI)
this->IngameScore_WinTheme = pINI->ReadTheme(pSection, "IngameScore.WinTheme", this->IngameScore_WinTheme);
this->IngameScore_LoseTheme = pINI->ReadTheme(pSection, "IngameScore.LoseTheme", this->IngameScore_LoseTheme);
this->Sidebar_HarvesterCounter_Offset.Read(exINI, pSection, "Sidebar.HarvesterCounter.Offset");
this->Sidebar_HarvesterCounter_Yellow.Read(exINI, pSection, "Sidebar.HarvesterCounter.ColorYellow");
this->Sidebar_HarvesterCounter_Red.Read(exINI, pSection, "Sidebar.HarvesterCounter.ColorRed");
this->Sidebar_HarvesterCounter_ColorGreen.Read(exINI, pSection, "Sidebar.HarvesterCounter.ColorGreen");
this->Sidebar_HarvesterCounter_ColorYellow.Read(exINI, pSection, "Sidebar.HarvesterCounter.ColorYellow");
this->Sidebar_HarvesterCounter_ColorRed.Read(exINI, pSection, "Sidebar.HarvesterCounter.ColorRed");
this->Sidebar_WeedsCounter_Offset.Read(exINI, pSection, "Sidebar.WeedsCounter.Offset");
this->Sidebar_WeedsCounter_Color.Read(exINI, pSection, "Sidebar.WeedsCounter.Color");
this->Sidebar_ProducingProgress_Offset.Read(exINI, pSection, "Sidebar.ProducingProgress.Offset");
this->Sidebar_PowerDelta_Offset.Read(exINI, pSection, "Sidebar.PowerDelta.Offset");
this->Sidebar_PowerDelta_Green.Read(exINI, pSection, "Sidebar.PowerDelta.ColorGreen");
this->Sidebar_PowerDelta_Yellow.Read(exINI, pSection, "Sidebar.PowerDelta.ColorYellow");
this->Sidebar_PowerDelta_Red.Read(exINI, pSection, "Sidebar.PowerDelta.ColorRed");
this->Sidebar_PowerDelta_Grey.Read(exINI, pSection, "Sidebar.PowerDelta.ColorGrey");
this->Sidebar_PowerDelta_ColorGreen.Read(exINI, pSection, "Sidebar.PowerDelta.ColorGreen");
this->Sidebar_PowerDelta_ColorYellow.Read(exINI, pSection, "Sidebar.PowerDelta.ColorYellow");
this->Sidebar_PowerDelta_ColorRed.Read(exINI, pSection, "Sidebar.PowerDelta.ColorRed");
this->Sidebar_PowerDelta_ColorGrey.Read(exINI, pSection, "Sidebar.PowerDelta.ColorGrey");
this->Sidebar_PowerDelta_Align.Read(exINI, pSection, "Sidebar.PowerDelta.Align");
this->ToolTip_Background_Color.Read(exINI, pSection, "ToolTip.Background.Color");
this->ToolTip_Background_Opacity.Read(exINI, pSection, "ToolTip.Background.Opacity");
Expand All @@ -64,16 +65,17 @@ void SideExt::ExtData::Serialize(T& Stm)
.Process(this->ArrayIndex)
.Process(this->Sidebar_GDIPositions)
.Process(this->Sidebar_HarvesterCounter_Offset)
.Process(this->Sidebar_HarvesterCounter_Yellow)
.Process(this->Sidebar_HarvesterCounter_Red)
.Process(this->Sidebar_HarvesterCounter_ColorGreen)
.Process(this->Sidebar_HarvesterCounter_ColorYellow)
.Process(this->Sidebar_HarvesterCounter_ColorRed)
.Process(this->Sidebar_WeedsCounter_Offset)
.Process(this->Sidebar_WeedsCounter_Color)
.Process(this->Sidebar_ProducingProgress_Offset)
.Process(this->Sidebar_PowerDelta_Offset)
.Process(this->Sidebar_PowerDelta_Green)
.Process(this->Sidebar_PowerDelta_Yellow)
.Process(this->Sidebar_PowerDelta_Red)
.Process(this->Sidebar_PowerDelta_Grey)
.Process(this->Sidebar_PowerDelta_ColorGreen)
.Process(this->Sidebar_PowerDelta_ColorYellow)
.Process(this->Sidebar_PowerDelta_ColorRed)
.Process(this->Sidebar_PowerDelta_ColorGrey)
.Process(this->Sidebar_PowerDelta_Align)
.Process(this->ToolTip_Background_Color)
.Process(this->ToolTip_Background_Opacity)
Expand Down
26 changes: 14 additions & 12 deletions src/Ext/Side/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ class SideExt
Valueable<int> IngameScore_WinTheme;
Valueable<int> IngameScore_LoseTheme;
Valueable<Point2D> Sidebar_HarvesterCounter_Offset;
Valueable<ColorStruct> Sidebar_HarvesterCounter_Yellow;
Valueable<ColorStruct> Sidebar_HarvesterCounter_Red;
Nullable<ColorStruct> Sidebar_HarvesterCounter_ColorGreen;
Valueable<ColorStruct> Sidebar_HarvesterCounter_ColorYellow;
Valueable<ColorStruct> Sidebar_HarvesterCounter_ColorRed;
Valueable<Point2D> Sidebar_WeedsCounter_Offset;
Nullable<ColorStruct> Sidebar_WeedsCounter_Color;
Valueable<Point2D> Sidebar_ProducingProgress_Offset;
Valueable<Point2D> Sidebar_PowerDelta_Offset;
Valueable<ColorStruct> Sidebar_PowerDelta_Green;
Valueable<ColorStruct> Sidebar_PowerDelta_Yellow;
Valueable<ColorStruct> Sidebar_PowerDelta_Red;
Valueable<ColorStruct> Sidebar_PowerDelta_Grey;
Valueable<ColorStruct> Sidebar_PowerDelta_ColorGreen;
Valueable<ColorStruct> Sidebar_PowerDelta_ColorYellow;
Valueable<ColorStruct> Sidebar_PowerDelta_ColorRed;
Valueable<ColorStruct> Sidebar_PowerDelta_ColorGrey;
Valueable<TextAlign> Sidebar_PowerDelta_Align;
Nullable<ColorStruct> ToolTip_Background_Color;
Nullable<int> ToolTip_Background_Opacity;
Expand All @@ -48,16 +49,17 @@ class SideExt
, IngameScore_WinTheme { -2 }
, IngameScore_LoseTheme { -2 }
, Sidebar_HarvesterCounter_Offset { { 0, 0 } }
, Sidebar_HarvesterCounter_Yellow { { 255, 255, 0 } }
, Sidebar_HarvesterCounter_Red { { 255, 0, 0 } }
, Sidebar_HarvesterCounter_ColorGreen { }
, Sidebar_HarvesterCounter_ColorYellow { { 255, 255, 0 } }
, Sidebar_HarvesterCounter_ColorRed { { 255, 0, 0 } }
, Sidebar_WeedsCounter_Offset { { 0, 0 } }
, Sidebar_WeedsCounter_Color {}
, Sidebar_ProducingProgress_Offset { { 0, 0 } }
, Sidebar_PowerDelta_Offset { { 0, 0 } }
, Sidebar_PowerDelta_Green { { 0, 255, 0 } }
, Sidebar_PowerDelta_Yellow { { 255, 255, 0 } }
, Sidebar_PowerDelta_Red { { 255, 0, 0 } }
, Sidebar_PowerDelta_Grey { { 0x80,0x80,0x80 } }
, Sidebar_PowerDelta_ColorGreen { { 0, 255, 0 } }
, Sidebar_PowerDelta_ColorYellow { { 255, 255, 0 } }
, Sidebar_PowerDelta_ColorRed { { 255, 0, 0 } }
, Sidebar_PowerDelta_ColorGrey { { 0x80,0x80,0x80 } }
, Sidebar_PowerDelta_Align { TextAlign::Left }
, ToolTip_Background_Color { }
, ToolTip_Background_Opacity { }
Expand Down
10 changes: 5 additions & 5 deletions src/Misc/Hooks.UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
const double nPercentage = nTotal == 0 ? 1.0 : (double)nActive / (double)nTotal;

const ColorStruct clrToolTip = nPercentage > Phobos::UI::HarvesterCounter_ConditionYellow
? Drawing::TooltipColor : nPercentage > Phobos::UI::HarvesterCounter_ConditionRed
? pSideExt->Sidebar_HarvesterCounter_Yellow : pSideExt->Sidebar_HarvesterCounter_Red;
? pSideExt->Sidebar_HarvesterCounter_ColorGreen.Get(Drawing::TooltipColor) : nPercentage > Phobos::UI::HarvesterCounter_ConditionRed
? pSideExt->Sidebar_HarvesterCounter_ColorYellow : pSideExt->Sidebar_HarvesterCounter_ColorRed;

swprintf_s(counter, L"%ls%d/%d", Phobos::UI::HarvesterLabel, nActive, nTotal);

Expand All @@ -115,7 +115,7 @@

if (pPlayer->PowerBlackoutTimer.InProgress())
{
clrToolTip = pSideExt->Sidebar_PowerDelta_Grey;
clrToolTip = pSideExt->Sidebar_PowerDelta_ColorGrey;
swprintf_s(counter, L"%ls", Phobos::UI::PowerBlackoutLabel);
}
else
Expand All @@ -127,8 +127,8 @@
? Phobos::UI::PowerDelta_ConditionRed * 2.f : Phobos::UI::PowerDelta_ConditionYellow;

clrToolTip = percent < Phobos::UI::PowerDelta_ConditionYellow
? pSideExt->Sidebar_PowerDelta_Green : LESS_EQUAL(percent, Phobos::UI::PowerDelta_ConditionRed)
? pSideExt->Sidebar_PowerDelta_Yellow : pSideExt->Sidebar_PowerDelta_Red;
? pSideExt->Sidebar_PowerDelta_ColorGreen : LESS_EQUAL(percent, Phobos::UI::PowerDelta_ConditionRed)
? pSideExt->Sidebar_PowerDelta_ColorYellow : pSideExt->Sidebar_PowerDelta_ColorRed;

swprintf_s(counter, L"%ls%+d", Phobos::UI::PowerLabel, delta);
}
Expand Down Expand Up @@ -635,7 +635,7 @@

enhancerCoords.Z = MapClass::Instance.GetCellFloorHeight(enhancerCoords);
const auto& color = pEnhancer->Owner->Color;
Game::DrawRadialIndicator(false, true, enhancerCoords, color, range, false, true);

Check warning on line 638 in src/Misc/Hooks.UI.cpp

View workflow job for this annotation

GitHub Actions / build

'argument': conversion from 'const int' to 'float', possible loss of data [D:\a\Phobos\Phobos\Phobos.vcxproj]
}
}

Expand Down
Loading