Merge remote-tracking branch 'edg-l/pr_show_spec'

Update x_spec with the more minimal version by HiRavie
Fix CMakeLists.txt
This commit is contained in:
def 2020-06-24 09:55:17 +02:00
commit f51a443998
8 changed files with 34 additions and 10 deletions

View file

@ -1294,6 +1294,7 @@ set(EXPECTED_DATA
skins/wartee.png
skins/whis.png
skins/x_ninja.png
skins/x_spec.png
wordlist.txt
)

BIN
data/skins/x_spec.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

View file

@ -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, false, IntraTick);
}
}

View file

@ -114,8 +114,16 @@ void CNamePlates::RenderNameplate(
}
else
{
TOutlineColor.Set(0.0f, 0.0f, 0.0f, 0.5f*a);
TColor.Set(rgb.r, rgb.g, rgb.b, a);
if(m_pClient->m_aClients[ClientID].m_Spec)
{
TOutlineColor.Set(0.0f, 0.0f, 0.0f, 0.2f * g_Config.m_ClShowOthersAlpha / 100.0f);
TColor.Set(rgb.r, rgb.g, rgb.b, g_Config.m_ClShowOthersAlpha / 100.0f);
}
else
{
TOutlineColor.Set(0.0f, 0.0f, 0.0f, 0.5f*a);
TColor.Set(rgb.r, rgb.g, rgb.b, a);
}
}
if(g_Config.m_ClNameplatesTeamcolors && m_pClient->m_Snap.m_pGameInfoObj && m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_TEAMS)
{
@ -159,7 +167,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 && (!m_pClient->m_aClients[i].m_Spec || !g_Config.m_ClShowSpecTee))
continue;
const void *pInfo = Client()->SnapFindItem(IClient::SNAP_CURRENT, NETOBJTYPE_PLAYERINFO, i);

View file

@ -164,6 +164,7 @@ void CPlayers::RenderPlayer(
const CNetObj_Character *pPlayerChar,
const CTeeRenderInfo *pRenderInfo,
int ClientID,
bool Spec,
float Intra
)
{
@ -176,7 +177,7 @@ void CPlayers::RenderPlayer(
bool Local = m_pClient->m_Snap.m_LocalClientID == ClientID;
bool OtherTeam = m_pClient->IsOtherTeam(ClientID);
float Alpha = OtherTeam ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f;
float Alpha = (OtherTeam || Spec) ? g_Config.m_ClShowOthersAlpha / 100.0f : 1.0f;
// set size
RenderInfo.m_Size = 64.0f;
@ -278,6 +279,7 @@ void CPlayers::RenderPlayer(
}
// draw gun
if(!Spec)
{
#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)))))
@ -559,7 +561,7 @@ void CPlayers::RenderPlayer(
Graphics()->QuadsSetRotation(0);
}
if(OtherTeam || ClientID < 0)
if(OtherTeam || Spec || ClientID < 0)
RenderTools()->RenderTee(&State, &RenderInfo, Player.m_Emote, Direction, Position, g_Config.m_ClShowOthersAlpha / 100.0f);
else
RenderTools()->RenderTee(&State, &RenderInfo, Player.m_Emote, Direction, Position);
@ -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 && (!m_pClient->m_aClients[i].m_Spec || !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,16 @@ 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_aClients[i].m_Spec)
{
int Skin = m_pClient->m_pSkins->Find("x_spec");
if(Skin != -1)
{
m_aRenderInfo[i].m_Texture = m_pClient->m_pSkins->Get(Skin)->m_ColorTexture;
}
}
if(p<2)
{
RenderHook(
@ -688,7 +699,8 @@ void CPlayers::OnRender()
&PrevChar,
&CurChar,
&m_aRenderInfo[i],
i
i,
m_pClient->m_aClients[i].m_Spec
);
}
}

View file

@ -15,6 +15,7 @@ class CPlayers : public CComponent
const CNetObj_Character *pPlayerChar,
const CTeeRenderInfo *pRenderInfo,
int ClientID,
bool Spec,
float Intra = 0.f
);
void RenderHook(

View file

@ -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)
{

View file

@ -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")