private void LoadLegacyTimeData() { CityEventManager eventManager = CityEventManager.instance; CimTools.CimToolsHandler.LegacyCimToolBase.SaveFileOptions.LoadData(serializableDataManager); CimTools.CimToolsHandler.LegacyCimToolBase.SaveFileOptions.Data.GetValue("CityTimeDay", ref Data.CityTime.day); CimTools.CimToolsHandler.LegacyCimToolBase.SaveFileOptions.Data.GetValue("CityTimeMonth", ref Data.CityTime.month); CimTools.CimToolsHandler.LegacyCimToolBase.SaveFileOptions.Data.GetValue("CityTimeYear", ref Data.CityTime.year); bool loaded = Data.CityTime.day != 0 && Data.CityTime.month != 0 && Data.CityTime.year != 0; if (loaded) { eventManager.UpdateTime(); LoggingWrapper.Log("Loaded legacy date data. Time: " + Data.CityTime.day + "/" + Data.CityTime.month + "/" + Data.CityTime.year); } else { Data.CityTime.year = CityEventManager.CITY_TIME.Year; Data.CityTime.month = CityEventManager.CITY_TIME.Month; Data.CityTime.day = CityEventManager.CITY_TIME.Day; LoggingWrapper.Log("Initially setting up time: " + Data.CityTime.day + "/" + Data.CityTime.month + "/" + Data.CityTime.year); } }
private void LoadCimToolsData() { LoggingWrapper.Log("Loading up save file data"); CityEventManager eventManager = CityEventManager.instance; CimTools.CimToolsHandler.CimToolBase.SaveFileOptions.LoadData(serializableDataManager); bool loaded = Data.CityTime.day != 0 && Data.CityTime.month != 0 && Data.CityTime.year != 0; if (loaded) { LoggingWrapper.Log("Time loaded from new data"); eventManager.UpdateTime(); } else { LoggingWrapper.Log("Time is legacy data"); LoadLegacyTimeData(); } }