mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #6904 from sjrc6/pr-use-local-inputs
Use local inputs for direction arrows and aim line toggle
This commit is contained in:
commit
b528dcd4fe
|
@ -58,18 +58,29 @@ void CNamePlates::RenderNameplatePos(vec2 Position, const CNetObj_PlayerInfo *pP
|
|||
YOffset -= ShowDirectionImgSize;
|
||||
vec2 ShowDirectionPos = vec2(Position.x - 11.0f, YOffset);
|
||||
|
||||
if(m_pClient->m_Snap.m_aCharacters[pPlayerInfo->m_ClientID].m_Cur.m_Direction == -1)
|
||||
bool DirLeft = m_pClient->m_Snap.m_aCharacters[pPlayerInfo->m_ClientID].m_Cur.m_Direction == -1;
|
||||
bool DirRight = m_pClient->m_Snap.m_aCharacters[pPlayerInfo->m_ClientID].m_Cur.m_Direction == 1;
|
||||
bool Jump = m_pClient->m_Snap.m_aCharacters[pPlayerInfo->m_ClientID].m_Cur.m_Jumped & 1;
|
||||
|
||||
if(pPlayerInfo->m_Local && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
{
|
||||
DirLeft = m_pClient->m_Controls.m_aInputData[g_Config.m_ClDummy].m_Direction == -1;
|
||||
DirRight = m_pClient->m_Controls.m_aInputData[g_Config.m_ClDummy].m_Direction == 1;
|
||||
Jump = m_pClient->m_Controls.m_aInputData[g_Config.m_ClDummy].m_Jump == 1;
|
||||
}
|
||||
|
||||
if(DirLeft)
|
||||
{
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id);
|
||||
Graphics()->QuadsSetRotation(pi);
|
||||
Graphics()->RenderQuadContainerAsSprite(m_DirectionQuadContainerIndex, 0, ShowDirectionPos.x - 30.f, ShowDirectionPos.y);
|
||||
}
|
||||
else if(m_pClient->m_Snap.m_aCharacters[pPlayerInfo->m_ClientID].m_Cur.m_Direction == 1)
|
||||
else if(DirRight)
|
||||
{
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id);
|
||||
Graphics()->RenderQuadContainerAsSprite(m_DirectionQuadContainerIndex, 0, ShowDirectionPos.x + 30.f, ShowDirectionPos.y);
|
||||
}
|
||||
if(m_pClient->m_Snap.m_aCharacters[pPlayerInfo->m_ClientID].m_Cur.m_Jumped & 1)
|
||||
if(Jump)
|
||||
{
|
||||
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_ARROW].m_Id);
|
||||
Graphics()->QuadsSetRotation(pi * 3 / 2);
|
||||
|
|
|
@ -156,6 +156,9 @@ void CPlayers::RenderHookCollLine(
|
|||
{
|
||||
bool AlwaysRenderHookColl = GameClient()->m_GameInfo.m_AllowHookColl && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) == 2;
|
||||
bool RenderHookCollPlayer = ClientID >= 0 && Player.m_PlayerFlags & PLAYERFLAG_AIM && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) > 0;
|
||||
if(Local && GameClient()->m_GameInfo.m_AllowHookColl && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
RenderHookCollPlayer = GameClient()->m_Controls.m_aShowHookColl[g_Config.m_ClDummy] && g_Config.m_ClShowHookCollOwn > 0;
|
||||
|
||||
bool RenderHookCollVideo = true;
|
||||
#if defined(CONF_VIDEORECORDER)
|
||||
RenderHookCollVideo = !IVideo::Current() || g_Config.m_ClVideoShowHookCollOther || Local;
|
||||
|
|
Loading…
Reference in a new issue