Write out scores and prefs immediately upon change instead of when app exits, since Android doesn't really exit normally.

This commit is contained in:
elasota
2020-11-03 19:02:22 -05:00
parent 3b5f222d98
commit 43cfb7ea6b
7 changed files with 38 additions and 20 deletions

View File

@@ -42,7 +42,7 @@
#define kGrayedOutDownArrow 1053
#define kMaxExtraHouses 8
void WriteOutPrefs (void);
void UpdateLoadDialog (Dialog *);
void PageUpHouses (Dialog *);
void PageDownHouses (Dialog *);
@@ -343,6 +343,7 @@ void DoLoadHouse (void)
Dialog *theDial;
short i, wasIndex, screenCount;
Boolean leaving, whoCares;
bool houseNameDirty = false;
PortabilityLayer::WindowManager *wm = PortabilityLayer::WindowManager::GetInstance();
@@ -411,7 +412,10 @@ void DoLoadHouse (void)
PasStringCopy(theHousesSpecs[thisHouseIndex].m_name,
thisHouseName);
if (OpenHouse())
{
whoCares = ReadHouse();
houseNameDirty = true;
}
}
leaving = true;
}
@@ -449,7 +453,10 @@ void DoLoadHouse (void)
PasStringCopy(theHousesSpecs[thisHouseIndex].m_name,
thisHouseName);
if (OpenHouse())
{
whoCares = ReadHouse();
houseNameDirty = true;
}
}
leaving = true;
}
@@ -483,7 +490,10 @@ void DoLoadHouse (void)
PasStringCopy(theHousesSpecs[thisHouseIndex].m_name,
thisHouseName);
if (OpenHouse())
{
whoCares = ReadHouse();
houseNameDirty = true;
}
}
leaving = true;
}
@@ -501,6 +511,9 @@ void DoLoadHouse (void)
UpdateLoadDialog(theDial);
}
if (houseNameDirty)
WriteOutPrefs();
wm->SwapExclusiveWindow(exclWindow); // Pop exclusive window
theDial->Destroy();