From f3466e05ba6ab82b449467a3d924b55f17b9f79c Mon Sep 17 00:00:00 2001 From: Edgar Date: Sun, 21 Jun 2020 17:48:33 +0200 Subject: [PATCH] Show /spec tees with a dashed skin --- data/skins/x_spec.png | Bin 0 -> 1078 bytes src/game/client/components/ghost.cpp | 2 +- src/game/client/components/nameplates.cpp | 2 +- src/game/client/components/players.cpp | 24 +++++++++++++++++++--- src/game/client/components/players.h | 1 + src/game/client/components/skins.cpp | 2 +- src/game/variables.h | 2 ++ 7 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 data/skins/x_spec.png diff --git a/data/skins/x_spec.png b/data/skins/x_spec.png new file mode 100644 index 0000000000000000000000000000000000000000..a397e8274b470ef9791d2bac01dd10b570a3dcc8 GIT binary patch literal 1078 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58aUX1;_to6&y=0#a;&0ovJocH?o%D=ZR{Oi*UtjQNvE8up{@n(3PGU4zE z2EKHgt^G5sUd2oQf2O)j@qZE5235f+zj=1M^8MLZlJ)-M&dG7f9mPc}Vs~%(c&eHq zT;uSEOODxdKi595UV3V8T-iSM4S|spv_F4bZ#OgF)LsAjU%_A}1}Trid9U@OXMX2D zyND@I&%M@BZ#y^Vj&_-^o96tovDtZR+1yJ%`=k2x3zu5t)qF7UQja?Sv;W@D=M`_o z8?={J%sCgoWJk~UwV5U#Se{LaU-@2s=V$S)f~Rj7DO9knEM@rb%oW|fFgv;C-g1VL zl)o~LSyH?O;ZG|W7c;!L@k{XW!c3C`u}=d88`kNbZmPCl#Um4A8C+n=_2Caw$Q0Mj zKQ9|?=S>aQ)Du3?zwF`x$El&8((gL$p2N0+&Ee>#yni{I2{Z2;+qUq4q3!3apEYx4 zJhTs4vcrdAXR5)0+NB$E#db|~Vrs~HI)Pz9w5AHfi!d%u28hto0JfHOUpEM9nD;UB zoeoQQF{8b4LGn|}pWpB6ZUtFs!^d;CNP(l|%*2EXD`n2d-evfA^v~Y5KGybgKavDq z%vjIX?AQD7vV580kuNWQuFaL0z4XJ^2OGK-&!ukp^!bJ7f+O2?enUUVb^hzSArQ>Wsf%Eflu2 zQ*Z1qIKftu{FC?4YpdTE^mHD?o!U^p_jp}o(eA5vs_m|w-oh-UJ@=#OE6;@Ym!enQ z(SBRQ|A2qVk3G--U7vbgCTUjIp1Q)f_sqUeNtvDetA34p-0Ps{F^rP$Bo%rJCJLZ67S&h6SUQP$r=Aa^A}~uQw(4?YnnD z^VR=$%fxl(&DW@2>_7E-!AgV zJ7Sq6l4iwy32|#}pY*uwxrE+#jwN%~^S(*g`|Innz<9~`hdb#CvapO+t%TmGwleC1LVzr#(LEvd$W1rDh<_SKao-MpsU p@UwB1;hCS{OpcZxv2Y(`{bwkd{_f%{ho#~mX-`)_mvv4FO#p&F`$Yf% literal 0 HcmV?d00001 diff --git a/src/game/client/components/ghost.cpp b/src/game/client/components/ghost.cpp index 2c4595853..874245c24 100644 --- a/src/game/client/components/ghost.cpp +++ b/src/game/client/components/ghost.cpp @@ -340,7 +340,7 @@ void CGhost::OnRender() Player.m_AttackTick += Client()->GameTick(g_Config.m_ClDummy) - GhostTick; m_pClient->m_pPlayers->RenderHook(&Prev, &Player, &pGhost->m_RenderInfo , -2, IntraTick); - m_pClient->m_pPlayers->RenderPlayer(&Prev, &Player, &pGhost->m_RenderInfo, -2, IntraTick); + m_pClient->m_pPlayers->RenderPlayer(&Prev, &Player, &pGhost->m_RenderInfo, -2, true, IntraTick); } } diff --git a/src/game/client/components/nameplates.cpp b/src/game/client/components/nameplates.cpp index d54bac789..4967a743d 100644 --- a/src/game/client/components/nameplates.cpp +++ b/src/game/client/components/nameplates.cpp @@ -159,7 +159,7 @@ void CNamePlates::OnRender() for(int i = 0; i < MAX_CLIENTS; i++) { // only render active characters - if(!m_pClient->m_Snap.m_aCharacters[i].m_Active) + if(!m_pClient->m_Snap.m_aCharacters[i].m_Active && !g_Config.m_ClShowSpecTee) continue; const void *pInfo = Client()->SnapFindItem(IClient::SNAP_CURRENT, NETOBJTYPE_PLAYERINFO, i); diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 5a369dc94..3da9527af 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -164,6 +164,7 @@ void CPlayers::RenderPlayer( const CNetObj_Character *pPlayerChar, const CTeeRenderInfo *pRenderInfo, int ClientID, + bool Active, float Intra ) { @@ -278,6 +279,7 @@ void CPlayers::RenderPlayer( } // draw gun + if(Active) { #if defined(CONF_VIDEORECORDER) if(ClientID >= 0 && ((GameClient()->m_GameInfo.m_AllowHookColl && g_Config.m_ClShowHookCollAlways) || (Player.m_PlayerFlags&PLAYERFLAG_AIM && ((!Local && ((!IVideo::Current()&&g_Config.m_ClShowHookCollOther)||(IVideo::Current()&&g_Config.m_ClVideoShowHookCollOther))) || (Local && g_Config.m_ClShowHookCollOwn))))) @@ -657,7 +659,7 @@ void CPlayers::OnRender() for(int i = 0; i < MAX_CLIENTS; i++) { // only render active characters - if(!m_pClient->m_Snap.m_aCharacters[i].m_Active) + if(!m_pClient->m_Snap.m_aCharacters[i].m_Active && !g_Config.m_ClShowSpecTee) continue; const void *pPrevInfo = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_PLAYERINFO, i); @@ -665,7 +667,6 @@ void CPlayers::OnRender() if(pPrevInfo && pInfo) { - // bool Local = m_pClient->m_Snap.m_LocalClientID == i; if((p % 2) == 0 && Local) continue; if((p % 2) == 1 && !Local) continue; @@ -673,6 +674,22 @@ void CPlayers::OnRender() CNetObj_Character PrevChar = m_pClient->m_aClients[i].m_RenderPrev; CNetObj_Character CurChar = m_pClient->m_aClients[i].m_RenderCur; + if(!m_pClient->m_Snap.m_aCharacters[i].m_Active) + { + int Skin = m_pClient->m_pSkins->Find("x_spec"); + if(Skin != -1) + { + if(IsTeamplay) + m_aRenderInfo[i].m_Texture = m_pClient->m_pSkins->Get(Skin)->m_ColorTexture; + else + { + m_aRenderInfo[i].m_Texture = m_pClient->m_pSkins->Get(Skin)->m_OrgTexture; + m_aRenderInfo[i].m_ColorBody = ColorRGBA(1,1,1); + m_aRenderInfo[i].m_ColorFeet = ColorRGBA(1,1,1); + } + } + } + if(p<2) { RenderHook( @@ -688,7 +705,8 @@ void CPlayers::OnRender() &PrevChar, &CurChar, &m_aRenderInfo[i], - i + i, + m_pClient->m_Snap.m_aCharacters[i].m_Active ); } } diff --git a/src/game/client/components/players.h b/src/game/client/components/players.h index 4a73e4f12..a7c159671 100644 --- a/src/game/client/components/players.h +++ b/src/game/client/components/players.h @@ -15,6 +15,7 @@ class CPlayers : public CComponent const CNetObj_Character *pPlayerChar, const CTeeRenderInfo *pRenderInfo, int ClientID, + bool Active, float Intra = 0.f ); void RenderHook( diff --git a/src/game/client/components/skins.cpp b/src/game/client/components/skins.cpp index fb8265776..9723cd9f2 100644 --- a/src/game/client/components/skins.cpp +++ b/src/game/client/components/skins.cpp @@ -15,7 +15,7 @@ static const char *VANILLA_SKINS[] = {"bluekitty", "bluestripe", "brownbear", "cammo", "cammostripes", "coala", "default", "limekitty", "pinky", "redbopp", "redstripe", "saddo", "toptri", - "twinbop", "twintri", "warpaint", "x_ninja"}; + "twinbop", "twintri", "warpaint", "x_ninja", "x_spec"}; static bool IsVanillaSkin(const char *pName) { diff --git a/src/game/variables.h b/src/game/variables.h index a8f9840f1..a5e88a111 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -90,6 +90,8 @@ MACRO_CONFIG_STR(ClPlayerSkin, player_skin, 24, "default", CFGFLAG_CLIENT|CFGFLA MACRO_CONFIG_STR(ClSkinPrefix, cl_skin_prefix, 100, "", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Replace the skins by skins with this prefix (e.g. kitty, coala, santa)") MACRO_CONFIG_INT(ClFatSkins, cl_fat_skins, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable fat skins") +MACRO_CONFIG_INT(ClShowSpecTee, cl_show_spec_tee, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Whether to show a tee in /spec with a dashed skin.") + MACRO_CONFIG_INT(UiPage, ui_page, 9, 0, 12, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface page") MACRO_CONFIG_INT(UiSettingsPage, ui_settings_page, 0, 0, 8, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface settings page") MACRO_CONFIG_INT(UiToolboxPage, ui_toolbox_page, 0, 0, 2, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Toolbox page")