StartMenu!

This commit is contained in:
SoulliesOfficial
2025-03-08 14:21:10 -05:00
parent 28e0a6e4b0
commit e0ae43c25c
193 changed files with 43412 additions and 7940 deletions

View File

@@ -0,0 +1,56 @@
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
using UnityEngine;
namespace Ichni.StartMenu
{
public class LoadProjectModule : MonoBehaviour
{
public GameObject LoadProjectTab;
public RectTransform loadTabList;
public List<string> projectFileList;
public List<ProjectInformation_BM> projectInformationList;
public List<SongInformation_BM> songInformationList;
private void Start()
{
projectInformationList = new List<ProjectInformation_BM>();
songInformationList = new List<SongInformation_BM>();
GetAllProjects();
}
public void GetAllProjects()
{
string path = Path.Combine(Application.streamingAssetsPath, "Projects");
projectFileList = ES3.GetDirectories(path).ToList();
foreach (string project in projectFileList)
{
string projectInformationPath = path + "/" + project + "/ProjectInfo.json";
string songInformationPath = path + "/" + project + "/SongInfo.json";
if (!File.Exists(projectInformationPath) || !File.Exists(songInformationPath)) continue;
projectInformationList.Add(ES3.Load<ProjectInformation_BM>("ProjectInformation", projectInformationPath));
songInformationList.Add(ES3.Load<SongInformation_BM>("SongInformation", songInformationPath));
}
for (int i = 0; i < projectInformationList.Count; i++)
{
var currentProject = projectInformationList[i];
var song = songInformationList[i];
string projectName = currentProject.projectName;
string lastSavedTime = currentProject.lastSaveTime;
string songName = song.songName;
LoadProjectTab tab = LeanPool.Spawn(LoadProjectTab, loadTabList).GetComponent<LoadProjectTab>();
tab.SetUpTab(projectName, lastSavedTime, songName);
}
}
}
}