mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed the tab situation
This commit is contained in:
parent
d9fd61261e
commit
72d96e9e2e
|
@ -82,7 +82,7 @@ void CMenus::SaveSkinfile()
|
|||
{
|
||||
if(!CSkins::ms_apSkinVariables[PartIndex][0])
|
||||
continue;
|
||||
|
||||
|
||||
// part start
|
||||
if(Count == 0)
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ void CMenus::SaveSkinfile()
|
|||
}
|
||||
else
|
||||
{
|
||||
p = ",\n";
|
||||
p = ",\n";
|
||||
io_write(File, p, str_length(p));
|
||||
}
|
||||
str_format(aBuf, sizeof(aBuf), "\t\"%s\": {\n", CSkins::ms_apSkinPartNames[PartIndex]);
|
||||
|
@ -529,13 +529,13 @@ void CMenus::RenderSkinPartSelection(CUIRect MainView)
|
|||
}
|
||||
Info.m_Size = 50.0f;
|
||||
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)
|
||||
{
|
||||
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);
|
||||
if(m_TeePartSelected == SKINPART_HANDS)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -657,7 +657,7 @@ void CMenus::RenderLanguageSelection(CUIRect MainView, bool Header)
|
|||
TextRender()->TextOutlineColor(0.0f, 0.0f, 0.0f, 0.3f);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ void CPlayers::RenderHook(
|
|||
Graphics()->QuadsSetRotation(0);
|
||||
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)
|
||||
{
|
||||
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_GRENADE: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -pi/2, vec2(-4, 7)); 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_GRENADE: RenderTools()->RenderTeeHand(&RenderInfo, p, Direction, -pi/2, vec2(-4, 7)); break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class CPlayers : public CComponent
|
||||
{
|
||||
CTeeRenderInfo m_aRenderInfo[MAX_CLIENTS];
|
||||
void RenderPlayer(
|
||||
void RenderPlayer(
|
||||
const CNetObj_Character *pPrevChar,
|
||||
const CNetObj_Character *pPlayerChar,
|
||||
const CNetObj_PlayerInfo *pPrevInfo,
|
||||
|
|
|
@ -116,14 +116,14 @@ void CRenderTools::DrawRoundRectExt(float x, float y, float w, float h, float r,
|
|||
x+(1-Ca1)*r, y-r+Sa1*r,
|
||||
x+(1-Ca3)*r, y-r+Sa3*r,
|
||||
x+(1-Ca2)*r, y-r+Sa2*r);
|
||||
|
||||
|
||||
if(Corners&32) // ITR
|
||||
ArrayF[NumItems++] = IGraphics::CFreeformItem(
|
||||
x+w, y,
|
||||
x+w-r+Ca1*r, y-r+Sa1*r,
|
||||
x+w-r+Ca3*r, y-r+Sa3*r,
|
||||
x+w-r+Ca2*r, y-r+Sa2*r);
|
||||
|
||||
|
||||
if(Corners&64) // IBL
|
||||
ArrayF[NumItems++] = IGraphics::CFreeformItem(
|
||||
x, y+h,
|
||||
|
@ -225,7 +225,7 @@ void CRenderTools::DrawRoundRectExt4(float x, float y, float w, float h, vec4 Co
|
|||
x+(1-Ca2)*r, y-r+Sa2*r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
|
||||
if(Corners&32) // ITR
|
||||
{
|
||||
Graphics()->SetColor(ColorTopRight.r, ColorTopRight.g, ColorTopRight.b, ColorTopRight.a);
|
||||
|
@ -236,7 +236,7 @@ void CRenderTools::DrawRoundRectExt4(float x, float y, float w, float h, vec4 Co
|
|||
x+w-r+Ca2*r, y-r+Sa2*r);
|
||||
Graphics()->QuadsDrawFreeform(&ItemF, 1);
|
||||
}
|
||||
|
||||
|
||||
if(Corners&64) // IBL
|
||||
{
|
||||
Graphics()->SetColor(ColorBottomLeft.r, ColorBottomLeft.g, ColorBottomLeft.b, ColorBottomLeft.a);
|
||||
|
@ -477,43 +477,43 @@ void CRenderTools::RenderTee(CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote
|
|||
}
|
||||
|
||||
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
|
||||
float BaseSize = 15.0f * (pInfo->m_Size / 64.0f);
|
||||
// in-game hand size is 15 when tee size is 64
|
||||
float BaseSize = 15.0f * (pInfo->m_Size / 64.0f);
|
||||
|
||||
vec2 HandPos = CenterPos + Dir;
|
||||
float Angle = angle(Dir);
|
||||
if(Dir.x < 0)
|
||||
Angle -= AngleOffset;
|
||||
else
|
||||
Angle += AngleOffset;
|
||||
vec2 HandPos = CenterPos + Dir;
|
||||
float Angle = angle(Dir);
|
||||
if(Dir.x < 0)
|
||||
Angle -= AngleOffset;
|
||||
else
|
||||
Angle += AngleOffset;
|
||||
|
||||
vec2 DirX = Dir;
|
||||
vec2 DirY(-Dir.y,Dir.x);
|
||||
vec2 DirX = Dir;
|
||||
vec2 DirY(-Dir.y,Dir.x);
|
||||
|
||||
if(Dir.x < 0)
|
||||
DirY = -DirY;
|
||||
if(Dir.x < 0)
|
||||
DirY = -DirY;
|
||||
|
||||
HandPos += DirX * PostRotOffset.x;
|
||||
HandPos += DirY * PostRotOffset.y;
|
||||
HandPos += DirX * PostRotOffset.x;
|
||||
HandPos += DirY * PostRotOffset.y;
|
||||
|
||||
const vec4 Color = pInfo->m_aColors[SKINPART_HANDS];
|
||||
IGraphics::CQuadItem QuadOutline(HandPos.x, HandPos.y, 2*BaseSize, 2*BaseSize);
|
||||
IGraphics::CQuadItem QuadHand = QuadOutline;
|
||||
const vec4 Color = pInfo->m_aColors[SKINPART_HANDS];
|
||||
IGraphics::CQuadItem QuadOutline(HandPos.x, HandPos.y, 2*BaseSize, 2*BaseSize);
|
||||
IGraphics::CQuadItem QuadHand = QuadOutline;
|
||||
|
||||
Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_HANDS]);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a);
|
||||
Graphics()->QuadsSetRotation(Angle);
|
||||
Graphics()->TextureSet(pInfo->m_aTextures[SKINPART_HANDS]);
|
||||
Graphics()->QuadsBegin();
|
||||
Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a);
|
||||
Graphics()->QuadsSetRotation(Angle);
|
||||
|
||||
SelectSprite(SPRITE_TEE_HAND_OUTLINE, 0, 0, 0);
|
||||
Graphics()->QuadsDraw(&QuadOutline, 1);
|
||||
SelectSprite(SPRITE_TEE_HAND, 0, 0, 0);
|
||||
Graphics()->QuadsDraw(&QuadHand, 1);
|
||||
SelectSprite(SPRITE_TEE_HAND_OUTLINE, 0, 0, 0);
|
||||
Graphics()->QuadsDraw(&QuadOutline, 1);
|
||||
SelectSprite(SPRITE_TEE_HAND, 0, 0, 0);
|
||||
Graphics()->QuadsDraw(&QuadHand, 1);
|
||||
|
||||
Graphics()->QuadsSetRotation(0);
|
||||
Graphics()->QuadsEnd();
|
||||
Graphics()->QuadsSetRotation(0);
|
||||
Graphics()->QuadsEnd();
|
||||
}
|
||||
|
||||
static void CalcScreenParams(float Amount, float WMax, float HMax, float Aspect, float *w, float *h)
|
||||
|
|
|
@ -76,8 +76,8 @@ public:
|
|||
|
||||
// object render methods (gc_render_obj.cpp)
|
||||
void RenderTee(class CAnimState *pAnim, CTeeRenderInfo *pInfo, int Emote, vec2 Dir, vec2 Pos);
|
||||
void RenderTeeHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float AngleOffset,
|
||||
vec2 PostRotOffset);
|
||||
void RenderTeeHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float AngleOffset,
|
||||
vec2 PostRotOffset);
|
||||
|
||||
// map render methods (gc_render_map.cpp)
|
||||
static void RenderEvalEnvelope(CEnvPoint *pPoints, int NumPoints, int Channels, float Time, float *pResult);
|
||||
|
|
Loading…
Reference in a new issue