diff --git a/src/GUI/GUI.cpp b/src/GUI/GUI.cpp index 729612f6..019d5994 100644 --- a/src/GUI/GUI.cpp +++ b/src/GUI/GUI.cpp @@ -481,15 +481,57 @@ namespace GUI LastScaling = Settings::Settings[OPT_LASTUISCALE].get(); Renderer::Scaling = Settings::Settings[OPT_LASTUISCALE].get(); } + else + { + LastScaling = SC_NORMAL; + Renderer::Scaling = SC_NORMAL; + Settings::Settings[OPT_LASTUISCALE] = SC_NORMAL; + } + + if (!Settings::Settings[OPT_QAVERTICAL].is_null()) + { + QuickAccess::VerticalLayout = Settings::Settings[OPT_QAVERTICAL].get(); + } + else + { + QuickAccess::VerticalLayout = false; + Settings::Settings[OPT_QAVERTICAL] = false; + } + + if (!Settings::Settings[OPT_QALOCATION].is_null()) + { + QuickAccess::Location = (EQAPosition)Settings::Settings[OPT_QALOCATION].get(); + } + else + { + QuickAccess::Location = EQAPosition::Extend; + Settings::Settings[OPT_QALOCATION] = 0; + } - if (!Settings::Settings[OPT_QAVERTICAL].is_null()) { QuickAccess::VerticalLayout = Settings::Settings[OPT_QAVERTICAL].get(); } - if (!Settings::Settings[OPT_QALOCATION].is_null()) { QuickAccess::Location = (EQAPosition)Settings::Settings[OPT_QALOCATION].get(); } if (!Settings::Settings[OPT_QAOFFSETX].is_null() && !Settings::Settings[OPT_QAOFFSETY].is_null()) { QuickAccess::Offset = ImVec2(Settings::Settings[OPT_QAOFFSETX].get(), Settings::Settings[OPT_QAOFFSETY].get()); } + else + { + QuickAccess::Offset = ImVec2(0.0f, 0.0f); + Settings::Settings[OPT_QAOFFSETX] = 0.0f; + Settings::Settings[OPT_QAOFFSETY] = 0.0f; + } - if (!Settings::Settings[OPT_CLOSEMENU].is_null()) { CloseMenuAfterSelecting = Settings::Settings[OPT_CLOSEMENU].get(); } + if (!Settings::Settings[OPT_CLOSEMENU].is_null()) + { + CloseMenuAfterSelecting = Settings::Settings[OPT_CLOSEMENU].get(); + } + else + { + CloseMenuAfterSelecting = true; + Settings::Settings[OPT_CLOSEMENU] = true; + } + } + else + { + LogDebug("meme", "settings initially null"); } IsSetup = true; diff --git a/src/GUI/Widgets/Options/OptionsWindow.cpp b/src/GUI/Widgets/Options/OptionsWindow.cpp index 088f35ac..4e3b4d9c 100644 --- a/src/GUI/Widgets/Options/OptionsWindow.cpp +++ b/src/GUI/Widgets/Options/OptionsWindow.cpp @@ -52,6 +52,15 @@ namespace GUI } ImGui::TooltipGeneric("Enables the Debug menu and some other features."); + ImGui::TextDisabled("Font Size"); + if (ImGui::InputFloat("##fontsize", &GUI::FontSize, 0.0f, 0.0f, "%.1f", ImGuiInputTextFlags_EnterReturnsTrue)) + { + Settings::Settings[OPT_FONTSIZE] = FontSize; + Settings::Save(); + } + ImGui::TooltipGeneric("Changing font size requires a restart."); + + ImGui::TextDisabled("UI/UX"); if (ImGui::Checkbox("Close Menu after selecting item", &GUI::CloseMenuAfterSelecting)) { diff --git a/src/Keybinds/KeybindHandler.cpp b/src/Keybinds/KeybindHandler.cpp index 025f509b..05d30a68 100644 --- a/src/Keybinds/KeybindHandler.cpp +++ b/src/Keybinds/KeybindHandler.cpp @@ -250,6 +250,7 @@ namespace Keybinds if (it->second == aKeybind) { kb.Key = it->first; + break; } } diff --git a/src/Logging/LogHandler.cpp b/src/Logging/LogHandler.cpp index 50130df0..5565115b 100644 --- a/src/Logging/LogHandler.cpp +++ b/src/Logging/LogHandler.cpp @@ -9,9 +9,6 @@ namespace LogHandler std::vector LogEntries; std::vector Channels; - bool IsRunning = false; - int IndexProcessed = 0; - std::thread LoggingThread; void Initialize() { @@ -24,14 +21,6 @@ namespace LogHandler FileLogger* fLog = new FileLogger(ELogLevel::ALL, Path::F_LOG); RegisterLogger(fLog); - - IsRunning = true; - LoggingThread = std::thread(ProcessQueueLoop); - LoggingThread.detach(); - } - void Shutdown() - { - IsRunning = false; } void RegisterLogger(ILogger* aLogger) @@ -87,37 +76,16 @@ namespace LogHandler Mutex.lock(); { LogEntries.push_back(entry); - } - Mutex.unlock(); - } - void ProcessQueueLoop() - { - for (;;) - { - if (!IsRunning) { return; } - - while (LogEntries.size() > IndexProcessed + 1) + for (ILogger* logger : Registry) { - Mutex.lock(); + /* send logged message to logger if message log level is lower than logger level */ + if (entry.LogLevel <= logger->GetLogLevel()) { - LogEntry& entry = LogEntries[IndexProcessed + 1]; - - for (ILogger* logger : Registry) - { - ELogLevel level = logger->GetLogLevel(); - - /* send logged message to logger if message log level is lower than logger level */ - if (entry.LogLevel <= level) - { - logger->LogMessage(entry); - } - } - - IndexProcessed++; + logger->LogMessage(entry); } - Mutex.unlock(); } } + Mutex.unlock(); } int Verify(void* aStartAddress, void* aEndAddress) diff --git a/src/Logging/LogHandler.h b/src/Logging/LogHandler.h index b4487682..e3531890 100644 --- a/src/Logging/LogHandler.h +++ b/src/Logging/LogHandler.h @@ -25,12 +25,7 @@ namespace LogHandler extern std::vector LogEntries; extern std::vector Channels; - extern bool IsRunning; - extern int IndexProcessed; - extern std::thread LoggingThread; - void Initialize(); - void Shutdown(); void RegisterLogger(ILogger* aLogger); void UnregisterLogger(ILogger* aLogger); diff --git a/src/State.cpp b/src/State.cpp index 1c88cc02..1c6d9d53 100644 --- a/src/State.cpp +++ b/src/State.cpp @@ -52,6 +52,10 @@ namespace State if ((subpos = cmp.find("mumble ")) != std::string::npos) { subtoken = token.substr(7, token.length() - subpos); + if (std::regex_match(subtoken, std::regex("\"(.*?)\""))) + { + subtoken = subtoken.substr(1, subtoken.length() - 2); + } //Log("dbg", "subtoken: \"%s\" @ %d", subtoken.c_str(), subpos); customMumble = true; diff --git a/src/State.h b/src/State.h index 95175734..05ba46fa 100644 --- a/src/State.h +++ b/src/State.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "Consts.h" #include "Shared.h" diff --git a/src/Updater/Updater.cpp b/src/Updater/Updater.cpp index 659f18f8..248f1e69 100644 --- a/src/Updater/Updater.cpp +++ b/src/Updater/Updater.cpp @@ -93,5 +93,10 @@ namespace Updater } } } + + if (std::filesystem::exists(Path::F_UPDATE_DLL)) + { + std::filesystem::remove(Path::F_UPDATE_DLL); + } } } \ No newline at end of file diff --git a/src/entry.cpp b/src/entry.cpp index 780b9b5f..ed5ad55c 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -71,7 +71,15 @@ void Initialize() Keybinds::Load(); Settings::Load(); - if (!Settings::Settings[OPT_DEVMODE].is_null()) { State::IsDeveloperMode = Settings::Settings[OPT_DEVMODE].get(); } + if (!Settings::Settings[OPT_DEVMODE].is_null()) + { + State::IsDeveloperMode = Settings::Settings[OPT_DEVMODE].get(); + } + else + { + State::IsDeveloperMode = false; + Settings::Settings[OPT_DEVMODE] = false; + } //API::Initialize(); Mumble::Initialize(); @@ -110,8 +118,6 @@ void Shutdown() //API::Save(); MH_Uninitialize(); - - LogHandler::Shutdown(); } // free libs