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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameclient): load screen on the lobby's own panel and button row
Olcay Seyganfff67db3bce8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ee1915466..87da0c645 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -15,7 +15,7 @@ found and fixed — EA's own, not port damage.**- The map's name, the kind of game, the team sizes and the starting cash head the screen. Along the bottom a tip changes every eight seconds over the load's bar and percentage.- Enemies who picked a random side, colour or start stay hidden as they were in the lobby. Observers and replays see every side as it is.- A campaign mission keeps its own picture and briefing movie. Once the movie ends, the mission number, campaign and difficulty sit above it and the same tip and bar sit below it. Generals' Challenge is unchanged.-- It wears the menus' own lettering and blue frames, so the load looks like the lobby it came from.+- It is the lobby it came from: the same see-through panel over the menu's battle picture, the map's name in capitals where the lobby says SKIRMISH, cards framed like the lobby's seat rows, the map preview in a button's blue edge, and the load bar a wide button along the bottom that fills as the game loads. A mission's header and foot are strips of the same panel over its own picture.## A summary and graphs on the score screen@@ -23,7 +23,7 @@ found and fixed — EA's own, not port damage.**- The tabs beside Summary give a chart the whole screen, one line per player over the whole match: money earned, army size or buildings standing, with each player's colour named along the top. Army size counts infantry, vehicles and aircraft; workers and supply trucks are left out.- A single row of small pictures above the chart marks superweapons built and fired, general's powers and promotions, framed in the player's colour. Moments that fall close together share one picture with a count on it. Hover over it for the list, each line with its time, and a faint line down to where each one falls on the chart.- The Build order tab puts the first of each structure and unit each player made on a timeline whose first five minutes take over half the width, so an opening reads at a glance. Show every build adds the rest; hover over a picture for its name and time. With the whole page to itself a 4v4 keeps two strips of pictures per player, even at 1280x720.-- The map's name heads the page, the pages sit in boxed tabs like the options screen's, and the open one is lettered green. Dark blue and purple player names are lifted so they stay readable on the panel.+- The map's name heads the page in capitals, as the lobby and the load letter theirs, the pages sit in boxed tabs like the options screen's, and the open one is lettered green. Dark blue and purple player names are lifted so they stay readable on the panel.- The game records all of this as the match plays, a sample every five seconds, and it changes nothing in the match itself. A game loaded from a save only graphs what happened after the load.## Computer players have personalitiesdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/UIStyle.h b/GeneralsMD/Code/GameEngine/Include/GameClient/UIStyle.hindex f15ade6aa..956d3f5a9 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/UIStyle.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/UIStyle.h@@ -32,6 +32,7 @@#include "Lib/BaseType.h"#include "GameClient/Color.h"+#include "Common/UnicodeString.h"class GameFont;class DisplayString;@@ -77,6 +78,8 @@ namespace UIStylevoid rule( Int x, Int y, Int width );/// a layout button's box: the panel's black under a blue, cyan, blue edgevoid button( Int x, Int y, Int width, Int height );+ /// that blue, cyan, blue edge alone, round a map preview or a progress bar+ void edge( Int x, Int y, Int width, Int height );/// a tab's box; the label in it is ACTIVE when the tab is open, INK when notvoid tab( Int x, Int y, Int width, Int height );/// the player's colour down the edge of his row or card, stripeWidth() wide@@ -84,6 +87,8 @@ namespace UIStyleInt stripeWidth( void );/// "Zero Hour Reforged" with its right edge at right; words are "Zero Hour" and " Reforged"void wordmark( DisplayString *words[ 2 ], Int right, Int y );+ /// a screen's title in capitals, as the layouts letter theirs+ UnicodeString capitals( const UnicodeString &words );/// a house colour lifted toward white where it is too dark to read as words on a panelColor readable( Color player );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreenGraphs.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreenGraphs.cppindex 63fd01ee2..1677eb68b 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreenGraphs.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreenGraphs.cpp@@ -1039,7 +1039,7 @@ void ScoreScreenGraphsInit( GameWindow *parent, GameWindow *anchor )mapName = map->m_displayName;elsemapName.translate( TheGameState->getMapLeafName( TheGlobalData->m_mapName ) );- s_title = newText( mapName, UIStyle::titleFont( UIStyle::TEXT_TITLE ) );+ s_title = newText( UIStyle::capitals( mapName ), UIStyle::titleFont( UIStyle::TEXT_TITLE ) );GameFont *wordmarkFont = UIStyle::font( UIStyle::TEXT_STRONG, TRUE );s_wordmark[ 0 ] = newText( UnicodeString( u"Zero Hour" ), wordmarkFont );s_wordmark[ 1 ] = newText( UnicodeString( u" Reforged" ), wordmarkFont );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cppindex ebaaec27a..636936043 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp@@ -205,6 +205,20 @@ static const Int BOARD_TIP_COUNT = 10;static const UnsignedInt BOARD_TIP_MILLISECONDS = 8000;/// a middle dot between spaces, spelled out: the source is read in the machine's code pagestatic const WideChar BOARD_SEPARATOR[] = { ' ', ' ', ' ', 0x00B7, ' ', ' ', ' ', 0 };+/// the skirmish lobby's panel, title, header line, seat inset and button row+/// (SkirmishGameOptionsMenu.wnd), so the load stands where the lobby stood+static const Real BOARD_PANEL_LEFT = 40.0f;+static const Real BOARD_PANEL_TOP = 36.0f;+static const Real BOARD_PANEL_RIGHT = 1880.0f;+static const Real BOARD_PANEL_BOTTOM = 1044.0f;+static const Real BOARD_TITLE_LEFT = 68.0f;+static const Real BOARD_TITLE_MIDDLE = 76.0f;+static const Real BOARD_HEADER_LINE = 111.0f;+static const Real BOARD_INSET = 72.0f;+static const Real BOARD_BUTTON_TOP = 968.0f;+static const Real BOARD_BUTTON_BOTTOM = 1024.0f;+/// the lobby's dimming of the shell behind its panel+static const Color BOARD_SHELL_DIM = GameMakeColor( 2, 4, 12, 120 );/// one player's cardstruct BoardCard@@ -217,7 +231,6 @@ struct BoardCardInt percent; ///< this player's own load, -1 on a card without a barBool mirrored; ///< the right column's cards face leftconst Image *emblem; ///< the general's portrait or the side's crest, NULL for a hidden or random side- const Image *watermark; ///< the side's flag, faint behind the wordsconst Image *badge; ///< an online player's rankDisplayString *name;DisplayString *army;@@ -270,6 +283,7 @@ private:std::vector< BoardSpot > m_spots;std::vector< DisplayString * > m_strings;Bool m_mission;+ const Image *m_shell; ///< the shell's still the lobby stands on without its mapDisplayString *m_briefingHead;std::vector< DisplayString * > m_briefing;IRegion2D m_briefingBox;@@ -277,8 +291,6 @@ private:DisplayString *m_subtitle;DisplayString *m_wordmark[ 2 ];DisplayString *m_columnHead[ 2 ];- const Image *m_backdrop[ 2 ];- IRegion2D m_backdropBox[ 2 ];Color m_columnTeam[ 2 ];ICoord2D m_columnHeadPos[ 2 ];DisplayString *m_centerLabel;@@ -307,11 +319,11 @@ LoadScreenBoard::LoadScreenBoard( void )m_left = ( m_width - scaled( BOARD_WIDTH ) ) / 2;m_top = ( m_height - scaled( BOARD_HEIGHT ) ) / 2;m_mission = FALSE;+ m_shell = TheMappedImageCollection->findImageByName( "MainMenuBackdrop" );m_briefingHead = NULL;m_title = m_subtitle = m_centerLabel = m_observers = m_unknown = NULL;m_wordmark[ 0 ] = m_wordmark[ 1 ] = NULL;m_columnHead[ 0 ] = m_columnHead[ 1 ] = NULL;- m_backdrop[ 0 ] = m_backdrop[ 1 ] = NULL;m_mapImage = NULL;m_tipLabel = m_tip = m_percent = m_waiting = NULL;m_tipIndex = 0;@@ -436,15 +448,12 @@ GameWindow *LoadScreenBoard::create( GameInfo *game, const char *modeLabel, Boolcard.mirrored = FALSE;card.badge = NULL;card.emblem = NULL;- card.watermark = NULL;const Int sideIndex = seeAll ? slot->getPlayerTemplate() : slot->getApparentPlayerTemplate();UnicodeString army = TheGameText->fetch( "GUI:Random" );if( sideIndex >= 0 ){const PlayerTemplate *side = ThePlayerTemplateStore->getNthPlayerTemplate( sideIndex );card.emblem = sideEmblem( side );- // a plain side's emblem is its crest already- card.watermark = card.emblem == sideCrest( side ) ? NULL : sideCrest( side );army = side->getDisplayName();}card.name = text( slot->getName(), nameFont );@@ -514,7 +523,6 @@ GameWindow *LoadScreenBoard::create( GameInfo *game, const char *modeLabel, BoolmapName = map->m_displayName;elsemapName.translate( TheGameState->getMapLeafName( game->getMap() ) );- const Int margin = scaled( 64 );UnicodeString subtitle = TheGameText->fetch( modeLabel );if( !makeup.isEmpty() ){@@ -531,8 +539,8 @@ GameWindow *LoadScreenBoard::create( GameInfo *game, const char *modeLabel, Boolm_unknown = text( UnicodeString( u"?" ), centerFont );const Int columnWidth = scaled( 640 );- const Int bandTop = m_top + scaled( 200 );- const Int bandBottom = m_top + scaled( 920 );+ const Int bandTop = m_top + scaled( 160 );+ const Int bandBottom = m_top + scaled( 880 );Int cardsTop = bandTop;for( Int side = 0; side < 2; side++ ){@@ -545,25 +553,10 @@ GameWindow *LoadScreenBoard::create( GameInfo *game, const char *modeLabel, Boolm_columnTeam[ side ] = LobbyTeamColor( teamOf[ side ] );cardsTop = bandTop + stringHeight( m_columnHead[ side ] ) + scaled( 12 );}- const Int leftX = m_left + margin;- const Int rightX = m_left + scaled( BOARD_WIDTH ) - margin - columnWidth;+ const Int leftX = m_left + scaled( BOARD_INSET );+ const Int rightX = m_left + scaled( BOARD_PANEL_RIGHT + BOARD_PANEL_LEFT - BOARD_INSET ) - columnWidth;layoutColumn( columns[ 0 ], leftX, cardsTop, bandBottom, FALSE );layoutColumn( columns[ 1 ], rightX, cardsTop, bandBottom, TRUE );- // behind each column, large and faint, the crest of the side its first card plays- for( Int side = 0; side < 2; side++ )- {- m_backdrop[ side ] = NULL;- if( columns[ side ].empty() )- continue;- const BoardCard &first = m_cards[ columns[ side ][ 0 ] ];- m_backdrop[ side ] = first.watermark ? first.watermark : first.emblem;- const Int size = scaled( 760 );- const Int centerX = ( side == 0 ? leftX : rightX ) + columnWidth / 2;- m_backdropBox[ side ].lo.x = centerX - size / 2;- m_backdropBox[ side ].lo.y = ( bandTop + bandBottom - size ) / 2;- m_backdropBox[ side ].hi.x = centerX + size / 2;- m_backdropBox[ side ].hi.y = m_backdropBox[ side ].lo.y + size;- }// a team's name sits over its first card, the swatch on the outer edgefor( Int side = 0; side < 2; side++ ){@@ -647,7 +640,7 @@ void LoadScreenBoard::prepare( const UnicodeString &title, const UnicodeString &{GameFont *wordmarkFont = UIStyle::font( UIStyle::TEXT_STRONG, TRUE );GameFont *tipFont = UIStyle::font( UIStyle::TEXT_BODY );- m_title = text( title, UIStyle::titleFont( UIStyle::TEXT_TITLE ) );+ m_title = text( UIStyle::capitals( title ), UIStyle::titleFont( UIStyle::TEXT_TITLE ) );m_subtitle = text( subtitle, tipFont );m_wordmark[ 0 ] = text( UnicodeString( u"Zero Hour" ), wordmarkFont );m_wordmark[ 1 ] = text( UnicodeString( u" Reforged" ), wordmarkFont );@@ -657,8 +650,9 @@ void LoadScreenBoard::prepare( const UnicodeString &title, const UnicodeString &m_tipIndex = (Int)( Clock_Milliseconds() % BOARD_TIP_COUNT );m_tipSince = Clock_Milliseconds();m_tip = text( tipText( m_tipIndex ), tipFont );- m_percent = text( UnicodeString( u"0%" ), UIStyle::font( UIStyle::TEXT_STRONG, TRUE ) );- m_waiting = text( TheGameText->fetch( "GUI:LoadWaiting" ), tipFont );+ // lettered as a lobby button's label+ m_percent = text( UnicodeString( u"0%" ), UIStyle::titleFont( UIStyle::TEXT_HEADING ) );+ m_waiting = text( UIStyle::capitals( TheGameText->fetch( "GUI:LoadWaiting" ) ), UIStyle::titleFont( UIStyle::TEXT_HEADING ) );m_localPercent = 0;}@@ -681,8 +675,8 @@ GameWindow *LoadScreenBoard::createMission( GameWindow *parent, const UnicodeStrconst Int pad = scaled( 28 );const Int width = scaled( 640 );- m_briefingBox.lo.x = m_left + scaled( 64 );- m_briefingBox.lo.y = m_top + scaled( 216 );+ m_briefingBox.lo.x = m_left + scaled( BOARD_INSET );+ m_briefingBox.lo.y = m_top + scaled( 152 );m_briefingBox.hi.x = m_briefingBox.lo.x + width;m_briefingHead = text( TheGameText->fetch( "GUI:LoadBriefing" ), UIStyle::font( UIStyle::TEXT_SMALL, TRUE ) );Int bottom = m_briefingBox.lo.y + pad + stringHeight( m_briefingHead ) + scaled( 8 );@@ -758,16 +752,8 @@ void LoadScreenBoard::drawCard( const BoardCard &card )const Int y0 = card.box.lo.y;const Int width = card.box.hi.x - x0;const Int height = card.box.hi.y - y0;- UIStyle::panel( x0, y0, width, height, UIStyle::CARD );-- // the side's crest, faint, at the inner end- if( card.watermark )- {- const Int size = height - scaled( 16 );- const Int x = card.mirrored ? x0 + scaled( 24 ) : x0 + width - scaled( 24 ) - size;- TheDisplay->drawImage( card.watermark, x, y0 + ( height - size ) / 2, x + size, y0 + ( height + size ) / 2, GameMakeColor( 255, 255, 255, 30 ) );- }- // the player's colour down the outer edge+ // a lobby seat's row: the panel's black, its blue line, the player's colour down the outer edge+ UIStyle::panel( x0, y0, width, height, UIStyle::PANEL );const Int stripe = UIStyle::stripeWidth();UIStyle::stripe( card.mirrored ? x0 + width - stripe : x0, y0, height, card.color );@@ -852,48 +838,63 @@ void LoadScreenBoard::draw( void )m_tip->setText( tipText( m_tipIndex ) );}- const Int margin = scaled( 64 );- const Int left = m_left + margin;- const Int right = m_left + scaled( BOARD_WIDTH ) - margin;- const Int headerBottom = m_top + scaled( 168 );- const Int footTop = m_top + scaled( 952 );+ const Int panelLeft = m_left + scaled( BOARD_PANEL_LEFT );+ const Int panelTop = m_top + scaled( BOARD_PANEL_TOP );+ const Int panelWidth = scaled( BOARD_PANEL_RIGHT - BOARD_PANEL_LEFT );+ const Int panelBottom = m_top + scaled( BOARD_PANEL_BOTTOM );+ const Int headerLine = m_top + scaled( BOARD_HEADER_LINE );+ const Int left = m_left + scaled( BOARD_INSET );+ const Int right = m_left + scaled( BOARD_PANEL_RIGHT + BOARD_PANEL_LEFT - BOARD_INSET );+ const Int buttonTop = m_top + scaled( BOARD_BUTTON_TOP );+ const Int buttonHeight = scaled( BOARD_BUTTON_BOTTOM - BOARD_BUTTON_TOP );+ const Int rowY = buttonTop - scaled( 24 ) - stringHeight( m_tip );if( m_mission ){- const Color band = UIStyle::withAlpha( UIStyle::GROUND, 224 );- TheDisplay->drawFillRect( 0, 0, m_width, headerBottom, band );- TheDisplay->drawFillRect( 0, footTop, m_width, m_height - footTop, band );+ // the mission's own picture stays; the lobby's panel frames only its header and its foot+ const Int footTop = rowY - scaled( 24 );+ UIStyle::panel( panelLeft, panelTop, panelWidth, headerLine - panelTop, UIStyle::PANEL );+ UIStyle::panel( panelLeft, footTop, panelWidth, panelBottom - footTop, UIStyle::PANEL );drawBriefing();}else{- TheDisplay->drawFillRect( 0, 0, m_width, m_height, UIStyle::GROUND );+ // the shell's still, dimmed as the lobby dims its map, under the lobby's panel+ // (a mod's archives may leave the still out)+ if( m_shell )+ TheDisplay->drawImage( m_shell, 0, 0, m_width, m_height );+ else+ TheDisplay->drawFillRect( 0, 0, m_width, m_height, UIStyle::GROUND );+ TheDisplay->drawFillRect( 0, 0, m_width, m_height, BOARD_SHELL_DIM );+ UIStyle::panel( panelLeft, panelTop, panelWidth, panelBottom - panelTop, UIStyle::PANEL );drawMatch();}- // the header- const Int titleY = m_top + scaled( 52 );- m_title->draw( left, titleY, UIStyle::INK, UIStyle::SHADOW );- m_subtitle->draw( left, titleY + stringHeight( m_title ) + scaled( 4 ), UIStyle::MUTED, UIStyle::SHADOW );- UIStyle::wordmark( m_wordmark, right, titleY + ( stringHeight( m_title ) - stringHeight( m_wordmark[ 0 ] ) ) / 2 );- UIStyle::rule( left, headerBottom, right - left );+ // the header: the title where the lobby's stands, what kind of game after it, the wordmark across+ const Int titleMiddle = m_top + scaled( BOARD_TITLE_MIDDLE );+ const Int titleLeft = m_left + scaled( BOARD_TITLE_LEFT );+ const Int titleY = titleMiddle - stringHeight( m_title ) / 2;+ m_title->draw( titleLeft, titleY, UIStyle::INK, UIStyle::SHADOW );+ m_subtitle->draw( titleLeft + stringWidth( m_title ) + scaled( 32 ), titleY + stringHeight( m_title ) - stringHeight( m_subtitle ),+ UIStyle::MUTED, UIStyle::SHADOW );+ // a mission's picture is the game's own logo art, and the wordmark never stands beside EA's logo+ if( !m_mission )+ UIStyle::wordmark( m_wordmark, right, titleMiddle - stringHeight( m_wordmark[ 0 ] ) / 2 );+ UIStyle::rule( panelLeft, headerLine, panelWidth );- // the foot- const Int barHeight = max( 4, scaled( 8 ) );- const Int barY = m_top + scaled( 1016 );- const Int rowY = barY - scaled( 18 ) - stringHeight( m_tip );- UIStyle::rule( left, footTop, right - left );+ // the foot: a tip over the lobby's button row, whose one wide button fills as the game loadsconst Int chipPad = scaled( 8 );const Int chipHeight = stringHeight( m_tipLabel ) + scaled( 4 );const Int chipY = rowY + ( stringHeight( m_tip ) - chipHeight ) / 2;TheDisplay->drawOpenRect( left, chipY, stringWidth( m_tipLabel ) + 2 * chipPad, chipHeight, 1.0f, UIStyle::FRAME );m_tipLabel->draw( left + chipPad, chipY + scaled( 2 ), UIStyle::ACTIVE, UIStyle::SHADOW );m_tip->draw( left + stringWidth( m_tipLabel ) + 2 * chipPad + scaled( 16 ), rowY, UIStyle::INK, UIStyle::SHADOW );- if( m_network && m_localPercent > 100 )- m_waiting->draw( right - stringWidth( m_waiting ), rowY, UIStyle::MUTED, UIStyle::SHADOW );- else- m_percent->draw( right - stringWidth( m_percent ), rowY + stringHeight( m_tip ) - stringHeight( m_percent ), UIStyle::INK, UIStyle::SHADOW );- TheDisplay->drawFillRect( left, barY, right - left, barHeight, UIStyle::GRID );- TheDisplay->drawFillRect( left, barY, ( right - left ) * min( m_localPercent, 100 ) / 100, barHeight, UIStyle::EDGE );+ UIStyle::button( left, buttonTop, right - left, buttonHeight );+ const Int edge = 3;+ const Int filled = ( right - left - 2 * edge ) * min( m_localPercent, 100 ) / 100;+ TheDisplay->drawFillRect( left + edge, buttonTop + edge, filled, buttonHeight - 2 * edge, UIStyle::withAlpha( UIStyle::EDGE, 110 ) );+ DisplayString *label = m_network && m_localPercent > 100 ? m_waiting : m_percent;+ label->draw( ( left + right - stringWidth( label ) ) / 2, buttonTop + ( buttonHeight - stringHeight( label ) ) / 2,+ UIStyle::INK, UIStyle::SHADOW );}void LoadScreenBoard::drawBriefing( void )@@ -918,13 +919,6 @@ void LoadScreenBoard::drawBriefing( void )void LoadScreenBoard::drawMatch( void ){- for( Int side = 0; side < 2; side++ )- {- const IRegion2D &box = m_backdropBox[ side ];- if( m_backdrop[ side ] )- TheDisplay->drawImage( m_backdrop[ side ], box.lo.x, box.lo.y, box.hi.x, box.hi.y, GameMakeColor( 255, 255, 255, 14 ) );- }-for( Int side = 0; side < 2; side++ ){if( m_columnHead[ side ] == NULL )@@ -943,10 +937,11 @@ void LoadScreenBoard::drawMatch( void )if( m_centerLabel )m_centerLabel->draw( m_centerLabelPos.x, m_centerLabelPos.y, UIStyle::INK, UIStyle::SHADOW );const Int mapSize = m_mapBox.hi.x - m_mapBox.lo.x;- TheDisplay->drawFillRect( m_mapBox.lo.x, m_mapBox.lo.y, mapSize, mapSize, UIStyle::CARD );+ TheDisplay->drawFillRect( m_mapBox.lo.x, m_mapBox.lo.y, mapSize, mapSize, UIStyle::GROUND );if( m_mapImage )TheDisplay->drawImage( m_mapImage, m_mapDrawn.lo.x, m_mapDrawn.lo.y, m_mapDrawn.hi.x, m_mapDrawn.hi.y );- TheDisplay->drawOpenRect( m_mapBox.lo.x - 1, m_mapBox.lo.y - 1, mapSize + 2, mapSize + 2, 1.0f, UIStyle::FRAME );+ // the lobby's map preview wears a button's edge+ UIStyle::edge( m_mapBox.lo.x - 3, m_mapBox.lo.y - 3, mapSize + 6, mapSize + 6 );const Int spot = max( 8, scaled( 18 ) );const Int ring = max( 2, scaled( 3 ) );for( size_t each = 0; each < m_spots.size(); each++ )diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/UIStyle.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/UIStyle.cppindex 9a603793b..8374008ed 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/UIStyle.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/UIStyle.cpp@@ -28,6 +28,7 @@#include "GameClient/DisplayString.h"#include "GameClient/GameFont.h"#include "GameClient/GlobalLanguage.h"+#include "Lib/WideCharFns.h"namespace UIStyle{@@ -79,6 +80,11 @@ void rule( Int x, Int y, Int width )void button( Int x, Int y, Int width, Int height ){TheDisplay->drawFillRect( x, y, width, height, PANEL );+ edge( x, y, width, height );+}++void edge( Int x, Int y, Int width, Int height )+{TheDisplay->drawOpenRect( x, y, width, height, 1.0f, EDGE );TheDisplay->drawOpenRect( x + 1, y + 1, width - 2, height - 2, 1.0f, EDGE_LIT );TheDisplay->drawOpenRect( x + 2, y + 2, width - 4, height - 4, 1.0f, EDGE );@@ -109,6 +115,14 @@ void wordmark( DisplayString *words[ 2 ], Int right, Int y )words[ 1 ]->draw( right - second, y, WORDMARK_BLUE, SHADOW );}+UnicodeString capitals( const UnicodeString &words )+{+ UnicodeString result;+ for( Int each = 0; each < words.getLength(); each++ )+ result.concat( (WideChar)WideCharToUpper( words.getCharAt( each ) ) );+ return result;+}+/** Blue and purple house colours are too dark for words on a panel; they are lifted part of the way* to white, while a stripe, a line or a map spot keeps the colour itself. */Color readable( Color player )