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.

fix(gameclient): swatches wear the check box art, bold spot numbers

Olcay Seygand7c9a6ce6210
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
index cf4e7a0ea..318e1e767 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
@@ -70,6 +70,7 @@
#include "GameNetwork/GUIUtil.h"
#include "GameClient/Display.h"
#include "GameClient/Image.h"
+#include "GameClient/GameFont.h"
#include "GameNetwork/IPEnumeration.h"
#include "WWDownload/Registry.h"
@@ -915,6 +916,10 @@ static void drawStartSpot( GameWindow *window, WinInstanceData *instData )
TheDisplay->drawImage( TheMappedImageCollection->findImageByName( "ReforgedLobbySpot" ),
x, y, x + width, y + height, fill );
DisplayString *number = instData->getTextDisplayString();
+ // the number in the bold of the button's own face, so it holds up on a bright disc
+ GameFont *font = number->getFont();
+ if ( !font->bold )
+ number->setFont( TheFontLibrary->getFont( font->nameString, font->pointSize, TRUE ) );
Int textWidth, textHeight;
number->getSize( &textWidth, &textHeight );
number->draw( x + (width - textWidth) / 2, y + (height - textHeight) / 2, LobbyTextColorOn( fill ), 0 );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp
index 253a554ae..3f70e622f 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp
@@ -44,6 +44,7 @@
#include "GameClient/GadgetPushButton.h"
#include "GameClient/GameText.h"
#include "GameClient/Display.h"
+#include "GameClient/Image.h"
#include "GameLogic/GameLogic.h" // SUPERWEAPON_RESTRICT_COUNT
#include "GameLogic/AI.h" // AIPersonality, for the personality column
#include "GameNetwork/GameInfo.h"
@@ -915,8 +916,6 @@ static const Color theTeamColors[] =
GameMakeColor(150, 88, 30, 255),
GameMakeColor(0, 128, 128, 255),
};
-// the check boxes' own frame colour, so a swatch reads as one of them
-static const Color theSwatchFrameColor = GameMakeColor(90, 100, 230, 255);
static const Color theSeatEmptyColor = GameMakeColor(48, 54, 76, 255);
static const Color theSeatUnpickedColor = GameMakeColor(128, 128, 128, 255);
static const Color theCardColor = GameMakeColor(8, 12, 26, 200);
@@ -956,16 +955,15 @@ Color LobbyTextColorOn(Color fill)
return blackContrast > whiteContrast ? GameMakeColor(0, 0, 0, 255) : GameMakeColor(255, 255, 255, 255);
}
-// A colour swatch drawn like the rules page's check boxes: their frame, and the colour inside it
-// with a little room between.
+// A colour swatch drawn as one of the rules page's check boxes: their own empty box, and the colour
+// inside its bevel with a little room between.
static void drawSwatch(GameWindow *window, WinInstanceData *instData)
{
Int x, y, width, height;
window->winGetScreenPosition(&x, &y);
window->winGetSize(&width, &height);
- const Int frame = max(1, width / 13);
- const Int padding = frame * 2;
- TheDisplay->drawOpenRect(x, y, width, height, (Real)frame, theSwatchFrameColor);
+ TheDisplay->drawImage(TheMappedImageCollection->findImageByName("Active-Unchecked"), x, y, x + width, y + height);
+ const Int padding = max(2, width / 5);
TheDisplay->drawFillRect(x + padding, y + padding, width - 2 * padding, height - 2 * padding,
window->winGetEnabledColor(0));
}