Menu基本完成

This commit is contained in:
SoulliesOfficial
2025-06-14 14:42:49 -04:00
parent b9e6a9ab25
commit b19469976a
52 changed files with 1380 additions and 363 deletions

View File

@@ -41,7 +41,7 @@ namespace Ichni.Story
public void SetDialog(string dialogName)
{
string chapter = StoryManager.instance.currentChapter;
string chapter = ChapterSelectionManager.instance.currentChapter;
TextAsset dialog = Resources.Load<TextAsset>("Story/" + chapter + "/Dialogs/" + dialogName);
SetDialog(new List<TextAsset> { dialog });
}

View File

@@ -14,8 +14,7 @@ namespace Ichni.Story
[FormerlySerializedAs("storylineDisplay")] public Storyline storyline;
public StoryUIPage storyUIPage;
public string currentChapter;
public Dictionary<string, StoryData> storyDatas;

View File

@@ -1,53 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ichni.Story
{
public class StoryBlockSave
{
public string blockName;
public Vector2 position;
public StoryBlockState state;
public StoryBlockSave(string blockName, Vector2 position, StoryBlockState state)
{
this.blockName = blockName;
this.state = state;
this.position = position;
}
}
public class TutorialBlockSave : StoryBlockSave
{
public TutorialBlockSave(string blockName, Vector2 position, StoryBlockState state) : base(blockName, position, state)
{
}
}
public class DialogBlockSave : StoryBlockSave
{
public DialogBlockSave(string blockName, Vector2 position, StoryBlockState state) : base(blockName, position, state)
{
}
}
public class SongBlockSave : StoryBlockSave
{
public SongBlockSave(string blockName, Vector2 position, StoryBlockState state) : base(blockName, position, state)
{
}
}
public class BlockConnectorSave
{
public string startBlockName;
public string endBlockName;
public BlockConnectorSave(string startBlockName, string endBlockName)
{
this.startBlockName = startBlockName;
this.endBlockName = endBlockName;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9ff8f51d49d96524fab4c38c7f846368
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -29,6 +29,7 @@ namespace Ichni.Story.UI
button.onClick.AddListener(() =>
{
MenuManager.instance.prepareUIPage.SetUpPrepareUIPage(songName);
MenuManager.instance.prepareUIPage.FadeIn();
});
@@ -44,7 +45,7 @@ namespace Ichni.Story.UI
{
SongStatusSave songStatusSave = GameSaveManager.instance.SongSaveModule.songStatusSaves[songName];
string chapter = StoryManager.instance.currentChapter;
string chapter = ChapterSelectionManager.instance.currentChapter;
ChapterSelectionUnit cpt = ChapterSelectionManager.instance.chapters.First(c => c.chapterIndex == chapter);
SongItemData song = cpt.songs.First(s => s.songName == this.songName);
foreach (DifficultyData difficulty in song.difficultyDataList)

View File

@@ -28,7 +28,7 @@ namespace Ichni.Story.UI
int cIndex = index; // Capture the current index for the listener
GameObject choiceButton = Instantiate(choiceButtonPrefab, container);
choiceButton.GetComponentInChildren<Localize>().SetTerm(StoryManager.instance.currentChapter + "/" + choice.choiceText);
choiceButton.GetComponentInChildren<Localize>().SetTerm(ChapterSelectionManager.instance.currentChapter + "/" + choice.choiceText);
choiceButton.GetComponent<Button>().onClick.AddListener(() =>
{
DialogManager.instance.PlayNextDialogParagraph(choice.nextDialogName);

View File

@@ -27,7 +27,7 @@ namespace Ichni.Story
{
DialogTextUI dialogTextUI = Instantiate(textPrefab, dialogContentContainer).GetComponent<DialogTextUI>();
dialogTextUI.speakerNameText.SetTerm("Characters/" + speakerName);
dialogTextUI.contentText.SetTerm(StoryManager.instance.currentChapter +"/" +content);
dialogTextUI.contentText.SetTerm(ChapterSelectionManager.instance.currentChapter +"/" +content);
dialogTexts.Add(dialogTextUI);
}

View File

@@ -1,8 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using Ichni.UI;
using UnityEngine;
namespace Ichni.UI
namespace Ichni.Story.UI
{
public class StoryUIPage : UIPageBase
{

View File

@@ -43,7 +43,7 @@ namespace Ichni.Story.UI
//TutorialBlockUI t0 = GenerateTutorialBlock(new Vector2(200, -400), "ZakoCurse 0");
//TextBlockUI b1 = GenerateTextBlock("Departure_P1_A", new Vector2(1000, -400), StoryBlockState.Current);
SetUpStoryline(StoryManager.instance.currentChapter);
SetUpStoryline(ChapterSelectionManager.instance.currentChapter);
/*GenerateTextBlock("Departure_P1_A", new Vector2(1000, -400), StoryBlockState.Current);
GenerateTextBlock("Departure_P2_A", new Vector2(1500, -400), StoryBlockState.Current);
@@ -60,7 +60,7 @@ namespace Ichni.Story.UI
public TutorialBlockUI GenerateTutorialBlock(string blockName, Vector2 position, StoryBlockState state)
{
TutorialBlockUI block = Instantiate(tutorialBlockPrefab, content).GetComponent<TutorialBlockUI>();
StoryData storyData = StoryManager.instance.storyDatas[StoryManager.instance.currentChapter];
StoryData storyData = StoryManager.instance.storyDatas[ChapterSelectionManager.instance.currentChapter];
TutorialBlockData blockData = storyData.tutorialBlockDatas.FirstOrDefault(data => data.blockName == blockName);
if (blockData == null) throw new KeyNotFoundException("There is no block with name " + blockName);
@@ -76,7 +76,7 @@ namespace Ichni.Story.UI
public DialogBlockUI GenerateDialogBlock(string blockName, Vector2 position, StoryBlockState state)
{
DialogBlockUI block = Instantiate(dialogBlockPrefab, content).GetComponent<DialogBlockUI>();
StoryData storyData = StoryManager.instance.storyDatas[StoryManager.instance.currentChapter];
StoryData storyData = StoryManager.instance.storyDatas[ChapterSelectionManager.instance.currentChapter];
DialogBlockData blockData = storyData.dialogBlockDatas.FirstOrDefault(data => data.blockName == blockName);
if (blockData == null) throw new KeyNotFoundException("There is no block with name " + blockName);
@@ -92,7 +92,7 @@ namespace Ichni.Story.UI
public SongBlockUI GenerateSongBlock(string blockName, Vector2 position, StoryBlockState state)
{
SongBlockUI block = Instantiate(musicBlockPrefab, content).GetComponent<SongBlockUI>();
StoryData storyData = StoryManager.instance.storyDatas[StoryManager.instance.currentChapter];
StoryData storyData = StoryManager.instance.storyDatas[ChapterSelectionManager.instance.currentChapter];
SongBlockData blockData = storyData.songBlockDatas.FirstOrDefault(data => data.blockName == blockName);
if (blockData == null) throw new KeyNotFoundException("There is no block with name " + blockName);
@@ -243,7 +243,7 @@ namespace Ichni.Story.UI
{
ClearStoryline();
StoryData storyData = StoryManager.instance.storyDatas[StoryManager.instance.currentChapter];
StoryData storyData = StoryManager.instance.storyDatas[ChapterSelectionManager.instance.currentChapter];
List<InitialBlockData> initialBlocks = storyData.initialBlocks;
foreach (InitialBlockData blockData in initialBlocks)
@@ -273,7 +273,7 @@ namespace Ichni.Story.UI
}
SetUpBackground();
SaveStoryline(StoryManager.instance.currentChapter);
SaveStoryline(ChapterSelectionManager.instance.currentChapter);
}
}
}