forked from Shardstone/trail-into-darkness
added in-game logger
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Jovian.SaveSystem;
|
||||
using Jovian.InGameLogging;
|
||||
using Nox.Core;
|
||||
using System;
|
||||
using ZLinq;
|
||||
@@ -11,7 +12,8 @@ namespace Nox.Game {
|
||||
public static NoxSavedDataSet RestoreSavedData(
|
||||
ISaveSystem saveSystem,
|
||||
GameDataState gameDataState,
|
||||
ref AdventureData adventureData) {
|
||||
ref AdventureData adventureData,
|
||||
IGameLogStore gameLogStore = null) {
|
||||
var sessions = saveSystem.GetAllSessions().AsValueEnumerable().OrderByDescending(s => s.lastSaveDateUtc).ToList();
|
||||
if(sessions.Count == 0) {
|
||||
return null;
|
||||
@@ -36,6 +38,10 @@ namespace Nox.Game {
|
||||
gameDataState.ActiveParty = saveData.partyDefinition;
|
||||
adventureData = saveData.adventureData;
|
||||
|
||||
if(gameLogStore != null && saveData.gameLogData != null) {
|
||||
gameLogStore.RestoreFromSaveData(saveData.gameLogData);
|
||||
}
|
||||
|
||||
return saveData;
|
||||
}
|
||||
}
|
||||
@@ -55,6 +61,9 @@ namespace Nox.Game {
|
||||
// Party
|
||||
public PartyDefinition partyDefinition;
|
||||
public SerializableVector3 partyPosition;
|
||||
|
||||
// In-game log
|
||||
public GameLogSaveData gameLogData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user