Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
greeenlaser committed Dec 17, 2023
1 parent 75d56b2 commit dc90bbe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 46 deletions.
1 change: 0 additions & 1 deletion include/engine/graphics/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace Graphics
static inline bool firstScrollToBottom;
static inline bool allowScrollToBottom;

static inline bool showAboutMenu;
static inline bool showKeybindsMenu;
static inline bool showDebugMenu;
static inline bool showConsole;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/core/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace Core
{
std::vector<std::string> ConsoleManager::storedLogs;

Logger logger(Search::FindDocumentsFolder() + "/" + "engine_log.txt");
Logger logger(Search::FindDocumentsFolder() + "/engine_log.txt");

string Timestamp::GetCurrentTimestamp()
{
Expand Down
30 changes: 0 additions & 30 deletions src/engine/file/configFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ namespace File
//Render::camera.SetCameraRotation(vec3(-90.0f, 0.0f, 0.0f)); //editing this has no effect because camera is initialized later
GUI::allowScrollToBottom = true;
ConsoleManager::sendDebugMessages = true;
GUI::showAboutMenu = false;
GUI::showKeybindsMenu = false;
GUI::showDebugMenu = false;
GUI::showConsole = false;
Expand Down Expand Up @@ -370,27 +369,6 @@ namespace File
"Console force scroll value " + lineVariables[0] + " is out of range or not an int! Resetting to default.\n");
}
}
else if (name == "showAboutMenu")
{
if (ConfigFile::IsValueInRange(name, lineVariables[0]))
{
GUI::showAboutMenu = static_cast<bool>(stoi(lineVariables[0]));

ConsoleManager::WriteConsoleMessage(
Caller::ENGINE,
Type::DEBUG,
"Set show about menu to " + to_string(GUI::showAboutMenu) + ".\n");
}
else
{
GUI::showAboutMenu = false;

ConsoleManager::WriteConsoleMessage(
Caller::ENGINE,
Type::EXCEPTION,
"Show about menu value " + lineVariables[0] + " is out of range or not an int! Resetting to default.\n");
}
}
else if (name == "showKeybindsMenu")
{
if (ConfigFile::IsValueInRange(name, lineVariables[0]))
Expand Down Expand Up @@ -511,7 +489,6 @@ namespace File
Render::camera.GetCameraRotation().z << endl;
configFile << "consoleForceScroll: " << GUI::allowScrollToBottom << endl;
configFile << "consoleDebugMessages: " << ConsoleManager::sendDebugMessages << endl;
configFile << "showAboutMenu: " << GUI::showAboutMenu << endl;
configFile << "showKeybindsMenu: " << GUI::showKeybindsMenu << endl;
configFile << "showDebugMenu: " << GUI::showDebugMenu << endl;
configFile << "showConsole: " << GUI::showConsole << endl;
Expand Down Expand Up @@ -602,13 +579,6 @@ namespace File
&& (consoleForceScroll == 0
|| consoleForceScroll == 1));
}
else if (type == "showAboutMenu")
{
int showAboutMenu = stoi(value);
return (String::CanConvertStringToInt(value)
&& (showAboutMenu == 0
|| showAboutMenu == 1));
}
else if (type == "showKeybindsMenu")
{
int showKeybindsMenu = stoi(value);
Expand Down
25 changes: 11 additions & 14 deletions src/engine/graphics/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,8 @@ namespace Graphics
ImGui_ImplGlfw_InitForOpenGL(Render::window, true);
ImGui_ImplOpenGL3_Init("#version 330");

//clear default font
io.Fonts->Clear();

string filesPath = Search::SearchByParent("files");
io.Fonts->AddFontFromFileTTF((filesPath + "/fonts/coda/Coda-Regular.ttf").c_str(), 16.0f);
io.Fonts->AddFontFromFileTTF((Engine::filesPath + "/fonts/coda/Coda-Regular.ttf").c_str(), 16.0f);

CustomizeImGuiStyle();
}
Expand Down Expand Up @@ -303,7 +300,7 @@ namespace Graphics

void GUI::TB_CheckVersion()
{
string batFilePath = Engine::filesPath + "/files/bat scripts/checkVersion.bat";
string batFilePath = Engine::filesPath + "/bat scripts/checkVersion.bat";

if (exists(batFilePath))
{
Expand Down Expand Up @@ -381,7 +378,7 @@ namespace Graphics
&& ImGui::Begin("Keybinds", NULL, windowFlags))
{
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 30);
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 40);
if (ImGui::Button("X"))
{
showKeybindsMenu = false;
Expand Down Expand Up @@ -419,6 +416,13 @@ namespace Graphics
if (showDebugMenu
&& ImGui::Begin("Debug menu", NULL, windowFlags))
{
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 40);
if (ImGui::Button("X"))
{
showDebugMenu = false;
}

if (ImGui::BeginTabBar("Debug"))
{
if (ImGui::BeginTabItem("Debug info"))
Expand All @@ -434,13 +438,6 @@ namespace Graphics
ImGui::EndTabBar();
}

ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 25);
if (ImGui::Button("X"))
{
showDebugMenu = false;
}

ImGui::End();
}
}
Expand Down Expand Up @@ -574,7 +571,7 @@ namespace Graphics
&& ImGui::Begin("Version", NULL, windowFlags))
{
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 30);
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 40);
if (ImGui::Button("X"))
{
showVersionWindow = false;
Expand Down

0 comments on commit dc90bbe

Please sign in to comment.