fixed the tab situation

This commit is contained in:
LordSk 2018-10-23 17:55:05 +02:00
parent d9fd61261e
commit 72d96e9e2e
5 changed files with 49 additions and 49 deletions

View file

@ -529,13 +529,13 @@ void CMenus::RenderSkinPartSelection(CUIRect MainView)
} }
Info.m_Size = 50.0f; Info.m_Size = 50.0f;
Item.m_Rect.HSplitTop(5.0f, 0, &Item.m_Rect); // some margin from the top Item.m_Rect.HSplitTop(5.0f, 0, &Item.m_Rect); // some margin from the top
const vec2 TeePos(Item.m_Rect.x+Item.m_Rect.w/2, Item.m_Rect.y+Item.m_Rect.h/2); const vec2 TeePos(Item.m_Rect.x+Item.m_Rect.w/2, Item.m_Rect.y+Item.m_Rect.h/2);
if(m_TeePartSelected == SKINPART_HANDS) if(m_TeePartSelected == SKINPART_HANDS)
{ {
RenderTools()->RenderTeeHand(&Info, TeePos, vec2(1.0f, 0.0f), -pi*0.5f, vec2(18, 0)); RenderTools()->RenderTeeHand(&Info, TeePos, vec2(1.0f, 0.0f), -pi*0.5f, vec2(18, 0));
} }
RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, 0, vec2(1.0f, 0.0f), TeePos); RenderTools()->RenderTee(CAnimState::GetIdle(), &Info, 0, vec2(1.0f, 0.0f), TeePos);
} }
} }
@ -657,7 +657,7 @@ void CMenus::RenderLanguageSelection(CUIRect MainView, bool Header)
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.3f); TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.3f);
} }
else else
UI()->DoLabelScaled(&Item.m_Rect, r.front().m_Name, Item.m_Rect.h*ms_FontmodHeight*0.8f, CUI::ALIGN_LEFT); UI()->DoLabelScaled(&Item.m_Rect, r.front().m_Name, Item.m_Rect.h*ms_FontmodHeight*0.8f, CUI::ALIGN_LEFT);
} }
} }

View file

@ -134,7 +134,7 @@ void CPlayers::RenderHook(
Graphics()->QuadsSetRotation(0); Graphics()->QuadsSetRotation(0);
Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
RenderTools()->RenderTeeHand(&RenderInfo, Position, normalize(HookPos-Pos), -pi/2, vec2(20, 0)); RenderTools()->RenderTeeHand(&RenderInfo, Position, normalize(HookPos-Pos), -pi/2, vec2(20, 0));
} }
} }
@ -418,10 +418,10 @@ void CPlayers::RenderPlayer(
switch (Player.m_Weapon) switch (Player.m_Weapon)
{ {
case WEAPON_GUN: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -3*pi/4, vec2(-15, 4)); break; case WEAPON_GUN: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -3*pi/4, vec2(-15, 4)); break;
case WEAPON_SHOTGUN: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -pi/2, vec2(-5, 4)); break; case WEAPON_SHOTGUN: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -pi/2, vec2(-5, 4)); break;
case WEAPON_GRENADE: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -pi/2, vec2(-4, 7)); break; case WEAPON_GRENADE: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -pi/2, vec2(-4, 7)); break;
} }
} }

View file

@ -7,7 +7,7 @@
class CPlayers : public CComponent class CPlayers : public CComponent
{ {
CTeeRenderInfo m_aRenderInfo[MAX_CLIENTS]; CTeeRenderInfo m_aRenderInfo[MAX_CLIENTS];
void RenderPlayer( void RenderPlayer(
const CNetObj_Character *pPrevChar, const CNetObj_Character *pPrevChar,
const CNetObj_Character *pPlayerChar, const CNetObj_Character *pPlayerChar,
const CNetObj_PlayerInfo *pPrevInfo, const CNetObj_PlayerInfo *pPrevInfo,

View file

@ -477,43 +477,43 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote
} }
void CRenderTools::RenderTeeHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float AngleOffset, void CRenderTools::RenderTeeHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float AngleOffset,
vec2 PostRotOffset) vec2 PostRotOffset)
{ {
// in-game hand size is 15 when tee size is 64 // in-game hand size is 15 when tee size is 64
float BaseSize = 15.0f * (pInfo->m_Size / 64.0f); float BaseSize = 15.0f * (pInfo->m_Size / 64.0f);
vec2 HandPos = CenterPos + Dir; vec2 HandPos = CenterPos + Dir;
float Angle = angle(Dir); float Angle = angle(Dir);
if(Dir.x < 0) if(Dir.x < 0)
Angle -= AngleOffset; Angle -= AngleOffset;
else else
Angle += AngleOffset; Angle += AngleOffset;
vec2 DirX = Dir; vec2 DirX = Dir;
vec2 DirY(-Dir.y,Dir.x); vec2 DirY(-Dir.y,Dir.x);
if(Dir.x < 0) if(Dir.x < 0)
DirY = -DirY; DirY = -DirY;
HandPos += DirX * PostRotOffset.x; HandPos += DirX * PostRotOffset.x;
HandPos += DirY * PostRotOffset.y; HandPos += DirY * PostRotOffset.y;
const vec4 Color = pInfo->m_aColors[SKINPART_HANDS]; const vec4 Color = pInfo->m_aColors[SKINPART_HANDS];
IGraphics::CQuadItem QuadOutline(HandPos.x, HandPos.y, 2*BaseSize, 2*BaseSize); IGraphics::CQuadItem QuadOutline(HandPos.x, HandPos.y, 2*BaseSize, 2*BaseSize);
IGraphics::CQuadItem QuadHand = QuadOutline; IGraphics::CQuadItem QuadHand = QuadOutline;
Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_HANDS]); Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_HANDS]);
Graphics()->QuadsBegin(); Graphics()->QuadsBegin();
Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a); Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a);
Graphics()->QuadsSetRotation(Angle); Graphics()->QuadsSetRotation(Angle);
SelectSprite(SPRITE_TEE_HAND_OUTLINE, 0, 0, 0); SelectSprite(SPRITE_TEE_HAND_OUTLINE, 0, 0, 0);
Graphics()->QuadsDraw(&QuadOutline, 1); Graphics()->QuadsDraw(&QuadOutline, 1);
SelectSprite(SPRITE_TEE_HAND, 0, 0, 0); SelectSprite(SPRITE_TEE_HAND, 0, 0, 0);
Graphics()->QuadsDraw(&QuadHand, 1); Graphics()->QuadsDraw(&QuadHand, 1);
Graphics()->QuadsSetRotation(0); Graphics()->QuadsSetRotation(0);
Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
} }
static void CalcScreenParams(float Amount, float WMax, float HMax, float Aspect, float *w, float *h) static void CalcScreenParams(float Amount, float WMax, float HMax, float Aspect, float *w, float *h)

View file

@ -76,8 +76,8 @@ public:
// object render methods (gc_render_obj.cpp) // object render methods (gc_render_obj.cpp)
void RenderTee(class CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote, vec2 Dir, vec2 Pos); void RenderTee(class CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote, vec2 Dir, vec2 Pos);
void RenderTeeHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float AngleOffset, void RenderTeeHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float AngleOffset,
vec2 PostRotOffset); vec2 PostRotOffset);
// map render methods (gc_render_map.cpp) // map render methods (gc_render_map.cpp)
static void RenderEvalEnvelope(CEnvPoint *pPoints, int NumPoints, int Channels, float Time, float *pResult); static void RenderEvalEnvelope(CEnvPoint *pPoints, int NumPoints, int Channels, float Time, float *pResult);