Skip to content

Commit 91fdbd7

Browse files
committed
- Reworked the obs overlay
1 parent 762d34c commit 91fdbd7

2 files changed

Lines changed: 2027 additions & 1921 deletions

File tree

GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "GameClient/Mouse.h"
4444
#include "GameClient/RadiusDecal.h"
4545
#include "GameClient/View.h"
46+
#include "GameNetwork/NetworkDefs.h"
4647

4748
// FORWARD DECLARATIONS ///////////////////////////////////////////////////////////////////////////
4849
class Drawable;
@@ -568,6 +569,9 @@ friend class Drawable; // for selection/deselection transactions
568569
Bool isCameraTrackingDrawable() const { return m_cameraTrackingDrawable; }
569570
void resetCamera();
570571

572+
void initObserverOverlay();
573+
void cleanupObserverOverlay();
574+
571575
virtual void addIdleWorker( Object *obj );
572576
virtual void removeIdleWorker( Object *obj, Int playerNumber );
573577
virtual void selectNextIdleWorker( void );
@@ -956,6 +960,31 @@ friend class Drawable; // for selection/deselection transactions
956960
Bool m_clientQuiet; ///< When the user clicks exit,restart, etc. this is set true
957961
///< to skip some client sounds/fx during shutdown
958962

963+
// Obs overlay
964+
static const Int numCols = 8;
965+
const wchar_t* headers[numCols] = {
966+
L"(T) Name", L"Army", L"Cash", L"Cash/m", L"(R) XP", L"SP", L"K/D", L"Power"
967+
};
968+
969+
struct ObsOverlayPlayerData
970+
{
971+
bool isPresent = false;
972+
PlayerData playerData;
973+
DisplayString* playerCellStrings[numCols];
974+
};
975+
976+
ObsOverlayPlayerData m_mapOverlayPlayerData[MAX_SLOTS];
977+
978+
UnsignedInt lastUpdateFrame = 0;
979+
Int lastFontSize = -1;
980+
981+
std::vector<DisplayString*> m_headerStrings;
982+
983+
Int colWidths[numCols] = { 0 };
984+
Int totalWidth = 0;
985+
Int totalHeight = 0;
986+
bool isUpdating = false;
987+
959988
// World Animation Data
960989
WorldAnimationList m_worldAnimationList; ///< the list of world animations
961990

0 commit comments

Comments
 (0)