THIS IS IT

This commit is contained in:
tildearrow 2023-04-04 16:01:45 -05:00
parent 34a15adc7f
commit ffe8b41d01
3 changed files with 15 additions and 7 deletions

View file

@ -92,10 +92,10 @@ bool DivConfig::loadFromFile(const char* path, bool createOnFail) {
logD("config does not exist"); logD("config does not exist");
if (createOnFail) { if (createOnFail) {
logI("creating default config."); logI("creating default config.");
reportError(fmt::sprintf("Creating default config: %s",strerror(errno)); reportError(fmt::sprintf("Creating default config: %s",strerror(errno)));
return save(path); return save(path);
} else { } else {
reportError(fmt::sprintf("COULD NOT LOAD CONFIG %s",strerror(errno)); reportError(fmt::sprintf("COULD NOT LOAD CONFIG %s",strerror(errno)));
return false; return false;
} }
} }

View file

@ -2786,7 +2786,9 @@ void FurnaceGUI::editOptions(bool topMenu) {
void FurnaceGUI::toggleMobileUI(bool enable, bool force) { void FurnaceGUI::toggleMobileUI(bool enable, bool force) {
if (mobileUI!=enable || force) { if (mobileUI!=enable || force) {
if (!mobileUI && enable) { if (!mobileUI && enable) {
ImGui::SaveIniSettingsToDisk(finalLayoutPath); if (!ImGui::SaveIniSettingsToDisk(finalLayoutPath)) {
reportError(fmt::sprintf("could NOT save layout! %s",strerror(errno)));
}
} }
mobileUI=enable; mobileUI=enable;
if (mobileUI) { if (mobileUI) {
@ -2796,7 +2798,9 @@ void FurnaceGUI::toggleMobileUI(bool enable, bool force) {
fileDialog->mobileUI=true; fileDialog->mobileUI=true;
} else { } else {
ImGui::GetIO().IniFilename=NULL; ImGui::GetIO().IniFilename=NULL;
ImGui::LoadIniSettingsFromDisk(finalLayoutPath); if (!ImGui::LoadIniSettingsFromDisk(finalLayoutPath)) {
reportError(fmt::sprintf("could NOT load layout! %s",strerror(errno)));
}
ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_InertialScrollEnable; ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_InertialScrollEnable;
ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NoHoverColors; ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NoHoverColors;
fileDialog->mobileUI=false; fileDialog->mobileUI=false;
@ -5025,7 +5029,9 @@ bool FurnaceGUI::loop() {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
if (!mobileUI) { if (!mobileUI) {
ImGui::LoadIniSettingsFromMemory(defaultLayout); ImGui::LoadIniSettingsFromMemory(defaultLayout);
ImGui::SaveIniSettingsToDisk(finalLayoutPath); if (!ImGui::SaveIniSettingsToDisk(finalLayoutPath)) {
reportError(fmt::sprintf("could NOT save layout! %s",strerror(errno)));
}
} }
} }
ImGui::SameLine(); ImGui::SameLine();
@ -5907,7 +5913,9 @@ bool FurnaceGUI::init() {
void FurnaceGUI::commitState() { void FurnaceGUI::commitState() {
if (!mobileUI) { if (!mobileUI) {
ImGui::SaveIniSettingsToDisk(finalLayoutPath); if (!ImGui::SaveIniSettingsToDisk(finalLayoutPath)) {
reportError(fmt::sprintf("could NOT save layout! %s",strerror(errno)));
}
} }
e->setConf("configVersion",(int)DIV_ENGINE_VERSION); e->setConf("configVersion",(int)DIV_ENGINE_VERSION);

View file

@ -24,7 +24,7 @@
#ifdef IS_MOBILE #ifdef IS_MOBILE
int logLevel=LOGLEVEL_TRACE; int logLevel=LOGLEVEL_TRACE;
#else #else
int logLevel=LOGLEVEL_INFO; int logLevel=LOGLEVEL_TRACE; // until done
#endif #endif
FILE* logFile; FILE* logFile;