mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add buttons to open settings file and config directory
Only tested on macOS
This commit is contained in:
parent
ffc532a302
commit
7484ffc125
|
@ -258,6 +258,38 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
|
|||
m_NeedRestartGeneral = s_ClShowConsole != g_Config.m_ClShowConsole;
|
||||
#endif
|
||||
|
||||
Left.HSplitTop(15.0f, 0, &Left);
|
||||
CUIRect SettingsButton;
|
||||
Left.HSplitBottom(25.0f, &Left, &SettingsButton);
|
||||
|
||||
SettingsButton.HSplitTop(5.0f, 0, &SettingsButton);
|
||||
static int s_SettingsButtonID = 0;
|
||||
if(DoButton_Menu(&s_SettingsButtonID, Localize("Settings file"), 0, &SettingsButton))
|
||||
{
|
||||
char aBuf[IO_MAX_PATH_LENGTH];
|
||||
Storage()->GetCompletePath(IStorage::TYPE_SAVE, "settings_ddnet.cfg", aBuf, sizeof(aBuf));
|
||||
if(!open_file(aBuf))
|
||||
{
|
||||
dbg_msg("menus", "couldn't open file");
|
||||
}
|
||||
}
|
||||
|
||||
Left.HSplitTop(15.0f, 0, &Left);
|
||||
CUIRect ConfigButton;
|
||||
Left.HSplitBottom(25.0f, &Left, &ConfigButton);
|
||||
|
||||
ConfigButton.HSplitTop(5.0f, 0, &ConfigButton);
|
||||
static int s_ConfigButtonID = 0;
|
||||
if(DoButton_Menu(&s_ConfigButtonID, Localize("Config directory"), 0, &ConfigButton))
|
||||
{
|
||||
char aBuf[IO_MAX_PATH_LENGTH];
|
||||
Storage()->GetCompletePath(IStorage::TYPE_SAVE, "", aBuf, sizeof(aBuf));
|
||||
if(!open_file(aBuf))
|
||||
{
|
||||
dbg_msg("menus", "couldn't open file");
|
||||
}
|
||||
}
|
||||
|
||||
Left.HSplitTop(15.0f, 0, &Left);
|
||||
CUIRect DirectoryButton;
|
||||
Left.HSplitBottom(25.0f, &Left, &DirectoryButton);
|
||||
|
|
Loading…
Reference in a new issue