5 protected string m_sFileName;
7 protected bool m_bIsLoaded;
8 protected bool m_bWriteToFile;
19 void SetFileName(
string missionFileName,
string saveFileName)
21 m_Struct.SetFileName(missionFileName, saveFileName);
24 Print(
string.Format(
"SCR_LatestSaveDSSessionCallback: Latest save for %1 is now %2", missionFileName, saveFileName), LogLevel.VERBOSE);
32 void RemoveFileName(
string missionFileName)
34 m_Struct.RemoveFileName(missionFileName);
45 bool FindFileName(
string missionFileName, out
string outSaveFileName)
47 return m_Struct.FindFileName(missionFileName, outSaveFileName);
65 SessionStorage storage =
GetGame().GetBackendApi().GetStorage();
69 Print(
string.Format(
"SCR_LatestSaveDSSessionCallback: RequestSave: %1",
m_sFileName), LogLevel.VERBOSE);
74 PrintFormat(
string.Format(
"SCR_LatestSaveDSSessionCallback: LocalSave: %1",
m_sFileName), LogLevel.VERBOSE);
77 m_bWriteToFile =
true;
90 GetGame().GetSaveManager().LoadOnInit();
94 SessionStorage storage =
GetGame().GetBackendApi().GetStorage();
98 Print(
string.Format(
"SCR_LatestSaveDSSessionCallback: Unable to load %1, it does not exist!",
m_sFileName), LogLevel.VERBOSE);
99 GetGame().GetSaveManager().LoadOnInit();
109 Print(
string.Format(
"SCR_LatestSaveDSSessionCallback: RequestLoad: %1",
m_sFileName), LogLevel.VERBOSE);
114 Print(
string.Format(
"SCR_LatestSaveDSSessionCallback: LocalLoad: %1",
m_sFileName), LogLevel.VERBOSE);
120 override void OnSaving(
string fileName)
122 GetGame().GetBackendApi().GetStorage().ProcessSave(m_Struct, fileName);
126 override void OnLoaded(
string fileName)
128 GetGame().GetBackendApi().GetStorage().ProcessLoad(m_Struct, fileName);
129 Print(
string.Format(
"SCR_LatestSaveDSSessionCallback: Loading file '%1' succeeded!", fileName), LogLevel.VERBOSE);
131 GetGame().GetSaveManager().LoadOnInit();
135 override void OnLoadFailed(
string fileName)
137 Print(
string.Format(
"SCR_LatestSaveDSSessionCallback: Loading file '%1' failed!", fileName), LogLevel.WARNING);
141 override void OnSaveSuccess(
string fileName)
143 m_bWriteToFile =
false;
144 GetGame().GetSaveManager().GetOnLatestSave().Invoke(fileName);