Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

feat(gameengine): scoreboard tooltips, bigger promotions, income on one line

Olcay Seygandf06e169af5f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c2709ac08..e8d2073d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -764,8 +764,8 @@ found and fixed — EA's own, not port damage.**
## A scoreboard on Tab
- Hold Tab and a scoreboard opens in the top left corner of the screen, beside the menu key; let go and it is gone. All eight seats of a full game fit in the top half of a 720 line screen. It is built from your command bar's steel, grey, red or sand for your side, with the match clock in its corner. Each side sits under a band edged green for yours and red for the enemy, and the band says how many of that side are still in the game, 4/4 down to 0/4. Watching, there is a band for every team. With a group selected, Tab still steps through the units in it as before, so the scoreboard wants one unit or none selected.
-- Every row on your side opens on a stripe of that player's colour, then the general's flag, the player's name and the general under it. Then rank, money in the bank, income per minute, kills and losses, every promotion bought, once, at the level it has reached, and the unit that player has built the most of. Numbers line up on their last digit, and your own row is lit.
-- Under income per minute sits a smaller figure, what that player earned a second over the last half minute. The per-minute number is the average of the whole match, and ten minutes in a lost supply line hardly moves it. The small one falls within half a minute of the trucks stopping, and climbs again once a new line starts paying.
+- Every row on your side opens on a stripe of that player's colour, then the general's flag, the player's name and the general under it. Then rank, money in the bank, income per minute, kills and losses, every promotion bought, once, at the level it has reached, and the unit that player has built the most of. Numbers line up on their last digit, and your own row is lit. The promotions are drawn the size of the favourite unit's picture and the same shape, where they used to be 13 pixel squares you had to squint at. Point at a promotion, the favourite unit, a superweapon or something in a player's queue and the tooltip names it.
+- Beside income per minute, in brackets, is what that player earned a second over the last half minute, "1250(24)" on one line under "PER MIN(PER SEC)". The per-minute number is the average of the whole match, and ten minutes in a lost supply line hardly moves it. The small one falls within half a minute of the trucks stopping, and climbs again once a new line starts paying.
- Names are written in white and the player's colour goes on the stripe. Dark red on a black panel measured about 2 to 1 and could barely be read. A player who is out goes grey.
- An enemy row is a colour, a name and a team and nothing more. What they are playing and what they have in the bank is theirs to know.
- Watching a match, everybody gets the full row, with a team column to say who is with whom.
diff --git a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
index 4401185e6..1cb8b8d53 100644
--- a/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
+++ b/GeneralsMD/Code/Data/Window/Html/Scoreboard.html
@@ -13,19 +13,21 @@
then its seats, {{kind}} "seat" with {{name}} {{color}} {{team}} and {{state}}: "full" or
"hidden", plus " own" on your own seat and " defeated" once a seat is out. A full seat also
has {{portrait}} {{general}} {{rank}} {{cash}} {{income}}, the match's average a minute, with
- {{persecond}} under it, what it earned a second over the last half minute, {{kills}} {{losses}}, its promotions
- as {{skill0}} to {{skill6}}, and {{favourite}} with {{favouritename}}, the unit built most.
+ {{persecond}} after it in brackets, what it earned a second over the last half minute, {{kills}}
+ {{losses}}, its promotions as {{skill0}} to {{skill6}} named by {{skill0.tip}} to {{skill6.tip}},
+ and {{favourite}} with {{favouritename}}, the unit built most.
A hidden seat is an enemy: a name, a colour and a team, nothing else.
- Every seat has its five soonest superweapons as {{w0.image}} {{w0.time}} {{w0.state}} to
+ Every seat has its five soonest superweapons as {{w0.image}} {{w0.time}} {{w0.state}} {{w0.tip}} to
{{w4...}}, the state "ready" once it can fire and "none" for an unused place; {{more}} counts
the rest and {{moreready}} those of them ready, each with a mark "off" at zero; {{armed}} is
"armed" when it has any.
Watching, every seat also has its three soonest things coming, queued or going up, as
- {{j0.image}} {{j0.time}} {{j0.count}} ("x5" for a run of one thing) {{j0.state}} to {{j2...}},
- "none" for an unused place; {{jobsmore}} counts the rest, {{jobsmoremark}} "off" at zero, and
- {{watching}} is "watching" on every seat, coming or not.
+ {{j0.image}} {{j0.time}} {{j0.count}} ("x5" for a run of one thing) {{j0.state}} {{j0.tip}} to
+ {{j2...}}, "none" for an unused place; {{jobsmore}} counts the rest, {{jobsmoremark}} "off" at
+ zero, and {{watching}} is "watching" on every seat, coming or not.
- An image whose name is empty is not drawn, so an unused {{skillN}} leaves no box.
+ An image whose name is empty is not drawn, so an unused {{skillN}} leaves no box. A data-tip is
+ the tooltip the pointer gets over that element, and an empty one gets none.
Edit the copy under Run/Window/Html and the next match reads it.
-->
<html>
@@ -47,21 +49,22 @@
.china .well { background-color: rgba(26, 10, 8, 0.9); }
.gla .well { background-color: rgba(22, 19, 8, 0.9); }
- #board { position: absolute; left: 26px; top: 4px; width: 660px; padding-bottom: 3px; }
+ #board { position: absolute; left: 26px; top: 4px; width: 708px; padding-bottom: 3px; }
/* every column's left edge, shared by the captions and the seats; the Turkish captions are the
- long ones, so a number column is as wide as its caption rather than its digits. The columns
- are packed against the right edge, the favourite unit last, and the name takes what is left:
- at 98 pixels "USA Air Force General" ran into the team */
+ long ones, so a number column is as wide as its caption rather than its digits, and
+ "DAKIKADA(SANIYEDE)" is the longest. The columns are packed against the right edge, the
+ favourite unit last, and the name takes what is left: at 98 pixels "USA Air Force General" ran
+ into the team */
.c-name { left: 30px; }
- .c-team { left: 222px; width: 34px; }
- .c-rank { left: 258px; width: 34px; text-align: right; }
- .c-cash { left: 294px; width: 70px; text-align: right; }
- .c-income { left: 366px; width: 54px; text-align: right; }
- .c-kills { left: 422px; width: 46px; text-align: right; }
- .c-losses { left: 470px; width: 46px; text-align: right; }
- .c-skills { left: 526px; }
- .c-favourite { left: 630px; }
+ .c-team { left: 192px; width: 34px; }
+ .c-rank { left: 228px; width: 34px; text-align: right; }
+ .c-cash { left: 264px; width: 70px; text-align: right; }
+ .c-income { left: 336px; width: 90px; text-align: right; white-space: nowrap; }
+ .c-kills { left: 428px; width: 46px; text-align: right; }
+ .c-losses { left: 476px; width: 46px; text-align: right; }
+ .c-skills { left: 530px; }
+ .c-favourite { left: 682px; }
.captions { position: relative; height: 16px; line-height: 16px; }
.captions span { position: absolute; top: 0; font-size: 7px; color: #e8d27a; }
@@ -88,13 +91,11 @@
.seatrow .team { color: #c9d2d9; font-size: 8px; }
.seatrow .num { font-weight: bold; color: #f1f4f6; }
.seatrow .cash { color: #e8d27a; }
- /* the income cell stacks the match's average a minute over what it earns a second now, the way
- the name stacks over the general, and its caption stacks the two words the same way */
- .seatrow .income { top: 2px; line-height: 10px; }
- .seatrow .persecond { position: absolute; top: 12px; line-height: 8px; font-size: 7px; text-align: right; color: #c9d2d9; }
- .captions .c-income { line-height: 8px; }
- .seatrow .skill { position: absolute; top: 4px; width: 13px; height: 13px; }
- .seatrow .favourite { position: absolute; top: 3px; width: 18px; height: 15px; }
+ /* the match's average a minute, then what it earns a second now in brackets, on one line */
+ .seatrow .persecond { color: #c9d2d9; }
+ /* a promotion a cameo's shape, as big as the favourite unit beside them, a pixel apart */
+ .seatrow .skill { position: absolute; top: 3px; width: 20px; height: 16px; }
+ .seatrow .favourite { position: absolute; top: 3px; width: 20px; height: 16px; }
.hidden .tray, .hidden .num, .hidden .skill, .hidden .favourite, .hidden .general { display: none; }
.defeated .who { color: #8a949f; }
.defeated .num, .defeated .cash { color: #8a949f; }
@@ -137,7 +138,7 @@
<span class="c-team">{{text:GUI:ScoreboardTeam}}</span>
<span class="c-rank">{{text:GUI:ScoreboardLevel}}</span>
<span class="c-cash">{{text:GUI:ScoreboardMoney}}</span>
- <span class="c-income">{{text:GUI:ScoreboardPerMinute}}<br>{{text:GUI:ScoreboardPerSecond}}</span>
+ <span class="c-income">{{text:GUI:ScoreboardPerMinute}}({{text:GUI:ScoreboardPerSecond}})</span>
<span class="c-kills">{{text:GUI:ScoreboardKills}}</span>
<span class="c-losses">{{text:GUI:ScoreboardDeaths}}</span>
<span class="c-skills">{{text:GUI:ScoreboardPowers}}</span>
@@ -154,30 +155,29 @@
<span class="cell team c-team">{{team}}</span>
<span class="cell num c-rank">{{rank}}</span>
<span class="cell num cash c-cash">{{cash}}</span>
- <span class="cell num income c-income">{{income}}</span>
- <span class="num persecond c-income">{{persecond}}</span>
+ <span class="cell num income c-income">{{income}}<span class="persecond">({{persecond}})</span></span>
<span class="cell num c-kills">{{kills}}</span>
<span class="cell num c-losses">{{losses}}</span>
- <img class="skill" src="{{skill0}}" style="left: 526px">
- <img class="skill" src="{{skill1}}" style="left: 540px">
- <img class="skill" src="{{skill2}}" style="left: 554px">
- <img class="skill" src="{{skill3}}" style="left: 568px">
- <img class="skill" src="{{skill4}}" style="left: 582px">
- <img class="skill" src="{{skill5}}" style="left: 596px">
- <img class="skill" src="{{skill6}}" style="left: 610px">
- <img class="favourite c-favourite" src="{{favourite}}">
+ <img class="skill" src="{{skill0}}" data-tip="{{skill0.tip}}" style="left: 530px">
+ <img class="skill" src="{{skill1}}" data-tip="{{skill1.tip}}" style="left: 551px">
+ <img class="skill" src="{{skill2}}" data-tip="{{skill2.tip}}" style="left: 572px">
+ <img class="skill" src="{{skill3}}" data-tip="{{skill3.tip}}" style="left: 593px">
+ <img class="skill" src="{{skill4}}" data-tip="{{skill4.tip}}" style="left: 614px">
+ <img class="skill" src="{{skill5}}" data-tip="{{skill5.tip}}" style="left: 635px">
+ <img class="skill" src="{{skill6}}" data-tip="{{skill6.tip}}" style="left: 656px">
+ <img class="favourite c-favourite" src="{{favourite}}" data-tip="{{favouritename}}">
<div class="jobs">
- <div class="arm w0 {{j0.state}}"><img class="cameo" src="{{j0.image}}"><span class="count">{{j0.count}}</span><span class="time">{{j0.time}}</span></div>
- <div class="arm w1 {{j1.state}}"><img class="cameo" src="{{j1.image}}"><span class="count">{{j1.count}}</span><span class="time">{{j1.time}}</span></div>
- <div class="arm w2 {{j2.state}}"><img class="cameo" src="{{j2.image}}"><span class="count">{{j2.count}}</span><span class="time">{{j2.time}}</span></div>
+ <div class="arm w0 {{j0.state}}" data-tip="{{j0.tip}}"><img class="cameo" src="{{j0.image}}"><span class="count">{{j0.count}}</span><span class="time">{{j0.time}}</span></div>
+ <div class="arm w1 {{j1.state}}" data-tip="{{j1.tip}}"><img class="cameo" src="{{j1.image}}"><span class="count">{{j1.count}}</span><span class="time">{{j1.time}}</span></div>
+ <div class="arm w2 {{j2.state}}" data-tip="{{j2.tip}}"><img class="cameo" src="{{j2.image}}"><span class="count">{{j2.count}}</span><span class="time">{{j2.time}}</span></div>
<div class="more {{jobsmoremark}}">(+{{jobsmore}})</div>
</div>
<div class="arms">
- <div class="arm w0 {{w0.state}}"><img class="cameo" src="{{w0.image}}"><span class="time">{{w0.time}}</span></div>
- <div class="arm w1 {{w1.state}}"><img class="cameo" src="{{w1.image}}"><span class="time">{{w1.time}}</span></div>
- <div class="arm w2 {{w2.state}}"><img class="cameo" src="{{w2.image}}"><span class="time">{{w2.time}}</span></div>
- <div class="arm w3 {{w3.state}}"><img class="cameo" src="{{w3.image}}"><span class="time">{{w3.time}}</span></div>
- <div class="arm w4 {{w4.state}}"><img class="cameo" src="{{w4.image}}"><span class="time">{{w4.time}}</span></div>
+ <div class="arm w0 {{w0.state}}" data-tip="{{w0.tip}}"><img class="cameo" src="{{w0.image}}"><span class="time">{{w0.time}}</span></div>
+ <div class="arm w1 {{w1.state}}" data-tip="{{w1.tip}}"><img class="cameo" src="{{w1.image}}"><span class="time">{{w1.time}}</span></div>
+ <div class="arm w2 {{w2.state}}" data-tip="{{w2.tip}}"><img class="cameo" src="{{w2.image}}"><span class="time">{{w2.time}}</span></div>
+ <div class="arm w3 {{w3.state}}" data-tip="{{w3.tip}}"><img class="cameo" src="{{w3.image}}"><span class="time">{{w3.time}}</span></div>
+ <div class="arm w4 {{w4.state}}" data-tip="{{w4.tip}}"><img class="cameo" src="{{w4.image}}"><span class="time">{{w4.time}}</span></div>
<div class="more {{moremark}}">(+{{more}}<span class="moreready {{morereadymark}}">, {{moreready}} {{text:GUI:BarNetReady}}</span>)</div>
</div>
</div>
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/HtmlOverlay.h b/GeneralsMD/Code/GameEngine/Include/GameClient/HtmlOverlay.h
index f7f7a1e82..cabc4777e 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/HtmlOverlay.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/HtmlOverlay.h
@@ -26,7 +26,7 @@
//
// An element with data-click="..." is a button; click() hands back that text and the caller
// decides what it means. Clicks walk up from what is under the pointer to the first element
-// that has one.
+// that has one. data-tip="..." is the tooltip of what it is on, found the same way by tip().
//
// Not drawn: rounded corners, clipping for overflow, list bullets, and gradients other than
// linear ones, which draw as their first colour.
@@ -67,6 +67,9 @@ public:
/** Click at the pointer and return the data-click of what was clicked, empty for nothing. */
std::string click( const ICoord2D &mouse );
+ /** The data-tip of what the last hover() found under the pointer, empty for nothing. */
+ std::string tip( void );
+
/** The bottom edge in screen pixels of the first element the CSS selector finds, 0 for none. */
Int bottomOf( const char *selector );
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index 3b63e3c92..c2a899c8f 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -345,6 +345,7 @@ struct SpectatorSuperweapon
const Image *cameo;
Int seconds;
Bool ready;
+ UnicodeString name;
};
// ------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/HtmlOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/HtmlOverlay.cpp
index 59c1973d8..9fcafbaac 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/HtmlOverlay.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/HtmlOverlay.cpp
@@ -105,6 +105,7 @@ public:
void draw( void );
Bool hover( const ICoord2D &mouse );
std::string click( const ICoord2D &mouse );
+ std::string tip( void );
Int bottomOf( const char *selector );
void rectsOf( const char *selector, std::vector< IRegion2D > &rects );
void setAlpha( Int alpha ) { m_alpha = alpha; }
@@ -313,6 +314,21 @@ std::string HtmlOverlayContainer::click( const ICoord2D &mouse )
return m_clicked;
}
+//-------------------------------------------------------------------------------------------------
+std::string HtmlOverlayContainer::tip( void )
+{
+ if( !m_document )
+ return std::string();
+
+ for( std::shared_ptr< const litehtml::element > element = m_document->get_over_element(); element; element = element->parent() )
+ {
+ const char *text = element->get_attr( "data-tip" );
+ if( text )
+ return text;
+ }
+ return std::string();
+}
+
//-------------------------------------------------------------------------------------------------
Int HtmlOverlayContainer::bottomOf( const char *selector )
{
@@ -773,5 +789,6 @@ void HtmlOverlay::draw( void ) { m_container->draw(); }
void HtmlOverlay::setAlpha( Int alpha ) { m_container->setAlpha( alpha ); }
Bool HtmlOverlay::hover( const ICoord2D &mouse ) { return m_container->hover( mouse ); }
std::string HtmlOverlay::click( const ICoord2D &mouse ) { return m_container->click( mouse ); }
+std::string HtmlOverlay::tip( void ) { return m_container->tip(); }
Int HtmlOverlay::bottomOf( const char *selector ) { return m_container->bottomOf( selector ); }
void HtmlOverlay::rectsOf( const char *selector, std::vector< IRegion2D > &rects ) { m_container->rectsOf( selector, rects ); }
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index a361ebe03..e0dce3306 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -2098,7 +2098,7 @@ static void fillSpectatorArmies( const std::vector< SpectatorStats > &players, s
}
}
-static Int gatherPlayerSkills( const Player *player, const Image **icons, Int count, Int max );
+static Int gatherPlayerSkills( const Player *player, const CommandButton **buttons, Int count, Int max );
//-------------------------------------------------------------------------------------------------
/** The class the page dresses itself in: the side whose command bar is on screen, "america",
@@ -7542,9 +7542,11 @@ void InGameUI::postDraw( void )
: REAL_TO_INT( 100.0f * (Real)( reload - left ) / (Real)reload );
}
- addSuperweaponIcon( superweaponCameo( info->getSpecialPowerTemplate() ),
- readySecs, percent, isReady, info->getColor() );
- SpectatorSuperweapon listed = { i, superweaponCameo( info->getSpecialPowerTemplate() ), readySecs, isReady };
+ const CommandButton *button = powerButton( info->getSpecialPowerTemplate() );
+ const Image *cameo = button ? button->getButtonImage() : NULL;
+ addSuperweaponIcon( cameo, readySecs, percent, isReady, info->getColor() );
+ SpectatorSuperweapon listed = { i, cameo, readySecs, isReady,
+ button ? TheGameText->fetch( button->getTextLabel() ) : UnicodeString::TheEmptyString };
m_spectatorSuperweapons.push_back( listed );
}
if (info->getSpecialPowerTemplate()->isSharedNSync())
@@ -9641,6 +9643,20 @@ static const Image *stripSlotCameo( const Object *producer, const ProductionEntr
return entry->getProductionObject() ? entry->getProductionObject()->getButtonImage() : NULL;
}
+/** The name of what stripSlotCameo draws, empty where it draws nothing. */
+static UnicodeString stripSlotName( const Object *producer, const ProductionEntry *entry,
+ const InGameUI::ProductionStripSlot *slot )
+{
+ if( slot->isStructure )
+ return producer ? producer->getTemplate()->getDisplayName() : UnicodeString::TheEmptyString;
+ if( entry == NULL )
+ return UnicodeString::TheEmptyString;
+ if( slot->isUpgrade )
+ return entry->getProductionUpgrade() ? TheGameText->fetch( entry->getProductionUpgrade()->getDisplayNameLabel() )
+ : UnicodeString::TheEmptyString;
+ return entry->getProductionObject() ? entry->getProductionObject()->getDisplayName() : UnicodeString::TheEmptyString;
+}
+
//-------------------------------------------------------------------------------------------------
/** The tray a queue cameo stands in: the general's power bar's own, this side's copy of it, turned
* back to front. That bar grows leftward out of the corner and its tray's heavy rail is on the
@@ -10025,7 +10041,7 @@ void InGameUI::drawSuperweaponStrip( void )
struct BoughtSkill
{
ScienceType science;
- const Image *cameo;
+ const CommandButton *button;
};
/** Every science in one of a general's three promotion command sets that the player has actually
@@ -10050,7 +10066,7 @@ static Int gatherSkillCameos( const Player *player, const AsciiString &setName,
continue;
skills[ count ].science = science;
- skills[ count ].cameo = button->getButtonImage();
+ skills[ count ].button = button;
count++;
}
@@ -10058,14 +10074,14 @@ static Int gatherSkillCameos( const Player *player, const AsciiString &setName,
}
//-------------------------------------------------------------------------------------------------
-/** Everything one player has bought out of his three promotion sets, in rank order, as cameos
- * appended to icons. Hands back the new count.
+/** Everything one player has bought out of his three promotion sets, in rank order, as the
+ * promotion screen's buttons appended to buttons, each with a picture. Hands back the new count.
*
* A level that a later level of the same power has replaced is left out: Artillery Barrage 3 is
* one cameo, not three of the same picture in a row. "Replaced" is the science's own
* prerequisite list, so the second level asking for the first is what hides the first. */
//-------------------------------------------------------------------------------------------------
-static Int gatherPlayerSkills( const Player *player, const Image **icons, Int count, Int max )
+static Int gatherPlayerSkills( const Player *player, const CommandButton **buttons, Int count, Int max )
{
const PlayerTemplate *playerTemplate = player->getPlayerTemplate();
if( playerTemplate == NULL )
@@ -10089,7 +10105,7 @@ static Int gatherPlayerSkills( const Player *player, const Image **icons, Int co
if( replaced )
continue;
- icons[ count ] = skills[ i ].cameo;
+ buttons[ count ] = skills[ i ].button;
count++;
}
@@ -10120,7 +10136,7 @@ void InGameUI::drawSkillStrip( void )
if( local == NULL || local->isPlayerActive() || TheControlBar == NULL )
return;
- const Image *icons[ SKILL_STRIP_MAX ];
+ const CommandButton *skills[ SKILL_STRIP_MAX ];
Color rowColor[ SKILL_STRIP_ROWS ];
Int rowCount[ SKILL_STRIP_ROWS ];
Int rows = 0;
@@ -10128,7 +10144,7 @@ void InGameUI::drawSkillStrip( void )
Player *selected = TheControlBar->getSelectedPlayer();
if( selected )
{
- const Int count = gatherPlayerSkills( selected, icons, 0, SKILL_STRIP_MAX );
+ const Int count = gatherPlayerSkills( selected, skills, 0, SKILL_STRIP_MAX );
const Color color = clientPlayerColor( selected );
while( rows * SKILL_STRIP_COLS < count && rows < SKILL_STRIP_ROWS )
@@ -10149,7 +10165,7 @@ void InGameUI::drawSkillStrip( void )
// a row is one player's, so his own run stops at the end of it rather than running on
const Int start = rows * SKILL_STRIP_COLS;
- const Int count = gatherPlayerSkills( player, icons, start, start + SKILL_STRIP_COLS );
+ const Int count = gatherPlayerSkills( player, skills, start, start + SKILL_STRIP_COLS );
if( count == start )
continue; // nothing bought yet: no row rather than an empty one
@@ -10212,7 +10228,7 @@ void InGameUI::drawSkillStrip( void )
for( Int cameoSlot = 0; cameoSlot < inRow; cameoSlot++ )
{
const Int x = right - trayW + trayHole.x - cameoSlot * trayStep;
- TheDisplay->drawImage( icons[ first + cameoSlot ], x, y, x + cameoW, y + cameoH );
+ TheDisplay->drawImage( skills[ first + cameoSlot ]->getButtonImage(), x, y, x + cameoW, y + cameoH );
}
// whose skills these are, in his own colour, the same border the superweapon cameos wear
@@ -10312,10 +10328,14 @@ static HtmlValues scoreboardSeat( Player *player, const GameSlot *slot, Bool ful
seat[ "kills" ] = std::to_string( score->getTotalUnitsDestroyed() + score->getTotalBuildingsDestroyed() );
seat[ "losses" ] = std::to_string( score->getTotalUnitsLost() + score->getTotalBuildingsLost() );
- const Image *skills[ SCOREBOARD_SKILLS_SHOWN ];
+ const CommandButton *skills[ SCOREBOARD_SKILLS_SHOWN ];
const Int skillCount = gatherPlayerSkills( player, skills, 0, SCOREBOARD_SKILLS_SHOWN );
for( Int skill = 0; skill < skillCount; skill++ )
- seat[ "skill" + std::to_string( skill ) ] = skills[ skill ]->getName().str();
+ {
+ const std::string name = "skill" + std::to_string( skill );
+ seat[ name ] = skills[ skill ]->getButtonImage()->getName().str();
+ seat[ name + ".tip" ] = WideCharStringToMultiByte( TheGameText->fetch( skills[ skill ]->getTextLabel() ).str() );
+ }
const ThingTemplate *favourite = score->getMostBuiltUnit();
if( favourite && favourite->getButtonImage() )
@@ -10359,6 +10379,7 @@ static void putSeatSuperweapons( HtmlValues &row, Int playerIndex, const std::ve
row[ name + ".image" ] = owned[ place ].cameo ? owned[ place ].cameo->getName().str() : "";
row[ name + ".time" ] = WideCharStringToMultiByte( time.str() );
row[ name + ".state" ] = owned[ place ].ready ? "ready" : "";
+ row[ name + ".tip" ] = WideCharStringToMultiByte( owned[ place ].name.str() );
}
Int more = 0;
@@ -10419,6 +10440,7 @@ static void putSeatQueue( HtmlValues &row, Player *player )
row[ name + ".time" ] = WideCharStringToMultiByte( time.str() );
row[ name + ".count" ] = slot->quantity > 1 ? "x" + std::to_string( slot->quantity ) : "";
row[ name + ".state" ] = "";
+ row[ name + ".tip" ] = WideCharStringToMultiByte( stripSlotName( producer, entry, slot ).str() );
shown += slot->quantity;
}
row[ "jobsmore" ] = std::to_string( total - shown );
@@ -10461,6 +10483,10 @@ void InGameUI::drawScoreboard( void )
m_scoreboardHtmlFrame = frame;
}
m_scoreboardOverlay->setPage( m_scoreboardHtml );
+ // the mouse clears its tooltip every frame, so one set here lasts as long as the pointer stays on
+ // a promotion, a cameo or the favourite unit, and the board hides whatever is under it
+ if( m_scoreboardOverlay->hover( TheMouse->getMouseStatus()->pos ) )
+ TheMouse->setCursorTooltip( UnicodeString( MultiByteToWideCharSingleLine( m_scoreboardOverlay->tip().c_str() ).c_str() ) );
m_scoreboardOverlay->draw();
}