Debian Codegraph @

source/code/ShowFileState.cpp

raw symbols SCIP
1 /*
2 ===========================================================================
3 blockattack - Block Attack - Rise of the Blocks
4 Copyright (C) 2005-2018 Poul Sander
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see http://www.gnu.org/licenses/
15 Source information and contacts persons can be found at
16 https://blockattack.net
17 ===========================================================================
18 */
19
20 #include "HelpCommon.hpp"
21 #include "ShowFileState.hpp"
22 #include "global.hpp"
23 #include "common.h"
24 #include "MenuSystem.h"
25 #include <fmt/core.h>
26
27 ShowFileState::ShowFileState() {
28 setHelp30FontThinOutline(&globalData.spriteHolder->GetDataHolder(), titleField, "");
29 setHelpBoxFont(&globalData.spriteHolder->GetDataHolder(), infoBox, "");
30 setHelpBoxFont(&globalData.spriteHolder->GetDataHolder(), filenameField, "");
31 }
32
33 ShowFileState::~ShowFileState() {
34 }
35
36 void ShowFileState::SetData(const std::string& filename, const std::string& header) {
37 titleField.SetText(header);
38 infoBox.SetText(sago::GetFileContent(filename));
39 filenameField.SetText(fmt::format(_("Showing content of: {}"), filename));
40 }