Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/engine/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
#include <engine/message.h>
#include <engine/notifications.h>
#include <engine/serverbrowser.h>
#include <engine/sound.h>
#include <engine/steam.h>
#include <engine/storage.h>
#include <engine/textrender.h>

#include <engine/shared/assertion_logger.h>
#include <engine/shared/compression.h>
#include <engine/shared/config.h>
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class CClient : public IClient, public CDemoPlayer::IListener
void RequestInfclassInfo() override;
void ResetInfclassInfoTask();
void LoadInfclassInfo();

bool IsSixup() const override { return m_Sixup; }

const NETADDR &ServerAddress() const override { return *m_aNetClient[CONN_MAIN].ServerAddress(); }
Expand Down
2 changes: 1 addition & 1 deletion src/engine/client/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static int TranslateKeyEventKey(const SDL_KeyboardEvent &KeyEvent)
}
#endif

if (g_Config.m_ClReplaceEscapeKey && Key == g_Config.m_ClReplaceEscapeKey)
if(g_Config.m_ClReplaceEscapeKey && Key == g_Config.m_ClReplaceEscapeKey)
{
Key = KEY_ESCAPE;
}
Expand Down
1 change: 1 addition & 0 deletions src/engine/client/notifications.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "notifications.h"

#include <base/detect.h>

#include <game/version.h>

#if defined(CONF_PLATFORM_MACOS)
Expand Down
5 changes: 2 additions & 3 deletions src/engine/client/serverbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1544,13 +1544,12 @@ void CServerBrowser::LoadDDNetServers()
vCommunities.insert(
vCommunities.end(),
Communities.u.array.values,
Communities.u.array.values + Communities.u.array.length
);
Communities.u.array.values + Communities.u.array.length);
}
}
if(m_CustomCommunitiesFunction)
m_CustomCommunitiesFunction(vCommunities);

for(unsigned CommunityIndex = 0; CommunityIndex < vCommunities.size(); ++CommunityIndex)
{
const json_value &Community = *vCommunities[CommunityIndex];
Expand Down
2 changes: 1 addition & 1 deletion src/engine/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <engine/server/server_logger.h>
#include <engine/shared/assertion_logger.h>
#include <engine/shared/config.h>
#include <engine/storage.h>
#include <engine/shared/infclass.h>
#include <engine/storage.h>

#include <game/version.h>

Expand Down
6 changes: 3 additions & 3 deletions src/game/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum PLAYERCLASS
{
PLAYERCLASS_INVALID = -1,
PLAYERCLASS_NONE = 0,

START_HUMANCLASS,
PLAYERCLASS_MERCENARY,
PLAYERCLASS_MEDIC,
Expand All @@ -18,7 +18,7 @@ enum PLAYERCLASS
PLAYERCLASS_BIOLOGIST,
PLAYERCLASS_LOOPER,
END_HUMANCLASS,

START_INFECTEDCLASS,
PLAYERCLASS_SMOKER,
PLAYERCLASS_BOOMER,
Expand All @@ -33,7 +33,7 @@ enum PLAYERCLASS
PLAYERCLASS_UNDEAD,
PLAYERCLASS_TANK,
END_INFECTEDCLASS,

NB_PLAYERCLASS,
NB_HUMANCLASS = END_HUMANCLASS - START_HUMANCLASS - 1,
NB_INFECTEDCLASS = END_INFECTEDCLASS - START_INFECTEDCLASS - 1,
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,11 +1188,11 @@ void CChat::OnRender()
{
Graphics()->TextureClear();
int yy = y - 1.0f;
int ContainerIndex = Graphics()->CreateRectQuadContainer(x/2, yy/2, Width - 189.0f, 2.5f*ScaledFontSize, MessageRounding(), IGraphics::CORNER_ALL);
int ContainerIndex = Graphics()->CreateRectQuadContainer(x / 2, yy / 2, Width - 189.0f, 2.5f * ScaledFontSize, MessageRounding(), IGraphics::CORNER_ALL);
if(0 != -1)
{
Graphics()->SetColor(color_cast<ColorRGBA>(ColorHSLA(g_Config.m_ClChatBackgroundColor, true)));
Graphics()->RenderQuadContainerEx(ContainerIndex, 0, -1, x/2, yy/2);
Graphics()->RenderQuadContainerEx(ContainerIndex, 0, -1, x / 2, yy / 2);
}
}

Expand Down
16 changes: 11 additions & 5 deletions src/game/client/components/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,9 +1095,10 @@ void CGameConsole::OnRender()
Ui()->MapScreen();

int ExtraHeight = 0;
if (g_Config.m_ClOldClientConsole >= 1)
if(g_Config.m_ClOldClientConsole >= 1)
ExtraHeight = 10;
if (g_Config.m_ClOldClientConsole >= 2) {
if(g_Config.m_ClOldClientConsole >= 2)
{
// do background
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_CONSOLE_BG].m_Id);
Graphics()->QuadsBegin();
Expand All @@ -1108,7 +1109,9 @@ void CGameConsole::OnRender()
IGraphics::CQuadItem QuadItem(0, 0, Screen.w, ConsoleHeight + ExtraHeight);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
} else {
}
else
{
// background
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_BACKGROUND_NOISE].m_Id);
Graphics()->QuadsBegin();
Expand All @@ -1127,7 +1130,8 @@ void CGameConsole::OnRender()
Graphics()->QuadsDrawTL(&QuadItemBorder, 1);
Graphics()->QuadsEnd();

if (g_Config.m_ClOldClientConsole >= 1) {
if(g_Config.m_ClOldClientConsole >= 1)
{
// do console shadow
Graphics()->TextureClear();
Graphics()->QuadsBegin();
Expand Down Expand Up @@ -1162,7 +1166,9 @@ void CGameConsole::OnRender()
IGraphics::CQuadItem QuadItemBar(0, ConsoleHeight, Screen.w, 10.0f);
Graphics()->QuadsDrawTL(&QuadItemBar, 1);
Graphics()->QuadsEnd();
} else {
}
else
{
// bottom shadow
Graphics()->TextureClear();
Graphics()->QuadsBegin();
Expand Down
17 changes: 9 additions & 8 deletions src/game/client/components/effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ void CEffects::AirJump(vec2 Pos, float Alpha)

void CEffects::LaserBounce(vec2 Pos, float Alpha, unsigned int Color)
{
if (!g_Config.m_ClExtraParticles)
if(!g_Config.m_ClExtraParticles)
return;

CParticle p;
for (int i = 0; i < 3; i++) {
for(int i = 0; i < 3; i++)
{
p.SetDefault();
p.m_Spr = SPRITE_PART_HIT01;
p.m_Pos = Pos + vec2(-6.0f, 16.0f);
Expand Down Expand Up @@ -296,7 +297,8 @@ void CEffects::PlayerDeath(vec2 Pos, int ClientId, float Alpha)
}

// Pointer31's
if (g_Config.m_ClBloodParticles) {
if(g_Config.m_ClBloodParticles)
{
for(int i = 0; i < 64; i++)
{
CParticle p;
Expand Down Expand Up @@ -401,13 +403,13 @@ void CEffects::Explosion(vec2 Pos, float Alpha)
p.m_StartAlpha = Alpha;
GameClient()->m_Particles.Add(CParticles::GROUP_EXPLOSIONS, &p);

if (g_Config.m_ClExtraParticles)
if(g_Config.m_ClExtraParticles)
for(int i = 0; i < 14; i++)
{
p.SetDefault();
p.m_Spr = SPRITE_PART_SMOKE; // SPRITE_PART_AIRJUMP
p.m_Pos = Pos + random_direction() * (random_float(0.0f, 1.0f) * 32.0f);
p.m_Vel = {0,0};
p.m_Vel = {0, 0};
p.m_LifeSpan = random_float(1.5f, 1.7f);
p.m_StartSize = random_float(28.0f, 35.0f);
p.m_EndSize = random_float(28.0f, 35.0f);
Expand All @@ -418,7 +420,7 @@ void CEffects::Explosion(vec2 Pos, float Alpha)
p.m_StartAlpha = p.m_Color.a;
p.m_EndAlpha = 0.0f;
p.m_UseAlphaFading = true;
if (Collision()->CheckPoint(p.m_Pos))
if(Collision()->CheckPoint(p.m_Pos))
GameClient()->m_Particles.Add(CParticles::GROUP_EXPLOSIONS, &p);
}

Expand Down Expand Up @@ -491,7 +493,7 @@ void CEffects::Snow(vec2 Pos, float Alpha)
p.SetDefault();
p.m_Spr = SPRITE_PART_SNOWFLAKE;
p.m_Pos = Pos + vec2(random_float(-120.0f, 120.0f), random_float(-100.5f, 30.0f)) * Size;
if (Collision()->CheckPoint(p.m_Pos))
if(Collision()->CheckPoint(p.m_Pos))
return;
p.m_Vel = vec2(random_float(-50.0f, -10.0f), 50);
p.m_LifeSpan = 8.5f;
Expand All @@ -511,7 +513,6 @@ void CEffects::Snow(vec2 Pos, float Alpha)
GameClient()->m_Particles.Add(CParticles::GROUP_EXTRA, &p);
}


void CEffects::OnRender()
{
float Speed = 1.0f;
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,12 +872,12 @@ void CHud::RenderAmmoHealthAndArmor(const CNetObj_Character *pCharacter)
Graphics()->RenderQuadContainer(m_HudQuadContainerIndex, m_aAmmoOffset[CurWeapon] + QuadOffsetSixup, Ammo);
}

if (pCharacter->m_AmmoCount == -1)
if(pCharacter->m_AmmoCount == -1)
{
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_SYMBOL_INFINITE].m_Id);
Graphics()->QuadsBegin();
Graphics()->SetColor(vec4(1.0f, 1.0f, 1.0f, 1.0));
IGraphics::CQuadItem QuadItemBackground(18.0f, AmmoOffsetY+3, 16, 16);
IGraphics::CQuadItem QuadItemBackground(18.0f, AmmoOffsetY + 3, 16, 16);
Graphics()->QuadsDrawTL(&QuadItemBackground, 1);
Graphics()->QuadsEnd();
}
Expand Down
5 changes: 3 additions & 2 deletions src/game/client/components/infc_binds.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "infc_binds.h"

#include <engine/shared/infclass.h>

#include <game/client/gameclient.h>

void CInfCBinds::OnConsoleInit()
Expand All @@ -9,7 +10,7 @@ void CInfCBinds::OnConsoleInit()
IConfigManager *pConfigManager = Kernel()->RequestInterface<IConfigManager>();
if(pConfigManager)
pConfigManager->RegisterCallback(ConfigSaveCallback, this);

Console()->Register("infc_bind", "s[key] ?r[command]", CFGFLAG_CLIENT, ConBind, this, "Bind key to execute a command or view keybindings");
Console()->Register("infc_binds", "?s[key]", CFGFLAG_CLIENT, ConBinds, this, "Print command executed by this keybindind or all binds");
Console()->Register("infc_unbind", "s[key]", CFGFLAG_CLIENT, ConUnbind, this, "Unbind key");
Expand Down Expand Up @@ -40,7 +41,7 @@ void CInfCBinds::ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserD

char *pBuf = pSelf->GetKeyBindCommand(Modifier, Key);
char pBuf2[128];
str_format(pBuf2, sizeof(pBuf2), "infc_%s", pBuf);
str_format(pBuf2, sizeof(pBuf2), "infc_%s", pBuf);
pConfigManager->WriteLine(pBuf2, InfclassConfigDomainId());
free(pBuf);
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/components/infc_commands.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */

#include <game/client/gameclient.h>
#include "infc_commands.h"

#include <engine/shared/config.h>
#include <engine/shared/infclass.h>

#include "infc_commands.h"
#include <game/client/gameclient.h>

static const int LocationsCount = static_cast<int>(CInfCCommands::ELocation::Count);
static const char *gs_pLocationNames[LocationsCount] = {
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/infomessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <game/client/gameclient.h>
#include <game/client/prediction/entities/character.h>
#include <game/client/prediction/gameworld.h>
#include <game/localization.h>
#include <game/damage_type.h>
#include <game/localization.h>

static constexpr float ROW_HEIGHT = 46.0f;
static constexpr float FONT_SIZE = 36.0f;
Expand Down
12 changes: 6 additions & 6 deletions src/game/client/components/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int CMenus::DoButton_Menu(CButtonContainer *pButtonContainer, const char *pText,
if(Checked)
Color = ColorRGBA(0.6f, 0.6f, 0.6f, 0.5f);

if (Color.r == 1.0f && Color.g == 1.0f && Color.b == 1.0f)
if(Color.r == 1.0f && Color.g == 1.0f && Color.b == 1.0f)
Color = ColorRGBA(ms_GuiColorButtons.r, ms_GuiColorButtons.g, ms_GuiColorButtons.b, Color.a);

Color.a *= Ui()->ButtonColorMul(pButtonContainer);
Expand Down Expand Up @@ -749,7 +749,7 @@ void CMenus::RenderMenubar(CUIRect Box, IClient::EClientState ClientState)
Box.VSplitLeft(BrowserButtonWidth, &Button, &Box);
const int Page = PAGE_FAVORITE_COMMUNITY_1 + FavoriteCommunityIndex;
const char *pName = pCommunity->Name();

if(g_Config.m_ClEnableCommunities == 0)
{
if(str_comp(pCommunity->Id(), IServerBrowser::COMMUNITY_DDNET) == 0)
Expand All @@ -761,13 +761,13 @@ void CMenus::RenderMenubar(CUIRect Box, IClient::EClientState ClientState)
pName = "KoG";
}
}

if(DoButton_MenuTab(&s_aFavoriteCommunityButtons[FavoriteCommunityIndex], pName, ActivePage == Page, &Button, IGraphics::CORNER_T, &m_aAnimatorsBigPage[BIT_TAB_FAVORITE_COMMUNITY_1 + FavoriteCommunityIndex], nullptr, nullptr, nullptr, 10.0f, m_CommunityIcons.Find(pCommunity->Id())))
{
NewPage = Page;
}
GameClient()->m_Tooltips.DoToolTip(&s_aFavoriteCommunityButtons[FavoriteCommunityIndex], &Button, pCommunity->Name());

++FavoriteCommunityIndex;
if(FavoriteCommunityIndex >= std::size(s_aFavoriteCommunityButtons))
break;
Expand Down Expand Up @@ -1177,13 +1177,13 @@ void CMenus::Render()
{
RenderBackground();
}
if (g_Config.m_UiColorMainMenu)
if(g_Config.m_UiColorMainMenu)
{
ms_ColorTabbarInactive = ms_ColorTabbarInactiveIngame;
ms_ColorTabbarActive = ms_ColorTabbarActiveIngame;
ms_ColorTabbarHover = ms_ColorTabbarHoverIngame;
ms_GuiColorButtons = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_UiColorButtons, true));
if (g_Config.m_UiColorMainMenu == 1)
if(g_Config.m_UiColorMainMenu == 1)
{
ms_ColorTabbarInactive.a = ms_ColorTabbarInactiveOutgame.a;
ms_ColorTabbarActive.a = ms_ColorTabbarActiveOutgame.a;
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/menus_ingame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ bool CMenus::RenderServerControlServer(CUIRect MainView, bool UpdateScroll)
for(int i = pOption->m_IsSubheader ? 1 : 0; i < pOption->m_Depth; i++)
Item.m_Rect.VSplitLeft(10.0f, 0, &Item.m_Rect);
Item.m_Rect.VMargin(2.0f, &Label);

Ui()->DoLabel(&Label, pOption->m_aDescription, 13.0f, TEXTALIGN_ML);
}

Expand Down
10 changes: 3 additions & 7 deletions src/game/client/components/menus_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ void CMenus::RenderSettingsDuckClient(CUIRect MainView)
static CButtonContainer s_UiColorButtonsResetId;
DoLine_ColorPicker(&s_UiColorButtonsResetId, 25.0f, 13.0f, 2.0f, &Left, Localize("Button Color"), &g_Config.m_UiColorButtons, color_cast<ColorRGBA>(ColorHSLA(0xFFFFFFFF, true)), false, nullptr, true);


Left.HSplitTop(VerticalSpacing, nullptr, &Left);
Left.HSplitTop(20.0f, &Button, &Left);
Ui()->DoScrollbarOption(&g_Config.m_UiColorMainMenu, &g_Config.m_UiColorMainMenu, &Button, Localize("UI color on main menu"), 0, 2, &CUi::ms_LinearScrollbarScale, CUi::SCROLLBAR_OPTION_NOCLAMPVALUE, "");
Expand All @@ -322,14 +321,11 @@ void CMenus::RenderSettingsDuckClient(CUIRect MainView)
Left.HSplitTop(20.0f, &Button, &Left);
Ui()->DoScrollbarOption(&g_Config.m_ClScoreboardShorten, &g_Config.m_ClScoreboardShorten, &Button, Localize("Shorten Scoreboard"), 0, 2, &CUi::ms_LinearScrollbarScale, CUi::SCROLLBAR_OPTION_NOCLAMPVALUE, "");


// miscellaneous
Left.HSplitTop(40.0f, &Label, &Left);
Left.HSplitTop(30.0f, &Label, &Left);
Ui()->DoLabel(&Label, Localize("Miscellaneous"), 20.0f, TEXTALIGN_ML);



Left.HSplitTop(VerticalSpacing, nullptr, &Left);
Left.HSplitTop(20.0f, &Button, &Left);
if(DoButton_CheckBox(&g_Config.m_ClOldDoorLaser, Localize("Old door laser"), g_Config.m_ClOldDoorLaser, &Button))
Expand All @@ -352,7 +348,7 @@ void CMenus::RenderSettingsDuckClient(CUIRect MainView)

Left.HSplitTop(VerticalSpacing, nullptr, &Left);
Left.HSplitTop(20.0f, &Button, &Left);
if (g_Config.m_ClConfirmKillTime != -1)
if(g_Config.m_ClConfirmKillTime != -1)
str_copy(aBuf, Localize("s", "Seconds"), sizeof(aBuf));
else
{
Expand All @@ -369,7 +365,6 @@ void CMenus::RenderSettingsDuckClient(CUIRect MainView)
Left.HSplitTop(VerticalSpacing, nullptr, &Left);
Left.HSplitTop(20.0f, &Button, &Left);
Ui()->DoScrollbarOption(&g_Config.m_ClWeatherSnow, &g_Config.m_ClWeatherSnow, &Button, Localize("Snow Weather (won't be saved)"), 0, 15, &CUi::ms_LinearScrollbarScale, CUi::SCROLLBAR_OPTION_NOCLAMPVALUE, "");

}

// From T-Client
Expand Down Expand Up @@ -2391,7 +2386,8 @@ void CMenus::RenderSettings(CUIRect MainView)
Localize("Sound"),
Localize("DDNet"),
Localize("Assets"),
Localize("DuckC"),};
Localize("DuckC"),
};
static CButtonContainer s_aTabButtons[SETTINGS_LENGTH];

for(int i = 0; i < SETTINGS_LENGTH; i++)
Expand Down
Loading
Loading