This commit is contained in:
SoulliesOfficial
2025-07-26 04:20:25 -04:00
parent bae0bfbc20
commit abf81ece7b
196 changed files with 3909 additions and 964 deletions

View File

@@ -41,8 +41,9 @@ namespace Ichni.Story
public void SetDialog(string dialogName)
{
string chapter = ChapterSelectionManager.instance.currentChapter.chapterName;
string chapter = ChapterSelectionManager.instance.currentChapter.chapterIndex;
TextAsset dialog = Resources.Load<TextAsset>("Story/" + chapter + "/Dialogs/" + dialogName);
dialogUIPage.dialogContentFrame.ClearAllSentences();
SetDialog(new List<TextAsset> { dialog });
}
@@ -53,12 +54,10 @@ namespace Ichni.Story
isPlayingDialog = true;
currentDialog = "NULL";
LoadDialog(dialogFiles, out string firstHeader);
Debug.Log($"Loaded dialog, first header: {firstHeader}");
currentDialog = dialogParagraphName == "" ? firstHeader : dialogParagraphName;
Debug.Log($"Setting dialog to: {currentDialog}");
}
public void PlayNextDialogParagraph(string nextDialog, bool invokeFunctions = true)
@@ -138,6 +137,9 @@ namespace Ichni.Story
{
StoryManager.instance.storyline.currentBlock.state = StoryBlockState.Completed;
isPlayingDialog = false;
dialogUIPage.FadeOut();
Debug.Log("Dialog completed, setting block state to Completed.");
StoryManager.instance.storyline.SaveStoryline(ChapterSelectionManager.instance.currentChapter.chapterIndex);
}
}
@@ -145,7 +147,7 @@ namespace Ichni.Story
{
string finalType;
int max = 0;
Debug.Log($"Revealing dialog: {currentDialog}, currentFinalType: {currentFinalType}");
do
{
finalType = currentFinalType;

View File

@@ -26,6 +26,7 @@ namespace Ichni.Story
FunctionInterpreter.SetFunction("GetVariable", new Func<string, int>(GetStoryVariable));
FunctionInterpreter.SetFunction("GenerateDialogBlock", new Action<string>(GenerateDialogBlock));
FunctionInterpreter.SetFunction("GenerateSongBlock", new Action<string>(GenerateSongBlock));
FunctionInterpreter.SetFunction("SetUnlockKey", new Action<string>(SetUnlockKey));
}
static void SetConditionInterpreter()
@@ -75,5 +76,13 @@ namespace Ichni.Story
SongBlockUI newBlock = StoryManager.instance.storyline.GenerateSongBlock(blockName, currentBlock.blockPosition + positionOffset, StoryBlockState.Current);
StoryManager.instance.storyline.GenerateConnector(currentBlock, newBlock);
}
static void SetUnlockKey(string key)
{
if (GameSaveManager.instance.SongSaveModule.unlockKeys.Add(key))
{
GameSaveManager.instance.SongSaveModule.SaveUnlockKeys();
}
}
}
}

View File

@@ -26,7 +26,12 @@ namespace Ichni.Story
public partial class StoryManager
{
[Button]
public void ClearAllStorySave()
{
GameSaveManager.instance.StorySaveModule.ClearAllStoryline();
GameSaveManager.instance.SongSaveModule.ClearUnlock();
}
}
public enum StoryBlockState