mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #1970
1970: Save selected UI settings page r=def- a=ChillerDragon
Inspired by @SushiTee's teeworlds commit:
65cc8f7fd9
Co-authored-by: ChillerDragon <chillerdragon@gmail.com>
This commit is contained in:
commit
f7b7c3afb0
|
@ -344,7 +344,17 @@ public:
|
||||||
PAGE_SETTINGS,
|
PAGE_SETTINGS,
|
||||||
PAGE_SYSTEM,
|
PAGE_SYSTEM,
|
||||||
PAGE_NETWORK,
|
PAGE_NETWORK,
|
||||||
PAGE_GHOST
|
PAGE_GHOST,
|
||||||
|
|
||||||
|
SETTINGS_LANGUAGE=0,
|
||||||
|
SETTINGS_GENERAL,
|
||||||
|
SETTINGS_PLAYER,
|
||||||
|
SETTINGS_TEE,
|
||||||
|
SETTINGS_HUD,
|
||||||
|
SETTINGS_CONTROLS,
|
||||||
|
SETTINGS_GRAPHICS,
|
||||||
|
SETTINGS_SOUND,
|
||||||
|
SETTINGS_DDNET,
|
||||||
};
|
};
|
||||||
|
|
||||||
// DDRace
|
// DDRace
|
||||||
|
|
|
@ -1364,8 +1364,6 @@ void CMenus::RenderLanguageSelection(CUIRect MainView)
|
||||||
|
|
||||||
void CMenus::RenderSettings(CUIRect MainView)
|
void CMenus::RenderSettings(CUIRect MainView)
|
||||||
{
|
{
|
||||||
static int s_SettingsPage = 0;
|
|
||||||
|
|
||||||
// render background
|
// render background
|
||||||
CUIRect Temp, TabBar, RestartWarning;
|
CUIRect Temp, TabBar, RestartWarning;
|
||||||
MainView.VSplitRight(120.0f, &MainView, &TabBar);
|
MainView.VSplitRight(120.0f, &MainView, &TabBar);
|
||||||
|
@ -1397,29 +1395,29 @@ void CMenus::RenderSettings(CUIRect MainView)
|
||||||
{
|
{
|
||||||
TabBar.HSplitTop(10, &Button, &TabBar);
|
TabBar.HSplitTop(10, &Button, &TabBar);
|
||||||
TabBar.HSplitTop(26, &Button, &TabBar);
|
TabBar.HSplitTop(26, &Button, &TabBar);
|
||||||
if(DoButton_MenuTab(aTabs[i], aTabs[i], s_SettingsPage == i, &Button, CUI::CORNER_R))
|
if(DoButton_MenuTab(aTabs[i], aTabs[i], g_Config.m_UiSettingsPage == i, &Button, CUI::CORNER_R))
|
||||||
s_SettingsPage = i;
|
g_Config.m_UiSettingsPage = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
MainView.Margin(10.0f, &MainView);
|
MainView.Margin(10.0f, &MainView);
|
||||||
|
|
||||||
if(s_SettingsPage == 0)
|
if(g_Config.m_UiSettingsPage == SETTINGS_LANGUAGE)
|
||||||
RenderLanguageSelection(MainView);
|
RenderLanguageSelection(MainView);
|
||||||
else if(s_SettingsPage == 1)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_GENERAL)
|
||||||
RenderSettingsGeneral(MainView);
|
RenderSettingsGeneral(MainView);
|
||||||
else if(s_SettingsPage == 2)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_PLAYER)
|
||||||
RenderSettingsPlayer(MainView);
|
RenderSettingsPlayer(MainView);
|
||||||
else if(s_SettingsPage == 3)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_TEE)
|
||||||
RenderSettingsTee(MainView);
|
RenderSettingsTee(MainView);
|
||||||
else if(s_SettingsPage == 4)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_HUD)
|
||||||
RenderSettingsHUD(MainView);
|
RenderSettingsHUD(MainView);
|
||||||
else if(s_SettingsPage == 5)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_CONTROLS)
|
||||||
RenderSettingsControls(MainView);
|
RenderSettingsControls(MainView);
|
||||||
else if(s_SettingsPage == 6)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_GRAPHICS)
|
||||||
RenderSettingsGraphics(MainView);
|
RenderSettingsGraphics(MainView);
|
||||||
else if(s_SettingsPage == 7)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_SOUND)
|
||||||
RenderSettingsSound(MainView);
|
RenderSettingsSound(MainView);
|
||||||
else if(s_SettingsPage == 8)
|
else if(g_Config.m_UiSettingsPage == SETTINGS_DDNET)
|
||||||
RenderSettingsDDNet(MainView);
|
RenderSettingsDDNet(MainView);
|
||||||
|
|
||||||
if(m_NeedRestartUpdate)
|
if(m_NeedRestartUpdate)
|
||||||
|
|
|
@ -89,6 +89,7 @@ MACRO_CONFIG_STR(ClSkinPrefix, cl_skin_prefix, 100, "", CFGFLAG_CLIENT|CFGFLAG_S
|
||||||
MACRO_CONFIG_INT(ClFatSkins, cl_fat_skins, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable fat skins")
|
MACRO_CONFIG_INT(ClFatSkins, cl_fat_skins, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Enable fat skins")
|
||||||
|
|
||||||
MACRO_CONFIG_INT(UiPage, ui_page, 9, 0, 12, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface page")
|
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")
|
MACRO_CONFIG_INT(UiToolboxPage, ui_toolbox_page, 0, 0, 2, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Toolbox page")
|
||||||
MACRO_CONFIG_STR(UiServerAddress, ui_server_address, 64, "localhost:8303", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface server address")
|
MACRO_CONFIG_STR(UiServerAddress, ui_server_address, 64, "localhost:8303", CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface server address")
|
||||||
MACRO_CONFIG_INT(UiScale, ui_scale, 100, 50, 150, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface scale")
|
MACRO_CONFIG_INT(UiScale, ui_scale, 100, 50, 150, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface scale")
|
||||||
|
|
Loading…
Reference in a new issue