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