Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions game/neo/resource/ClientScheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,78 @@ Scheme
//"additive" "1"
}
}
NeoUIScoreboard
{
"1"
{
"name" "Montserrat Bold"
"tall" "14"
"weight" "550"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "480 599"
//"additive" "1"
}
"2"
{
"name" "Montserrat Bold"
"tall" "16"
"weight" "550"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "600 767"
//"additive" "1"
}
"3"
{
"name" "Montserrat Bold"
"tall" "18"
"weight" "550"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "768 1023"
"antialias" "1"
//"additive" "1"
}
"4"
{
"name" "Montserrat Bold"
"tall" "20"
"weight" "550"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "1024 1199"
"antialias" "1"
//"additive" "1"
}
"5"
{
"name" "Montserrat Bold"
"tall" "22"
"weight" "550"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "1200 1440"
"antialias" "1"
//"additive" "1"
}
"6"
{
"name" "Montserrat Bold"
"tall" "26"
"weight" "550"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "1441 1599"
"antialias" "1"
//"additive" "1"
}
"7"
{
"name" "Montserrat Bold"
"tall" "28"
"weight" "550"
"range" "0x0000 0x017F" // Basic Latin, Latin-1 Supplement, Latin Extended-A
"yres" "1600 6000"
"antialias" "1"
//"additive" "1"
}
}

NeoUISmall
{
"1"
Expand Down Expand Up @@ -3206,6 +3278,7 @@ Scheme
"13" "resource/neotokyo_press_n.ttf"
"14" "resource/killfeedicons.ttf"
"15" "resource/montserrat-regular.ttf"
"16" "resource/montserrat-bold.ttf"
}

}
2 changes: 2 additions & 0 deletions src/game/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,8 @@ target_sources_grouped(
neo/ui/neo_hud_worldpos_marker_generic.h
neo/ui/neo_scoreboard.cpp
neo/ui/neo_scoreboard.h
neo/ui/neoui_scoreboard.cpp
neo/ui/neoui_scoreboard.h
neo/ui/neo_hud_context_hint.cpp
neo/ui/neo_hud_context_hint.h
)
Expand Down
16 changes: 16 additions & 0 deletions src/game/client/c_playerresource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ IMPLEMENT_CLIENTCLASS_DT_NOBASE(C_PlayerResource, DT_PlayerResource, CPlayerReso
RecvPropArray3(RECVINFO_ARRAY(m_iStar), RecvPropInt(RECVINFO(m_iStar[0]))),
RecvPropArray3(RECVINFO_ARRAY(m_szNeoClantag), RecvPropString(RECVINFO(m_szNeoClantag[0]))),
RecvPropArray3(RECVINFO_ARRAY(m_iMaxHealth), RecvPropInt(RECVINFO(m_iMaxHealth[0]))),
RecvPropArray3(RECVINFO_ARRAY(m_szNeoCrosshair), RecvPropString(RECVINFO(m_szNeoCrosshair[0]))),
RecvPropArray3(RECVINFO_ARRAY(m_bReady), RecvPropInt(RECVINFO(m_bReady[0]))),
#endif
RecvPropArray3( RECVINFO_ARRAY(m_iScore), RecvPropInt( RECVINFO(m_iScore[0]))),
RecvPropArray3( RECVINFO_ARRAY(m_iDeaths), RecvPropInt( RECVINFO(m_iDeaths[0]))),
Expand All @@ -57,6 +59,8 @@ BEGIN_PREDICTION_DATA( C_PlayerResource )
DEFINE_PRED_ARRAY(m_iStar, FIELD_INTEGER, MAX_PLAYERS_ARRAY_SAFE, FTYPEDESC_PRIVATE),
DEFINE_PRED_ARRAY(m_szNeoClantag, FIELD_STRING, MAX_PLAYERS_ARRAY_SAFE, FTYPEDESC_PRIVATE),
DEFINE_PRED_ARRAY(m_iMaxHealth, FIELD_INTEGER, MAX_PLAYERS_ARRAY_SAFE, FTYPEDESC_PRIVATE),
DEFINE_PRED_ARRAY(m_szNeoCrosshair, FIELD_STRING, MAX_PLAYERS_ARRAY_SAFE, FTYPEDESC_PRIVATE),
DEFINE_PRED_ARRAY(m_bReady, FIELD_BOOLEAN, MAX_PLAYERS_ARRAY_SAFE, FTYPEDESC_PRIVATE),
#endif
DEFINE_PRED_ARRAY( m_iScore, FIELD_INTEGER, MAX_PLAYERS_ARRAY_SAFE, FTYPEDESC_PRIVATE ),
DEFINE_PRED_ARRAY( m_iDeaths, FIELD_INTEGER, MAX_PLAYERS_ARRAY_SAFE, FTYPEDESC_PRIVATE ),
Expand Down Expand Up @@ -94,6 +98,8 @@ C_PlayerResource::C_PlayerResource()
memset(m_iStar, 0, sizeof(m_iStar));
memset(m_szNeoClantag, 0, sizeof(m_szNeoClantag));
memset(m_iMaxHealth, 1, sizeof(m_iMaxHealth));
memset(m_szNeoCrosshair, 0, sizeof(m_szNeoCrosshair));
memset(m_bReady, 0, sizeof(m_bReady));
#endif
memset( m_iScore, 0, sizeof( m_iScore ) );
memset( m_iDeaths, 0, sizeof( m_iDeaths ) );
Expand Down Expand Up @@ -250,6 +256,16 @@ const char *C_PlayerResource::GetClanTag(int iIndex)
{
return m_szNeoClantag[iIndex];
}

const char *C_PlayerResource::GetNeoCrosshair(int iIndex)
{
return m_szNeoCrosshair[iIndex];
}

bool C_PlayerResource::IsReady(int iIndex)
{
return m_bReady[iIndex];
}
#endif

bool C_PlayerResource::IsAlive(int iIndex )
Expand Down
5 changes: 5 additions & 0 deletions src/game/client/c_playerresource.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#ifdef NEO
#include "neo_player_shared.h"
#include "neo_crosshair.h"
#endif

#define PLAYER_UNCONNECTED_NAME "unconnected"
Expand Down Expand Up @@ -61,6 +62,8 @@ public : // IGameResources interface
const char *GetClanTag(int index);
virtual int GetMaxHealth(int index);
virtual int GetDisplayedHealth(int index, int mode);
const char *GetNeoCrosshair(int index);
bool IsReady(int index);
#endif
virtual int GetFrags( int index );
virtual int GetHealth( int index );
Expand Down Expand Up @@ -89,6 +92,8 @@ public : // IGameResources interface
int m_iStar[MAX_PLAYERS_ARRAY_SAFE];
char m_szNeoClantag[MAX_PLAYERS_ARRAY_SAFE][NEO_MAX_CLANTAG_LENGTH];
int m_iMaxHealth[MAX_PLAYERS_ARRAY_SAFE];
char m_szNeoCrosshair[MAX_PLAYERS_ARRAY_SAFE][NEO_XHAIR_SEQMAX];
bool m_bReady[MAX_PLAYERS_ARRAY_SAFE];
#endif
int m_iScore[MAX_PLAYERS_ARRAY_SAFE];
int m_iDeaths[MAX_PLAYERS_ARRAY_SAFE];
Expand Down
12 changes: 12 additions & 0 deletions src/game/client/clientmode_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ extern ConVar replay_rendersetting_renderglow;
#include <GameUI/IGameUI.h>
#include "ui/neo_loading.h"
#include "neo_gamerules.h"
#include "ui/neoui_scoreboard.h"
#endif

#ifdef GLOWS_ENABLE
Expand Down Expand Up @@ -782,6 +783,17 @@ int ClientModeShared::KeyInput( int down, ButtonCode_t keynum, const char *pszCu
}
#endif

#ifdef NEO
// Scoreboard right-click mouse capture, higher precedence than spectator
// mouse clicks
if (gViewPortInterface && g_pNeoUIScoreBoard && g_pNeoUIScoreBoard->IsVisible()
&& down && MOUSE_RIGHT == keynum && false == g_pNeoUIScoreBoard->IsMouseInputEnabled())
{
g_pNeoUIScoreBoard->ToggleMouseCapture(true);
return 0;
}
#endif // NEO

C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();

// if ingame spectator mode, let spectator input intercept key event here
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/hl2mp/clientmode_hl2mpnormal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#ifdef NEO
#include "prediction.h"
#include "neo/ui/neo_scoreboard.h"
#include "neo/ui/neoui_scoreboard.h"
extern ConVar v_viewmodel_fov;
#else
#include "hl2mpclientscoreboard.h"
Expand Down Expand Up @@ -94,7 +94,7 @@ IViewPortPanel* CHudViewport::CreatePanelByName(const char *szPanelName)
if (Q_strcmp(PANEL_SCOREBOARD, szPanelName) == 0)
{
#ifdef NEO
newpanel = new CNEOScoreBoard(this);
newpanel = new CNEOUIScoreBoard(this);
#else
newpanel = new CHL2MPClientScoreBoardDialog( this );
#endif
Expand Down
16 changes: 16 additions & 0 deletions src/game/client/in_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ extern ConVar cam_idealyaw;
// Need this for steam controller
#include "clientsteamcontext.h"

#ifdef NEO
#include "ui/neoui_scoreboard.h"
#endif // NEO

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

Expand Down Expand Up @@ -764,6 +768,12 @@ void IN_ScoreDown( const CCommand &args )
KeyDown( &in_score, args[1] );
if ( gViewPortInterface )
{
#ifdef NEO
if (g_pNeoUIScoreBoard)
{
g_pNeoUIScoreBoard->ToggleMouseCapture(false);
}
#endif // NEO
gViewPortInterface->ShowPanel( PANEL_SCOREBOARD, true );
}
}
Expand All @@ -773,6 +783,12 @@ void IN_ScoreUp( const CCommand &args )
KeyUp( &in_score, args[1] );
if ( gViewPortInterface )
{
#ifdef NEO
if (g_pNeoUIScoreBoard)
{
g_pNeoUIScoreBoard->ToggleMouseCapture(false);
}
#endif // NEO
gViewPortInterface->ShowPanel( PANEL_SCOREBOARD, false );
GetClientVoiceMgr()->StopSquelchMode();
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/neo/ui/neo_hud_deathnotice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "spectatorgui.h"
#include "takedamageinfo.h"
#include "c_neo_killer_damage_infos.h"
#include "neo_scoreboard.h"
#include "neoui_scoreboard.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
Expand Down Expand Up @@ -227,7 +227,7 @@ void CNEOHud_DeathNotice::VidInit( void )
//-----------------------------------------------------------------------------
bool CNEOHud_DeathNotice::ShouldDraw( void )
{
return ( CHudElement::ShouldDraw() && ( m_DeathNotices.Count() ) && ( !cl_neo_hud_scoreboard_hide_others.GetBool() || !g_pNeoScoreBoard->IsVisible() ) );
return ( CHudElement::ShouldDraw() && ( m_DeathNotices.Count() ) && ( !cl_neo_hud_scoreboard_hide_others.GetBool() || !g_pNeoUIScoreBoard->IsVisible() ) );
}

//-----------------------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions src/game/client/neo/ui/neo_hud_round_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "c_team.h"
#include "c_playerresource.h"
#include "vgui_avatarimage.h"
#include "neo_scoreboard.h"
#include "neoui_scoreboard.h"

#include "hltvcamera.h"

Expand All @@ -34,7 +34,7 @@ NEO_HUD_ELEMENT_DECLARE_FREQ_CVAR(RoundState, 0.1)

ConVar cl_neo_hud_team_swap_sides("cl_neo_hud_team_swap_sides", "1", FCVAR_ARCHIVE, "Make the team of the local player always appear on the left side of the round info and scoreboard", true, 0.0, true, 1.0,
[]([[maybe_unused]] IConVar* var, [[maybe_unused]] const char* pOldValue, [[maybe_unused]] float flOldValue) {
g_pNeoScoreBoard->UpdateTeamColumnsPosition(GetLocalPlayerTeam());
// TODO REMOVE? g_pNeoUIScoreBoard->UpdateTeamColumnsPosition(GetLocalPlayerTeam());
});
ConVar cl_neo_squad_hud_original("cl_neo_squad_hud_original", "1", FCVAR_ARCHIVE, "Use the old squad HUD", true, 0.0, true, 1.0);
ConVar cl_neo_squad_hud_star_scale("cl_neo_squad_hud_star_scale", "0", FCVAR_ARCHIVE, "Scaling to apply from 1080p, 0 disables scaling",
Expand Down Expand Up @@ -283,7 +283,7 @@ void CNEOHud_RoundState::UpdateStateForNeoHudElementDraw()
{
m_pWszStatusUnicode = L"Match point";
}
else if (NEORules()->GetRoundStatus() != NeoRoundStatus::Pause && (NEORules()->IsRoundPreRoundFreeze() || g_pNeoScoreBoard->IsVisible()))
else if (NEORules()->GetRoundStatus() != NeoRoundStatus::Pause && (NEORules()->IsRoundPreRoundFreeze() || g_pNeoUIScoreBoard->IsVisible()))
{
// Update Objective
switch (NEORules()->GetGameType()) {
Expand Down Expand Up @@ -734,7 +734,7 @@ void CNEOHud_RoundState::DrawPlayerList()
offset *= cl_neo_squad_hud_star_scale.GetFloat() * res.h / 1080.0f;
}

const bool hideDueToScoreboard = cl_neo_hud_scoreboard_hide_others.GetBool() && g_pNeoScoreBoard->IsVisible();
const bool hideDueToScoreboard = cl_neo_hud_scoreboard_hide_others.GetBool() && g_pNeoUIScoreBoard->IsVisible();

// Draw squad mates
if (!localPlayerSpec && g_PR->GetStar(localPlayerIndex) != STAR_NONE && !hideDueToScoreboard)
Expand Down Expand Up @@ -836,7 +836,7 @@ void CNEOHud_RoundState::DrawPlayerList_BotCmdr()
offset *= cl_neo_squad_hud_star_scale.GetFloat() * res.h / 1080.0f;
}

const bool hideDueToScoreboard = cl_neo_hud_scoreboard_hide_others.GetBool() && g_pNeoScoreBoard->IsVisible();
const bool hideDueToScoreboard = cl_neo_hud_scoreboard_hide_others.GetBool() && g_pNeoUIScoreBoard->IsVisible();

// Draw squad mates
m_commandedList.RemoveAll();
Expand Down Expand Up @@ -1249,7 +1249,7 @@ void CNEOHud_RoundState::CheckActiveStar()

void CNEOHud_RoundState::SetTextureToAvatar(int playerIndex)
{
if (!g_pNeoScoreBoard)
if (!g_pNeoUIScoreBoard)
{
return;
}
Expand All @@ -1267,11 +1267,11 @@ void CNEOHud_RoundState::SetTextureToAvatar(int playerIndex)
return;

CSteamID steamIDForPlayer(pi.friendsID, 1, steamapicontext->SteamUtils()->GetConnectedUniverse(), k_EAccountTypeIndividual);
const int mapIndex = g_pNeoScoreBoard->m_mapAvatarsToImageList.Find(steamIDForPlayer);
if ((mapIndex == g_pNeoScoreBoard->m_mapAvatarsToImageList.InvalidIndex()))
const int mapIndex = g_pNeoUIScoreBoard->m_mapAvatarsToImageList.Find(steamIDForPlayer);
if ((mapIndex == g_pNeoUIScoreBoard->m_mapAvatarsToImageList.InvalidIndex()))
return;

CAvatarImage* pAvIm = (CAvatarImage*)g_pNeoScoreBoard->m_pImageList->GetImage(g_pNeoScoreBoard->m_mapAvatarsToImageList[mapIndex]);
CAvatarImage* pAvIm = (CAvatarImage*)g_pNeoUIScoreBoard->m_pImageList->GetImage(g_pNeoUIScoreBoard->m_mapAvatarsToImageList[mapIndex].i32Idx);
surface()->DrawSetTexture(pAvIm->getTextureID());
surface()->DrawSetColor(COLOR_WHITE);
}
Expand Down Expand Up @@ -1544,4 +1544,4 @@ CON_COMMAND_F( spectate_player_selected_in_hud, "Spectate entity selected in the
{
engine->IsHLTV() ? HLTVCamera()->SetPrimaryTarget(entityIndex) : engine->ClientCmd(VarArgs("spec_player_entity_number %d", entityIndex));
}
}
}
Loading
Loading