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");
if (createOnFail) {
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);
} else {
reportError(fmt::sprintf("COULD NOT LOAD CONFIG %s",strerror(errno));
reportError(fmt::sprintf("COULD NOT LOAD CONFIG %s",strerror(errno)));
return false;
}
}

View File

@ -2786,7 +2786,9 @@ void FurnaceGUI::editOptions(bool topMenu) {
void FurnaceGUI::toggleMobileUI(bool enable, bool force) {
if (mobileUI!=enable || force) {
if (!mobileUI && enable) {
ImGui::SaveIniSettingsToDisk(finalLayoutPath);
if (!ImGui::SaveIniSettingsToDisk(finalLayoutPath)) {
reportError(fmt::sprintf("could NOT save layout! %s",strerror(errno)));
}
}
mobileUI=enable;
if (mobileUI) {
@ -2796,7 +2798,9 @@ void FurnaceGUI::toggleMobileUI(bool enable, bool force) {
fileDialog->mobileUI=true;
} else {
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_NoHoverColors;
fileDialog->mobileUI=false;
@ -5025,7 +5029,9 @@ bool FurnaceGUI::loop() {
ImGui::CloseCurrentPopup();
if (!mobileUI) {
ImGui::LoadIniSettingsFromMemory(defaultLayout);
ImGui::SaveIniSettingsToDisk(finalLayoutPath);
if (!ImGui::SaveIniSettingsToDisk(finalLayoutPath)) {
reportError(fmt::sprintf("could NOT save layout! %s",strerror(errno)));
}
}
}
ImGui::SameLine();
@ -5907,7 +5913,9 @@ bool FurnaceGUI::init() {
void FurnaceGUI::commitState() {
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);

View File

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