Compare commits
14 Commits
15e66d29c4
...
0.5.0-rc1
Author | SHA1 | Date | |
---|---|---|---|
a4fdb97424 | |||
735a85b914 | |||
be0c71702b | |||
535959a6ed | |||
ae37b27dc0 | |||
80cc5fdbda | |||
87e406e903 | |||
f04d0ec299 | |||
a19057f869 | |||
d0d981b790 | |||
c95ae92ba8 | |||
31e9f1352b | |||
9974b25377 | |||
852c93c6d0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -61,6 +61,7 @@ crashlytics-build.properties
|
|||||||
#
|
#
|
||||||
/Docs
|
/Docs
|
||||||
/Issues
|
/Issues
|
||||||
|
/Local
|
||||||
/Obsolete
|
/Obsolete
|
||||||
/Snapshots
|
/Snapshots
|
||||||
/UI
|
/UI
|
||||||
|
Binary file not shown.
@@ -59,24 +59,27 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
|
|
||||||
public ResourceItemMeta GetItemMeta(int id) {
|
public ResourceItemMeta GetItemMeta(int id) {
|
||||||
var item = items[id];
|
var item = items[id];
|
||||||
AsyncDelivery<Texture2D> cover = null;
|
var meta = new ChartMeta();
|
||||||
var coverFile = item.GetFiles("cover.*");
|
|
||||||
if (coverFile.Length > 0) {
|
|
||||||
cover = new AsyncDelivery<Texture2D>();
|
|
||||||
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
|
||||||
cover.CancelSource = task.Cancel;
|
|
||||||
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
|
||||||
}
|
|
||||||
string name = item.Name;
|
string name = item.Name;
|
||||||
string desc = "(Unknown)";
|
string desc = "(Unknown)";
|
||||||
var metaFile = new FileInfo(item.FullName + "/meta.json");
|
var metaFile = new FileInfo(item.FullName + "/meta.json");
|
||||||
if (metaFile.Exists) {
|
if (metaFile.Exists) {
|
||||||
using (var reader = new StreamReader(metaFile.FullName)) {
|
using (var reader = new StreamReader(metaFile.FullName)) {
|
||||||
var meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
||||||
name = meta.song.name;
|
name = meta.song.name;
|
||||||
desc = meta.chart.name;
|
desc = meta.chart.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
AsyncDelivery<Texture2D> cover = null;
|
||||||
|
if (meta.cover != null && meta.cover != "") {
|
||||||
|
var coverFile = item.GetFiles(meta.cover);
|
||||||
|
if (coverFile.Length > 0) {
|
||||||
|
cover = new AsyncDelivery<Texture2D>();
|
||||||
|
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
||||||
|
cover.CancelSource = task.Cancel;
|
||||||
|
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
return new ResourceItemMeta {
|
return new ResourceItemMeta {
|
||||||
IsDirectory = false,
|
IsDirectory = false,
|
||||||
Icon = cover,
|
Icon = cover,
|
||||||
@@ -87,21 +90,23 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
|
|
||||||
public ChartDetail GetItemDetail(int id) {
|
public ChartDetail GetItemDetail(int id) {
|
||||||
var item = items[id];
|
var item = items[id];
|
||||||
AsyncDelivery<Texture2D> cover = null;
|
var meta = new ChartMeta();
|
||||||
var coverFile = item.GetFiles("cover.*");
|
|
||||||
if (coverFile.Length > 0) {
|
|
||||||
cover = new AsyncDelivery<Texture2D>();
|
|
||||||
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
|
||||||
cover.CancelSource = task.Cancel;
|
|
||||||
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
|
||||||
}
|
|
||||||
ChartMeta meta = new ChartMeta();
|
|
||||||
var metaFile = new FileInfo(item.FullName + "/meta.json");
|
var metaFile = new FileInfo(item.FullName + "/meta.json");
|
||||||
if (metaFile.Exists) {
|
if (metaFile.Exists) {
|
||||||
using (var reader = new StreamReader(metaFile.FullName)) {
|
using (var reader = new StreamReader(metaFile.FullName)) {
|
||||||
meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
meta = JsonConvert.DeserializeObject<ChartMeta>(reader.ReadToEnd());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
AsyncDelivery<Texture2D> cover = null;
|
||||||
|
if (meta.cover != null && meta.cover != "") {
|
||||||
|
var coverFile = item.GetFiles(meta.cover);
|
||||||
|
if (coverFile.Length > 0) {
|
||||||
|
cover = new AsyncDelivery<Texture2D>();
|
||||||
|
var task = new LoadTextureTask(Game.FileProtocolPrefix + coverFile[0].FullName, cover.Deliver);
|
||||||
|
cover.CancelSource = task.Cancel;
|
||||||
|
Game.NetworkTaskWorker.SubmitNetworkTask(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
return new ChartDetail {
|
return new ChartDetail {
|
||||||
Cover = cover,
|
Cover = cover,
|
||||||
Meta = meta,
|
Meta = meta,
|
||||||
@@ -143,7 +148,7 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
var tres = (CoverResource)res;
|
var tres = (CoverResource)res;
|
||||||
var dir = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
var dir = new DirectoryInfo(_rootPath + "/charts/" + res.Name);
|
||||||
if (!dir.Exists) dir.Create();
|
if (!dir.Exists) dir.Create();
|
||||||
var dest = new FileInfo(_rootPath + "/charts/" + res.Name + "/cover" + tres.Source.Extension);
|
var dest = new FileInfo(_rootPath + "/charts/" + res.Name + "/" + tres.Source.Name);
|
||||||
if (!dest.Exists) tres.Source.CopyTo(dest.FullName);
|
if (!dest.Exists) tres.Source.CopyTo(dest.FullName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
28
Assets/Cryville/Crtr/Browsing/PVPString.cs
Normal file
28
Assets/Cryville/Crtr/Browsing/PVPString.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace Cryville.Crtr.Browsing {
|
||||||
|
public class PVPString : PropertyValuePanel {
|
||||||
|
string m_value;
|
||||||
|
public override object Value {
|
||||||
|
get {
|
||||||
|
return m_value;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
m_value = (string)value;
|
||||||
|
_inputField.text = m_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InputField _inputField;
|
||||||
|
|
||||||
|
void Awake() {
|
||||||
|
_inputField = GetComponent<InputField>();
|
||||||
|
_inputField.onValueChanged.AddListener(OnValueChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnValueChanged(string value) {
|
||||||
|
m_value = value;
|
||||||
|
Callback(Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Cryville/Crtr/Browsing/PVPString.cs.meta
Normal file
11
Assets/Cryville/Crtr/Browsing/PVPString.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: aadf11739189bc94e9cb4f702eb7ccd3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@@ -10,6 +10,8 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
GameObject m_bool;
|
GameObject m_bool;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject m_number;
|
GameObject m_number;
|
||||||
|
[SerializeField]
|
||||||
|
GameObject m_string;
|
||||||
|
|
||||||
PropertyInfo _property;
|
PropertyInfo _property;
|
||||||
object _target;
|
object _target;
|
||||||
@@ -32,6 +34,7 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
GameObject vp;
|
GameObject vp;
|
||||||
if (prop.PropertyType == typeof(bool)) vp = m_bool;
|
if (prop.PropertyType == typeof(bool)) vp = m_bool;
|
||||||
else if (prop.PropertyType == typeof(float) || prop.PropertyType == typeof(int)) vp = m_number;
|
else if (prop.PropertyType == typeof(float) || prop.PropertyType == typeof(int)) vp = m_number;
|
||||||
|
else if (prop.PropertyType == typeof(string)) vp = m_string;
|
||||||
else return;
|
else return;
|
||||||
_value = GameObject.Instantiate(vp, _valueContainer, false).GetComponent<PropertyValuePanel>();
|
_value = GameObject.Instantiate(vp, _valueContainer, false).GetComponent<PropertyValuePanel>();
|
||||||
if (_value is PVPNumber) {
|
if (_value is PVPNumber) {
|
||||||
|
@@ -87,7 +87,6 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
void SetDataSettings(int id, ChartDetail detail) {
|
void SetDataSettings(int id, ChartDetail detail) {
|
||||||
Settings.Default.LoadRuleset = detail.Meta.ruleset + "/.umgr";
|
Settings.Default.LoadRuleset = detail.Meta.ruleset + "/.umgr";
|
||||||
Settings.Default.LoadRulesetConfig = detail.Meta.ruleset + ".json";
|
Settings.Default.LoadRulesetConfig = detail.Meta.ruleset + ".json";
|
||||||
Settings.Default.LoadSkin = detail.Meta.ruleset + "/Old KeyUI/.umgs";
|
|
||||||
Settings.Default.LoadChart = MainBrowser.ResourceManager.GetItemPath(id);
|
Settings.Default.LoadChart = MainBrowser.ResourceManager.GetItemPath(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,6 +107,7 @@ namespace Cryville.Crtr.Browsing {
|
|||||||
}
|
}
|
||||||
public string ruleset { get; set; }
|
public string ruleset { get; set; }
|
||||||
public int note_count { get; set; }
|
public int note_count { get; set; }
|
||||||
|
public string cover { get; set; }
|
||||||
}
|
}
|
||||||
#pragma warning restore IDE1006
|
#pragma warning restore IDE1006
|
||||||
}
|
}
|
||||||
|
@@ -52,6 +52,7 @@ namespace Cryville.Crtr {
|
|||||||
public static Rect hitRect;
|
public static Rect hitRect;
|
||||||
public static Plane[] frustumPlanes;
|
public static Plane[] frustumPlanes;
|
||||||
|
|
||||||
|
RulesetConfig _rscfg;
|
||||||
static bool disableGC = true;
|
static bool disableGC = true;
|
||||||
static float clippingDist = 1f;
|
static float clippingDist = 1f;
|
||||||
static float renderDist = 6f;
|
static float renderDist = 6f;
|
||||||
@@ -84,7 +85,14 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
texHandler = new DownloadHandlerTexture();
|
texHandler = new DownloadHandlerTexture();
|
||||||
#if BUILD
|
#if BUILD
|
||||||
Play();
|
try {
|
||||||
|
Play();
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Game.LogException("Load/WorkerThread", "An error occured while loading the data", ex);
|
||||||
|
Popup.CreateException(ex);
|
||||||
|
ReturnToMenu();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Camera.main.RenderToCubemap();
|
// Camera.main.RenderToCubemap();
|
||||||
@@ -159,25 +167,18 @@ namespace Cryville.Crtr {
|
|||||||
var tex = texHandler.texture;
|
var tex = texHandler.texture;
|
||||||
tex.wrapMode = TextureWrapMode.Clamp;
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
texs.Add(name, tex);
|
texs.Add(name, tex);
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.downloadedBytes);
|
|
||||||
texLoader.Dispose();
|
texLoader.Dispose();
|
||||||
texHandler.Dispose();
|
texHandler.Dispose();
|
||||||
texLoader = null;
|
texLoader = null;
|
||||||
}
|
}
|
||||||
else if (texLoader.downloadProgress != 0) {
|
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loading texture {0} {1:P0}", name, texLoader.downloadProgress);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if (texLoader.isDone) {
|
if (texLoader.isDone) {
|
||||||
var tex = texLoader.texture;
|
var tex = texLoader.texture;
|
||||||
texs.Add(name, tex);
|
tex.wrapMode = TextureWrapMode.Clamp;
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loaded texture {0} ({1} bytes)", name, texLoader.bytesDownloaded);
|
texs.Add(name, tex);
|
||||||
texLoader.Dispose();
|
texLoader.Dispose();
|
||||||
texLoader = null;
|
texLoader = null;
|
||||||
}
|
}
|
||||||
else if (texLoader.progress != 0) {
|
|
||||||
Logger.Log("main", 0, "Load/MainThread", "Loading texture {0} {1:P0}", name, texLoader.progress);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (texLoader == null)
|
if (texLoader == null)
|
||||||
@@ -308,7 +309,6 @@ namespace Cryville.Crtr {
|
|||||||
autoRenderStep = renderStep == 0;
|
autoRenderStep = renderStep == 0;
|
||||||
soundOffset = Settings.Default.SoundOffset;
|
soundOffset = Settings.Default.SoundOffset;
|
||||||
startOffset = Settings.Default.StartOffset;
|
startOffset = Settings.Default.StartOffset;
|
||||||
sv = Settings.Default.ScrollVelocity;
|
|
||||||
firstFrame = true;
|
firstFrame = true;
|
||||||
texloaddone = false;
|
texloaddone = false;
|
||||||
Game.NetworkTaskWorker.SuspendBackgroundTasks();
|
Game.NetworkTaskWorker.SuspendBackgroundTasks();
|
||||||
@@ -332,20 +332,31 @@ namespace Cryville.Crtr {
|
|||||||
FileInfo chartFile = new FileInfo(
|
FileInfo chartFile = new FileInfo(
|
||||||
Game.GameDataPath + "/charts/" + Settings.Default.LoadChart
|
Game.GameDataPath + "/charts/" + Settings.Default.LoadChart
|
||||||
);
|
);
|
||||||
|
|
||||||
FileInfo rulesetFile = new FileInfo(
|
FileInfo rulesetFile = new FileInfo(
|
||||||
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
|
Game.GameDataPath + "/rulesets/" + Settings.Default.LoadRuleset
|
||||||
);
|
);
|
||||||
|
if (!rulesetFile.Exists) throw new FileNotFoundException("Ruleset for the chart not found\nMake sure you have imported the ruleset");
|
||||||
|
|
||||||
FileInfo rulesetConfigFile = new FileInfo(
|
FileInfo rulesetConfigFile = new FileInfo(
|
||||||
Game.GameDataPath + "/config/rulesets/" + Settings.Default.LoadRulesetConfig
|
Game.GameDataPath + "/config/rulesets/" + Settings.Default.LoadRulesetConfig
|
||||||
);
|
);
|
||||||
|
if (!rulesetConfigFile.Exists) throw new FileNotFoundException("Ruleset config not found\nPlease open the config to generate");
|
||||||
|
using (StreamReader cfgreader = new StreamReader(rulesetConfigFile.FullName, Encoding.UTF8)) {
|
||||||
|
_rscfg = JsonConvert.DeserializeObject<RulesetConfig>(cfgreader.ReadToEnd(), new JsonSerializerSettings() {
|
||||||
|
MissingMemberHandling = MissingMemberHandling.Error
|
||||||
|
});
|
||||||
|
}
|
||||||
|
sv = _rscfg.generic.ScrollVelocity;
|
||||||
|
|
||||||
FileInfo skinFile = new FileInfo(
|
FileInfo skinFile = new FileInfo(
|
||||||
Game.GameDataPath + "/skins/" + Settings.Default.LoadSkin
|
string.Format("{0}/skins/{1}/{2}/.umgs", Game.GameDataPath, rulesetFile.Directory.Name, _rscfg.generic.Skin)
|
||||||
);
|
);
|
||||||
|
if (!skinFile.Exists) throw new FileNotFoundException("Skin not found\nPlease specify an available skin in the config");
|
||||||
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
loadThread = new Thread(new ParameterizedThreadStart(Load));
|
||||||
loadThread.Start(new LoadInfo() {
|
loadThread.Start(new LoadInfo() {
|
||||||
chartFile = chartFile,
|
chartFile = chartFile,
|
||||||
rulesetFile = rulesetFile,
|
rulesetFile = rulesetFile,
|
||||||
rulesetConfigFile = rulesetConfigFile,
|
|
||||||
skinFile = skinFile,
|
skinFile = skinFile,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -400,6 +411,7 @@ namespace Cryville.Crtr {
|
|||||||
try {
|
try {
|
||||||
Logger.Log("main", 1, "Game", "Stopping");
|
Logger.Log("main", 1, "Game", "Stopping");
|
||||||
Game.AudioSession = Game.AudioSequencer.NewSession();
|
Game.AudioSession = Game.AudioSequencer.NewSession();
|
||||||
|
inputProxy.Deactivate();
|
||||||
if (cbus != null) { cbus.Dispose(); cbus = null; }
|
if (cbus != null) { cbus.Dispose(); cbus = null; }
|
||||||
if (bbus != null) { bbus.Dispose(); bbus = null; }
|
if (bbus != null) { bbus.Dispose(); bbus = null; }
|
||||||
if (tbus != null) { tbus.Dispose(); tbus = null; }
|
if (tbus != null) { tbus.Dispose(); tbus = null; }
|
||||||
@@ -434,7 +446,6 @@ namespace Cryville.Crtr {
|
|||||||
struct LoadInfo {
|
struct LoadInfo {
|
||||||
public FileInfo chartFile;
|
public FileInfo chartFile;
|
||||||
public FileInfo rulesetFile;
|
public FileInfo rulesetFile;
|
||||||
public FileInfo rulesetConfigFile;
|
|
||||||
public FileInfo skinFile;
|
public FileInfo skinFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,7 +483,7 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
etor = new PdtEvaluator();
|
etor = new PdtEvaluator();
|
||||||
|
|
||||||
LoadRuleset(info.rulesetFile, info.rulesetConfigFile);
|
LoadRuleset(info.rulesetFile);
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Applying ruleset (iteration 1)");
|
Logger.Log("main", 0, "Load/WorkerThread", "Applying ruleset (iteration 1)");
|
||||||
pruleset.PrePatch(chart);
|
pruleset.PrePatch(chart);
|
||||||
|
|
||||||
@@ -531,8 +542,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RulesetConfig _rscfg;
|
void LoadRuleset(FileInfo file) {
|
||||||
void LoadRuleset(FileInfo file, FileInfo cfgfile) {
|
|
||||||
DirectoryInfo dir = file.Directory;
|
DirectoryInfo dir = file.Directory;
|
||||||
Logger.Log("main", 0, "Load/WorkerThread", "Loading ruleset: {0}", file);
|
Logger.Log("main", 0, "Load/WorkerThread", "Loading ruleset: {0}", file);
|
||||||
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
using (StreamReader reader = new StreamReader(file.FullName, Encoding.UTF8)) {
|
||||||
@@ -542,12 +552,6 @@ namespace Cryville.Crtr {
|
|||||||
if (ruleset.format != 1) throw new FormatException("Invalid ruleset file version");
|
if (ruleset.format != 1) throw new FormatException("Invalid ruleset file version");
|
||||||
ruleset.LoadPdt(dir);
|
ruleset.LoadPdt(dir);
|
||||||
pruleset = ruleset.Root;
|
pruleset = ruleset.Root;
|
||||||
if (!cfgfile.Exists) throw new FileNotFoundException("Ruleset config not found\nPlease open the config to generate");
|
|
||||||
using (StreamReader cfgreader = new StreamReader(cfgfile.FullName, Encoding.UTF8)) {
|
|
||||||
_rscfg = JsonConvert.DeserializeObject<RulesetConfig>(cfgreader.ReadToEnd(), new JsonSerializerSettings() {
|
|
||||||
MissingMemberHandling = MissingMemberHandling.Error
|
|
||||||
});
|
|
||||||
}
|
|
||||||
pruleset.Optimize(etor);
|
pruleset.Optimize(etor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
@@ -10,6 +10,9 @@ namespace Cryville.Crtr.Config {
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
Transform m_content;
|
Transform m_content;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
SettingsPanel m_genericConfigPanel;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
InputConfigPanel m_inputConfigPanel;
|
InputConfigPanel m_inputConfigPanel;
|
||||||
|
|
||||||
@@ -43,6 +46,9 @@ namespace Cryville.Crtr.Config {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_genericConfigPanel.Target = _rscfg.generic;
|
||||||
|
|
||||||
var proxy = new InputProxy(ruleset.Root, null);
|
var proxy = new InputProxy(ruleset.Root, null);
|
||||||
proxy.LoadFrom(_rscfg.inputs);
|
proxy.LoadFrom(_rscfg.inputs);
|
||||||
m_inputConfigPanel.proxy = proxy;
|
m_inputConfigPanel.proxy = proxy;
|
||||||
|
@@ -1,12 +1,32 @@
|
|||||||
using System.Collections.Generic;
|
using Cryville.Common.ComponentModel;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Cryville.Crtr.Config {
|
namespace Cryville.Crtr.Config {
|
||||||
public class RulesetConfig {
|
public class RulesetConfig {
|
||||||
public Dictionary<string, InputConfigEntry> inputs
|
public Generic generic = new Generic();
|
||||||
= new Dictionary<string, InputConfigEntry>();
|
public class Generic {
|
||||||
}
|
[Category("basic")]
|
||||||
public class InputConfigEntry {
|
[JsonProperty("skin")]
|
||||||
public string handler;
|
public string Skin { get; set; }
|
||||||
public int type;
|
|
||||||
|
[Category("deprecated")][Obsolete]
|
||||||
|
[JsonProperty("scroll_velocity")][DefaultValue(1)]
|
||||||
|
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
||||||
|
public float ScrollVelocity { get; set; }
|
||||||
|
|
||||||
|
public Generic() {
|
||||||
|
Skin = "";
|
||||||
|
ScrollVelocity = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Dictionary<string, InputEntry> inputs
|
||||||
|
= new Dictionary<string, InputEntry>();
|
||||||
|
public class InputEntry {
|
||||||
|
public string handler;
|
||||||
|
public int type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
public override IEnumerable<Resource> ConvertFrom(FileInfo file) {
|
||||||
List<Resource> result = new List<Resource>();
|
List<Resource> result = new List<Resource>();
|
||||||
MalodyChart src;
|
MalodyChart src;
|
||||||
|
if (file.Extension != ".mc") throw new NotImplementedException("mcz file is not supported");
|
||||||
using (var reader = new StreamReader(file.FullName)) {
|
using (var reader = new StreamReader(file.FullName)) {
|
||||||
src = JsonConvert.DeserializeObject<MalodyChart>(reader.ReadToEnd());
|
src = JsonConvert.DeserializeObject<MalodyChart>(reader.ReadToEnd());
|
||||||
}
|
}
|
||||||
@@ -148,9 +149,11 @@ namespace Cryville.Crtr.Extensions.Malody {
|
|||||||
};
|
};
|
||||||
meta.note_count = group.notes.Count;
|
meta.note_count = group.notes.Count;
|
||||||
string chartName = string.Format("{0} - {1}", meta.song.name, meta.chart.name);
|
string chartName = string.Format("{0} - {1}", meta.song.name, meta.chart.name);
|
||||||
result.Add(new ChartResource(chartName, chart, meta));
|
if (src.meta.background != null) {
|
||||||
if (src.meta.background != null)
|
|
||||||
result.Add(new CoverResource(chartName, new FileInfo(file.DirectoryName + "/" + src.meta.background)));
|
result.Add(new CoverResource(chartName, new FileInfo(file.DirectoryName + "/" + src.meta.background)));
|
||||||
|
meta.cover = src.meta.background;
|
||||||
|
}
|
||||||
|
result.Add(new ChartResource(chartName, chart, meta));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ namespace Cryville.Crtr {
|
|||||||
readonly Dictionary<string, int> _use = new Dictionary<string, int>();
|
readonly Dictionary<string, int> _use = new Dictionary<string, int>();
|
||||||
readonly Dictionary<string, List<string>> _rev = new Dictionary<string, List<string>>();
|
readonly Dictionary<string, List<string>> _rev = new Dictionary<string, List<string>>();
|
||||||
public event EventHandler<ProxyChangedEventArgs> ProxyChanged;
|
public event EventHandler<ProxyChangedEventArgs> ProxyChanged;
|
||||||
public void LoadFrom(Dictionary<string, InputConfigEntry> config) {
|
public void LoadFrom(Dictionary<string, RulesetConfig.InputEntry> config) {
|
||||||
foreach (var cfg in config) {
|
foreach (var cfg in config) {
|
||||||
Set(new InputProxyEntry {
|
Set(new InputProxyEntry {
|
||||||
Target = cfg.Key,
|
Target = cfg.Key,
|
||||||
@@ -48,10 +48,10 @@ namespace Cryville.Crtr {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void SaveTo(Dictionary<string, InputConfigEntry> config) {
|
public void SaveTo(Dictionary<string, RulesetConfig.InputEntry> config) {
|
||||||
config.Clear();
|
config.Clear();
|
||||||
foreach (var p in _tproxies) {
|
foreach (var p in _tproxies) {
|
||||||
config.Add(p.Key, new InputConfigEntry {
|
config.Add(p.Key, new RulesetConfig.InputEntry {
|
||||||
handler = ReflectionHelper.GetNamespaceQualifiedName(p.Value.Source.Value.Handler.GetType()),
|
handler = ReflectionHelper.GetNamespaceQualifiedName(p.Value.Source.Value.Handler.GetType()),
|
||||||
type = p.Value.Source.Value.Type
|
type = p.Value.Source.Value.Type
|
||||||
});
|
});
|
||||||
|
@@ -116,8 +116,8 @@ namespace Cryville.Crtr {
|
|||||||
if (def.scores != null) UpdateScore(def.scores);
|
if (def.scores != null) UpdateScore(def.scores);
|
||||||
if (def.pass != null) Pass(def.pass);
|
if (def.pass != null) Pass(def.pass);
|
||||||
actlist.RemoveAt(index);
|
actlist.RemoveAt(index);
|
||||||
if (def.stack != def.prop && actlist.Count > 0) {
|
if (def.prop != 0 && actlist.Count > 0) {
|
||||||
index = BinarySearchFirst(actlist, ev.StartClip, def.prop);
|
index = BinarySearchFirst(actlist, ev.StartClip, def.stack - def.prop);
|
||||||
if (index < 0) index = ~index;
|
if (index < 0) index = ~index;
|
||||||
}
|
}
|
||||||
else index++;
|
else index++;
|
||||||
@@ -216,7 +216,7 @@ namespace Cryville.Crtr {
|
|||||||
public Identifier[] miss;
|
public Identifier[] miss;
|
||||||
public Dictionary<ScoreOperation, PdtExpression> scores;
|
public Dictionary<ScoreOperation, PdtExpression> scores;
|
||||||
public int stack;
|
public int stack;
|
||||||
public int prop = -1;
|
public int prop = 1;
|
||||||
}
|
}
|
||||||
public class ScoreOperation {
|
public class ScoreOperation {
|
||||||
public Identifier name;
|
public Identifier name;
|
||||||
|
@@ -112,7 +112,7 @@ namespace Cryville.Crtr {
|
|||||||
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
||||||
public float RenderDistance {
|
public float RenderDistance {
|
||||||
get {
|
get {
|
||||||
return PlayerPrefs.GetFloat("RenderDistance", 6);
|
return PlayerPrefs.GetFloat("RenderDistance", 4);
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
PlayerPrefs.SetFloat("RenderDistance", value);
|
PlayerPrefs.SetFloat("RenderDistance", value);
|
||||||
@@ -131,17 +131,6 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Category("gameplay")]
|
|
||||||
[LogarithmicScale][Step(0.5f)][Precision(1e-1)]
|
|
||||||
public float ScrollVelocity {
|
|
||||||
get {
|
|
||||||
return PlayerPrefs.GetFloat("ScrollVelocity", 1);
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
PlayerPrefs.SetFloat("ScrollVelocity", value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Category("gameplay")]
|
[Category("gameplay")]
|
||||||
[Step(0.04f)][Precision(1e-3)]
|
[Step(0.04f)][Precision(1e-3)]
|
||||||
public float SoundOffset {
|
public float SoundOffset {
|
||||||
|
24
Assets/MsvcStdextWorkaround.cs
Normal file
24
Assets/MsvcStdextWorkaround.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
using System;
|
||||||
|
using UnityEditor.Build;
|
||||||
|
using UnityEditor.Build.Reporting;
|
||||||
|
|
||||||
|
public class MsvcStdextWorkaround : IPreprocessBuildWithReport {
|
||||||
|
const string kWorkaroundFlag = "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS";
|
||||||
|
|
||||||
|
public int callbackOrder => 0;
|
||||||
|
|
||||||
|
public void OnPreprocessBuild(BuildReport report) {
|
||||||
|
var clEnv = Environment.GetEnvironmentVariable("_CL_");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(clEnv)) {
|
||||||
|
Environment.SetEnvironmentVariable("_CL_", kWorkaroundFlag);
|
||||||
|
}
|
||||||
|
else if (!clEnv.Contains(kWorkaroundFlag)) {
|
||||||
|
clEnv += " " + kWorkaroundFlag;
|
||||||
|
Environment.SetEnvironmentVariable("_CL_", clEnv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // UNITY_EDITOR
|
11
Assets/MsvcStdextWorkaround.cs.meta
Normal file
11
Assets/MsvcStdextWorkaround.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9ed0687e714ce1042921c0057f42039f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
BIN
Assets/Prefabs/PVString.prefab
Normal file
BIN
Assets/Prefabs/PVString.prefab
Normal file
Binary file not shown.
7
Assets/Prefabs/PVString.prefab.meta
Normal file
7
Assets/Prefabs/PVString.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d3142009b74dda042a75e9b808dde66d
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
Binary file not shown.
1
Assets/Resources/default.txt
Symbolic link
1
Assets/Resources/default.txt
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../Local/default_resources.zip
|
Reference in New Issue
Block a user