mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-04-07 19:11:26 -06:00
Update hudbar for art2432
This commit is contained in:
parent
467418f089
commit
d64d09c1ad
@ -576,7 +576,7 @@ void CreditsControl::OnPaint(DibBitmap *pbm)
|
||||
if (m_fDrawCreditSymbol)
|
||||
pfnt->DrawText(pbm, "ABC", m_rc.left, m_rc.top, cx, -1);
|
||||
else
|
||||
pfnt->DrawText(pbm, "JBC", m_rc.left, m_rc.top, cx, -1);
|
||||
pfnt->DrawText(pbm, "LBC", m_rc.left, m_rc.top, cx, -1);
|
||||
|
||||
// Draw credits
|
||||
|
||||
@ -672,18 +672,18 @@ void PowerControl::OnPaint(DibBitmap *pbm)
|
||||
int x = m_rc.left + cxLeftSide;
|
||||
int cxMeter = pfnt->GetTextExtent("E");
|
||||
int cxPip = pfnt->GetTextExtent("I");
|
||||
const char *pszTick = "I";
|
||||
|
||||
Color clr;
|
||||
if (m_nSupply < m_nDemand) {
|
||||
clr = GetColor(kiclrRed);
|
||||
cxPip = pfnt->GetTextExtent("K");
|
||||
pszTick = "K";
|
||||
} else {
|
||||
// Dip into the yellow if building a structure might cause demand
|
||||
// to become less than supply.
|
||||
|
||||
if (m_nSupply - m_nDemand <= m_nDemandMax)
|
||||
clr = GetColor(kiclrYellow);
|
||||
else
|
||||
clr = GetColor(kiclrGreen);
|
||||
if (m_nSupply - m_nDemand <= m_nDemandMax) {
|
||||
cxPip = pfnt->GetTextExtent("J");
|
||||
pszTick = "J";
|
||||
}
|
||||
}
|
||||
|
||||
// UNDONE: handle > 400 units of power
|
||||
@ -692,11 +692,13 @@ void PowerControl::OnPaint(DibBitmap *pbm)
|
||||
if (cSupplyPips > kcPowerMeterPips)
|
||||
cSupplyPips = kcPowerMeterPips;
|
||||
|
||||
byte bclr = clr & 0xff;
|
||||
dword dwClr = MAKEDWORD(bclr);
|
||||
for (int i = 0; i < cSupplyPips; i++, x += cxPip) {
|
||||
char szTick[2];
|
||||
strncpyz(szTick, pszTick, 2);
|
||||
|
||||
for (int i = 0; i < cSupplyPips; i++, x += cxPip)
|
||||
pfnt->DrawText(pbm, "I", x, m_rc.top, 1, &dwClr);
|
||||
// HACK: Power ticks need to overlap by two pixels
|
||||
pfnt->DrawText(pbm, szTick, x - i*2, m_rc.top, 1);
|
||||
}
|
||||
|
||||
// Draw demand indicator
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user