Action Bar Persistence
This commit is contained in:
parent
8d76c2d37d
commit
68ab14dc42
21 changed files with 183 additions and 46 deletions
|
|
@ -250,6 +250,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
if(PlayerSettings.SavedRun != null)
|
||||
{
|
||||
PlayerSettings.SavedRun.IsTutorial = IsTutorial;
|
||||
PlayerSettings.SavedRun.ActionBarBindings = _actionBarSlots.Select(slot => slot.Save()).ToArray();
|
||||
}
|
||||
SavePlayerSettings();
|
||||
}
|
||||
|
|
@ -284,8 +285,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
ItemManager = new ItemManager(CultCache, Settings.GameplaySettings, Debug.Log);
|
||||
ZoneRenderer.ItemManager = ItemManager;
|
||||
|
||||
var narrativePath = GameDataDirectory.CreateSubdirectory("Narrative");
|
||||
// TODO: Process Stories
|
||||
|
||||
// _loadoutPath = GameDataDirectory.CreateSubdirectory("Loadouts");
|
||||
|
|
@ -478,6 +477,14 @@ public class ActionGameManager : MonoBehaviour
|
|||
num.InputLabel.text = i.ToString();
|
||||
}
|
||||
|
||||
if(PlayerSettings.SavedRun!=null)
|
||||
{
|
||||
for (var i = 0; i < _actionBarSlots.Count; i++)
|
||||
{
|
||||
_actionBarSlots[i].Restore(PlayerSettings.SavedRun.ActionBarBindings[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -44,9 +44,15 @@ public class StoryProcessor : IZoneResolver, IFactionResolver
|
|||
_inkFileHandler = new AetheriaInkFileHandler(narrativeDirectory);
|
||||
|
||||
_locationsPath = narrativeDirectory.CreateSubdirectory("Locations");
|
||||
}
|
||||
|
||||
public Dictionary<Story, SectorZone> PlaceStories()
|
||||
{
|
||||
var locationFiles = _locationsPath.EnumerateFiles("*.ink");
|
||||
foreach(var inkFile in locationFiles) PlaceStory(GetStory(inkFile));
|
||||
return _placedStories;
|
||||
}
|
||||
|
||||
public SectorZone ResolveZone(string path)
|
||||
{
|
||||
// Handle special cases: "start" and "end"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -117,6 +118,8 @@ public class Sector
|
|||
SectorBackgroundSettings background,
|
||||
NameGeneratorSettings nameGeneratorSettings,
|
||||
CultCache cache,
|
||||
PlayerSettings playerSettings,
|
||||
DirectoryInfo narrativeDirectory,
|
||||
Action<string> progressCallback = null,
|
||||
uint seed = 0)
|
||||
{
|
||||
|
|
@ -196,6 +199,14 @@ public class Sector
|
|||
CalculateFactionInfluence(progressCallback);
|
||||
|
||||
GenerateNames(cache, nameGeneratorSettings, ref random, progressCallback);
|
||||
|
||||
progressCallback?.Invoke("Weaving Narrative");
|
||||
// var processor = new StoryProcessor(playerSettings, narrativeDirectory, this, ref random);
|
||||
// var storyPlacement = processor.PlaceStories();
|
||||
// foreach (var story in storyPlacement.Keys)
|
||||
// {
|
||||
// storyPlacement[story]
|
||||
// }
|
||||
|
||||
progressCallback?.Invoke("Done!");
|
||||
if(progressCallback!=null) Thread.Sleep(500); // Inserting Delay to make it seem like it's doing more work lmao
|
||||
|
|
|
|||
|
|
@ -156,6 +156,8 @@ public class MainMenu : MonoBehaviour
|
|||
Settings.TutorialBackgroundSettings,
|
||||
Settings.NameGeneratorSettings,
|
||||
ActionGameManager.CultCache,
|
||||
ActionGameManager.PlayerSettings,
|
||||
ActionGameManager.GameDataDirectory.CreateSubdirectory("Narrative"),
|
||||
setState);
|
||||
Observable.NextFrame().Subscribe(_ =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue