Skip to content

Commit a1d1c7d

Browse files
authored
Merge pull request ddnet#9544 from dropalways/master
Adds a button that opens the ddnet-saves.txt
2 parents fb8ea35 + 98ccc2c commit a1d1c7d

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/game/client/components/chat.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ bool CChat::LineShouldHighlight(const char *pLine, const char *pName)
576576
return false;
577577
}
578578

579-
#define SAVES_FILE "ddnet-saves.txt"
580579
const char *SAVES_HEADER[] = {
581580
"Time",
582581
"Player",

src/game/client/components/chat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <game/client/skin.h>
1616
#include <game/generated/protocol7.h>
1717

18+
constexpr auto SAVES_FILE = "ddnet-saves.txt";
19+
1820
class CChat : public CComponent
1921
{
2022
static constexpr float CHAT_HEIGHT_FULL = 200.0f;

src/game/client/components/menus_settings.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,17 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
172172
}
173173
GameClient()->m_Tooltips.DoToolTip(&s_SettingsButtonId, &SettingsButton, Localize("Open the settings file"));
174174

175+
CUIRect SavesButton;
176+
Left.HSplitBottom(20.0f, &Left, &SavesButton);
177+
Left.HSplitBottom(5.0f, &Left, nullptr);
178+
static CButtonContainer s_SavesButtonId;
179+
if(DoButton_Menu(&s_SavesButtonId, Localize("Saves file"), 0, &SavesButton))
180+
{
181+
Storage()->GetCompletePath(IStorage::TYPE_SAVE, SAVES_FILE, aBuf, sizeof(aBuf));
182+
Client()->ViewFile(aBuf);
183+
}
184+
GameClient()->m_Tooltips.DoToolTip(&s_SavesButtonId, &SavesButton, Localize("Open the saves file"));
185+
175186
CUIRect ConfigButton;
176187
Left.HSplitBottom(20.0f, &Left, &ConfigButton);
177188
Left.HSplitBottom(5.0f, &Left, nullptr);

0 commit comments

Comments
 (0)