Code structure cleanup.
This commit is contained in:
@@ -2,6 +2,9 @@ using Cryville.Common;
|
||||
using Cryville.Common.Buffers;
|
||||
using Cryville.Crtr.Config;
|
||||
using Cryville.Crtr.Event;
|
||||
using Cryville.Crtr.Ruleset;
|
||||
using Cryville.Crtr.Skin;
|
||||
using Cryville.Crtr.UI;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -22,9 +25,9 @@ namespace Cryville.Crtr {
|
||||
public class ChartPlayer : MonoBehaviour {
|
||||
#region Fields
|
||||
Chart chart;
|
||||
Skin skin;
|
||||
SkinDefinition skin;
|
||||
public static PdtSkin pskin;
|
||||
Ruleset ruleset;
|
||||
RulesetDefinition ruleset;
|
||||
PdtRuleset pruleset;
|
||||
Dictionary<string, Texture2D> texs;
|
||||
public static Dictionary<string, SpriteFrame> frames;
|
||||
@@ -71,7 +74,7 @@ namespace Cryville.Crtr {
|
||||
logs = logobj.GetComponent<TextMeshProUGUI>();
|
||||
if (!initialized) {
|
||||
Game.Init();
|
||||
GenericResources.LoadDefault();
|
||||
BuiltinResources.LoadDefault();
|
||||
initialized = true;
|
||||
}
|
||||
OnSettingsUpdate();
|
||||
@@ -417,10 +420,10 @@ namespace Cryville.Crtr {
|
||||
);
|
||||
if (!skinFile.Exists) throw new FileNotFoundException("Skin not found\nPlease specify an available skin in the config");
|
||||
using (StreamReader reader = new StreamReader(skinFile.FullName, Encoding.UTF8)) {
|
||||
skin = JsonConvert.DeserializeObject<Skin>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||
skin = JsonConvert.DeserializeObject<SkinDefinition>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||
MissingMemberHandling = MissingMemberHandling.Error
|
||||
});
|
||||
if (skin.format != Skin.CURRENT_FORMAT) throw new FormatException("Invalid skin file version");
|
||||
if (skin.format != SkinDefinition.CURRENT_FORMAT) throw new FormatException("Invalid skin file version");
|
||||
}
|
||||
|
||||
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
||||
@@ -682,10 +685,10 @@ namespace Cryville.Crtr {
|
||||
DirectoryInfo dir = file.Directory;
|
||||
Logger.Log("main", 0, "Load/WorkerThread", "Loading ruleset: {0}", file);
|
||||
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||
ruleset = JsonConvert.DeserializeObject<Ruleset>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||
ruleset = JsonConvert.DeserializeObject<RulesetDefinition>(reader.ReadToEnd(), new JsonSerializerSettings() {
|
||||
MissingMemberHandling = MissingMemberHandling.Error
|
||||
});
|
||||
if (ruleset.format != Ruleset.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
||||
if (ruleset.format != RulesetDefinition.CURRENT_FORMAT) throw new FormatException("Invalid ruleset file version");
|
||||
ruleset.LoadPdt(dir);
|
||||
pruleset = ruleset.Root;
|
||||
pruleset.Optimize(PdtEvaluator.Instance);
|
||||
|
Reference in New Issue
Block a user