mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-24 11:22:39 +01:00
- auto-save profile when cheats are unlocked
This commit is contained in:
parent
819597fba3
commit
bd16f67cfd
@ -177,7 +177,7 @@ void LoadCurrentProfile(int init)
|
||||
}
|
||||
|
||||
// [A] saves config to file
|
||||
void SaveCurrentProfile()
|
||||
void SaveCurrentProfile(int showMessage)
|
||||
{
|
||||
#ifndef PSX
|
||||
int dataSize;
|
||||
@ -188,8 +188,11 @@ void SaveCurrentProfile()
|
||||
|
||||
strcat(filePath, "/config.dat");
|
||||
|
||||
SetTextColour(128, 128, 64);
|
||||
ShowSavingWaitMessage(G_LTXT(GTXT_SavingConfiguration), 0);
|
||||
if (showMessage)
|
||||
{
|
||||
SetTextColour(128, 128, 64);
|
||||
ShowSavingWaitMessage(G_LTXT(GTXT_SavingConfiguration), 0);
|
||||
}
|
||||
|
||||
dataSize = 0;
|
||||
if (SaveConfigData((char*)_other_buffer))
|
||||
@ -207,7 +210,7 @@ void SaveCurrentProfile()
|
||||
error = 0;
|
||||
}
|
||||
|
||||
if (error)
|
||||
if (error && showMessage)
|
||||
{
|
||||
SetTextColour(128, 0, 0);
|
||||
ShowSavingWaitMessage(G_LTXT(GTXT_SavingError), 0);
|
||||
|
@ -4,7 +4,7 @@
|
||||
extern char gCurrentReplayFilename[64];
|
||||
|
||||
extern void LoadCurrentProfile(int init);
|
||||
extern void SaveCurrentProfile();
|
||||
extern void SaveCurrentProfile(int showMessage);
|
||||
|
||||
extern int LoadCurrentGame();
|
||||
extern void SaveCurrentGame();
|
||||
|
@ -2116,7 +2116,7 @@ int redriver2_main(int argc, char** argv)
|
||||
DoStateLoop();
|
||||
|
||||
#ifndef PSX
|
||||
SaveCurrentProfile();
|
||||
SaveCurrentProfile(1);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
|
@ -1661,6 +1661,10 @@ int MRCommand(MR_THREAD *thread, u_int cmd)
|
||||
AvailableCheats.cheat4 = 1;
|
||||
}
|
||||
|
||||
#ifndef PSX
|
||||
SaveCurrentProfile(0);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (cmd == 0x1000090) // SetRaining
|
||||
|
@ -530,7 +530,7 @@ void SetVariable(int var)
|
||||
if (value == 0)
|
||||
{
|
||||
// [A] save configuration
|
||||
SaveCurrentProfile();
|
||||
SaveCurrentProfile(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user