11 Commits

24 changed files with 95 additions and 45 deletions

View File

@@ -84,7 +84,7 @@ namespace Cryville.Common.Buffers {
} }
class Enumerator : IEnumerator<char> { class Enumerator : IEnumerator<char> {
TargetString _self; readonly TargetString _self;
int _index = -1; int _index = -1;
public Enumerator(TargetString self) { _self = self; } public Enumerator(TargetString self) { _self = self; }

View File

@@ -10,10 +10,10 @@ namespace Cryville.Common {
/// </summary> /// </summary>
public static IdentifierManager SharedInstance = new IdentifierManager(); public static IdentifierManager SharedInstance = new IdentifierManager();
Dictionary<object, int> _idents = new Dictionary<object, int>(); readonly Dictionary<object, int> _idents = new Dictionary<object, int>();
List<object> _ids = new List<object>(); readonly List<object> _ids = new List<object>();
object _syncRoot = new object(); readonly object _syncRoot = new object();
/// <summary> /// <summary>
/// Creates an instance of the <see cref="IdentifierManager" /> class. /// Creates an instance of the <see cref="IdentifierManager" /> class.

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.IO; using System.IO;
namespace Cryville.Common { namespace Cryville.Common {
@@ -40,7 +41,7 @@ namespace Cryville.Common {
public static void Create(string key, Logger logger) { public static void Create(string key, Logger logger) {
Instances[key] = logger; Instances[key] = logger;
if (logPath != null) { if (logPath != null) {
Files[key] = new StreamWriter(logPath + "/" + ((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds).ToString() + "-" + key + ".log") { Files[key] = new StreamWriter(logPath + "/" + ((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds).ToString(CultureInfo.InvariantCulture) + "-" + key + ".log") {
AutoFlush = true AutoFlush = true
}; };
} }

View File

@@ -77,7 +77,7 @@ namespace Cryville.Common.Network {
encoding = Encoding.UTF8; encoding = Encoding.UTF8;
payload = encoding.GetBytes(body); payload = encoding.GetBytes(body);
headers.Add("Content-Encoding", encoding.EncodingName); headers.Add("Content-Encoding", encoding.EncodingName);
headers.Add("Content-Length", payload.Length.ToString()); headers.Add("Content-Length", payload.Length.ToString(CultureInfo.InvariantCulture));
} }
string request_line = string.Format( string request_line = string.Format(
"{0} {1} {2}\r\n", method, uri, Version "{0} {1} {2}\r\n", method, uri, Version

View File

@@ -28,7 +28,7 @@ namespace Cryville.Common.Network {
} }
private class InternalTlsClient : DefaultTlsClient { private class InternalTlsClient : DefaultTlsClient {
string _host; readonly string _host;
public InternalTlsClient(string host, TlsCrypto crypto) : base(crypto) { public InternalTlsClient(string host, TlsCrypto crypto) : base(crypto) {
_host = host; _host = host;

View File

@@ -3,6 +3,7 @@ using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Globalization;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@@ -303,7 +304,7 @@ namespace Cryville.Crtr {
var node = RelativeNode; var node = RelativeNode;
result += "#" + node.Id; result += "#" + node.Id;
if (node.Time != null) result += "@" + node.Time.ToString(); if (node.Time != null) result += "@" + node.Time.ToString();
if (node.Transition != null) result = "^" + node.Transition.ToString(); if (node.Transition != null) result = "^" + ((byte)node.Transition).ToString(CultureInfo.InvariantCulture);
if (node.Rate != null) result += "*" + node.Rate.ToString(); if (node.Rate != null) result += "*" + node.Rate.ToString();
if (node.Value != null) result += ":" + node.Value.ToString(); if (node.Value != null) result += ":" + node.Value.ToString();
} }
@@ -391,10 +392,12 @@ namespace Cryville.Crtr {
public class Judge : ChartEvent { public class Judge : ChartEvent {
[JsonIgnore] [JsonIgnore]
public Identifier Id; public Identifier Id;
#pragma warning disable IDE1006
public string name { public string name {
get { return Id.ToString(); } get { return Id.ToString(); }
set { Id = new Identifier(value); } set { Id = new Identifier(value); }
} }
#pragma warning restore IDE1006
public override int Priority { public override int Priority {
get { return 0; } get { return 0; }

View File

@@ -399,12 +399,16 @@ namespace Cryville.Crtr {
Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 4)"); Logger.Log("main", 0, "Load/Prehandle", "Prehandling (iteration 4)");
cbus.BroadcastPostInit(); cbus.BroadcastPostInit();
inputProxy.Activate(); inputProxy.Activate();
if (logEnabled) ToggleLogs(); if (logEnabled && Settings.Default.HideLogOnPlay) ToggleLogs();
Logger.Log("main", 0, "Load/Prehandle", "Cleaning up"); Logger.Log("main", 0, "Load/Prehandle", "Cleaning up");
GC.Collect(); GC.Collect();
if (disableGC) GarbageCollector.GCMode = GarbageCollector.Mode.Disabled; if (disableGC) GarbageCollector.GCMode = GarbageCollector.Mode.Disabled;
timer.Stop(); timer.Stop();
Logger.Log("main", 1, "Load/Prehandle", "Prehandling done ({0}ms)", timer.Elapsed.TotalMilliseconds); Logger.Log("main", 1, "Load/Prehandle", "Prehandling done ({0}ms)", timer.Elapsed.TotalMilliseconds);
if (Settings.Default.ClearLogOnPlay) {
logs.text = "";
Game.MainLogger.Enumerate((level, module, msg) => { });
}
Game.AudioSequencer.Playing = true; Game.AudioSequencer.Playing = true;
atime0 = Game.AudioClient.BufferPosition; atime0 = Game.AudioClient.BufferPosition;
Thread.Sleep((int)((atime0 - Game.AudioClient.Position) * 1000)); Thread.Sleep((int)((atime0 - Game.AudioClient.Position) * 1000));

View File

@@ -22,7 +22,9 @@ namespace Cryville.Crtr.Components {
} }
protected void UpdateZIndex() { protected void UpdateZIndex() {
if (!mesh.Initialized) return; if (!mesh.Initialized) return;
mesh.Renderer.material.renderQueue = _zindex; foreach (var mat in mesh.Renderer.materials) {
mat.renderQueue = _zindex;
}
} }
} }
} }

View File

@@ -110,6 +110,7 @@ namespace Cryville.Crtr.Components {
if (body.FrameName != null) AddMat(materials, body.FrameName); if (body.FrameName != null) AddMat(materials, body.FrameName);
if (tail.FrameName != null) AddMat(materials, tail.FrameName); if (tail.FrameName != null) AddMat(materials, tail.FrameName);
mesh.Renderer.materials = materials.ToArray(); mesh.Renderer.materials = materials.ToArray();
UpdateZIndex();
} }
void AddMat(List<Material> list, string frame) { void AddMat(List<Material> list, string frame) {

View File

@@ -25,13 +25,14 @@ namespace Cryville.Crtr.Config {
GameObject m_prefabInputConfigEntry; GameObject m_prefabInputConfigEntry;
public InputProxy proxy; public InputProxy proxy;
Dictionary<string, InputConfigPanelEntry> _entries = new Dictionary<string, InputConfigPanelEntry>(); readonly Dictionary<string, InputConfigPanelEntry> _entries = new Dictionary<string, InputConfigPanelEntry>();
string _sel; string _sel;
public void OpenDialog(string entry) { public void OpenDialog(string entry) {
_sel = entry; _sel = entry;
m_inputDialog.SetActive(true); m_inputDialog.SetActive(true);
CallHelper.Purge(m_deviceList); CallHelper.Purge(m_deviceList);
Game.InputManager.EnumerateEvents(ev => { });
_recvsrcs.Clear(); _recvsrcs.Clear();
AddSourceItem(null); AddSourceItem(null);
} }

View File

@@ -1,6 +1,7 @@
using Cryville.Crtr.Components; using Cryville.Crtr.Components;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using UnityEngine; using UnityEngine;
namespace Cryville.Crtr.Event { namespace Cryville.Crtr.Event {
@@ -75,7 +76,7 @@ namespace Cryville.Crtr.Event {
get; get;
} }
public virtual void PreInit() { public virtual void PreInit() {
gogroup = new GameObject(TypeName + ":" + Container.GetHashCode().ToString()).transform; gogroup = new GameObject(TypeName + ":" + Container.GetHashCode().ToString(CultureInfo.InvariantCulture)).transform;
if (cs.Parent != null) if (cs.Parent != null)
gogroup.SetParent(cs.Parent.Handler.gogroup, false); gogroup.SetParent(cs.Parent.Handler.gogroup, false);
a_head = new GameObject("::head").transform; a_head = new GameObject("::head").transform;

View File

@@ -186,7 +186,6 @@ namespace Cryville.Crtr.Event {
child.Value.CopyTo(ct, dest.Children[child.Key]); child.Value.CopyTo(ct, dest.Children[child.Key]);
ValidateChildren(); ValidateChildren();
RMVPool.ReturnAll();
dest.PlayingMotions.Clear(); dest.PlayingMotions.Clear();
foreach (var m in PlayingMotions) dest.PlayingMotions.Add(m.Key, m.Value); foreach (var m in PlayingMotions) dest.PlayingMotions.Add(m.Key, m.Value);
} }
@@ -324,11 +323,14 @@ namespace Cryville.Crtr.Event {
if (ev.Unstamped is Chart.Motion) { if (ev.Unstamped is Chart.Motion) {
var tev = (Chart.Motion)ev.Unstamped; var tev = (Chart.Motion)ev.Unstamped;
var mv = RMVPool.Rent(tev.Name); var mv = RMVPool.Rent(tev.Name);
mv.CloneTypeFlag = CloneType;
GetMotionValue(tev.Name).CopyTo(mv); GetMotionValue(tev.Name).CopyTo(mv);
PlayingMotions.Add(ev, mv); PlayingMotions.Add(ev, mv);
Callback(ev, callback); Callback(ev, callback);
if (!ev.Unstamped.IsLong) if (!ev.Unstamped.IsLong) {
PlayingMotions.Remove(ev); PlayingMotions.Remove(ev);
RMVPool.Return(mv);
}
} }
else if (ev.Unstamped is EventContainer) { else if (ev.Unstamped is EventContainer) {
var cev = (EventContainer)ev.Unstamped; var cev = (EventContainer)ev.Unstamped;
@@ -348,6 +350,8 @@ namespace Cryville.Crtr.Event {
var nev = tev.Original; var nev = tev.Original;
if (nev is Chart.Motion) { if (nev is Chart.Motion) {
Callback(ev, callback); Callback(ev, callback);
var mv = PlayingMotions[ev.Origin];
if (mv.CloneTypeFlag == CloneType) RMVPool.Return(mv);
PlayingMotions.Remove(ev.Origin); PlayingMotions.Remove(ev.Origin);
} }
else if (nev is EventContainer) { else if (nev is EventContainer) {

View File

@@ -6,6 +6,7 @@ using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.IO; using System.IO;
namespace Cryville.Crtr.Extensions.Bestdori { namespace Cryville.Crtr.Extensions.Bestdori {
@@ -62,7 +63,7 @@ namespace Cryville.Crtr.Extensions.Bestdori {
group.notes.Add(new Chart.Note { group.notes.Add(new Chart.Note {
time = ToBeatTime(tev.beat), time = ToBeatTime(tev.beat),
judges = new List<Chart.Judge> { new Chart.Judge { name = tev.flick ? "single_flick" : "single" } }, judges = new List<Chart.Judge> { new Chart.Judge { name = tev.flick ? "single_flick" : "single" } },
motions = new List<Chart.Motion> { new Chart.Motion { motion = "track:" + tev.lane.ToString() } }, motions = new List<Chart.Motion> { new Chart.Motion { motion = "track:" + tev.lane.ToString(CultureInfo.InvariantCulture) } },
}); });
} }
else if (ev is BestdoriChartEvent.Long) { else if (ev is BestdoriChartEvent.Long) {
@@ -75,13 +76,17 @@ namespace Cryville.Crtr.Extensions.Bestdori {
}; };
for (int i = 0; i < tev.connections.Count; i++) { for (int i = 0; i < tev.connections.Count; i++) {
BestdoriChartEvent.Connection c = tev.connections[i]; BestdoriChartEvent.Connection c = tev.connections[i];
note.motions.Add(new Chart.Motion { motion = "track:" + c.lane.ToString() }); if (i == 0) {
if (i == 0)
note.judges.Add(new Chart.Judge { name = "single" }); note.judges.Add(new Chart.Judge { name = "single" });
else if (i == tev.connections.Count - 1) note.motions.Add(new Chart.Motion { motion = "track:" + c.lane.ToString(CultureInfo.InvariantCulture) });
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = c.flick ? "longend_flick" : "longend" }); }
else if (!c.hidden) else {
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = "longnode" }); note.motions.Add(new Chart.Motion { time = ToBeatTime(tev.connections[i - 1].beat), endtime = ToBeatTime(c.beat), motion = "track:" + c.lane.ToString(CultureInfo.InvariantCulture) });
if (i == tev.connections.Count - 1)
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = c.flick ? "longend_flick" : "longend" });
else if (!c.hidden)
note.judges.Add(new Chart.Judge { time = ToBeatTime(c.beat), name = "longnode" });
}
} }
if (c1.beat > endbeat) endbeat = c1.beat; if (c1.beat > endbeat) endbeat = c1.beat;
group.notes.Add(note); group.notes.Add(note);
@@ -89,7 +94,7 @@ namespace Cryville.Crtr.Extensions.Bestdori {
else throw new NotImplementedException("Unsupported event: " + ev.type); else throw new NotImplementedException("Unsupported event: " + ev.type);
} }
if (bgm == null) throw new FormatException("Chart contains no song"); if (bgm == null) throw new FormatException("Chart contains no song");
chart.endtime = ToBeatTime(endbeat); chart.endtime = ToBeatTime(endbeat + 4);
result.Add(new RawChartResource(string.Format("bang_dream_girls_band_party__{0}__{1}", bgm, StringUtils.TrimExt(file.Name)), chart, new ChartMeta { result.Add(new RawChartResource(string.Format("bang_dream_girls_band_party__{0}__{1}", bgm, StringUtils.TrimExt(file.Name)), chart, new ChartMeta {
name = string.Format("Bandori {0} {1}", bgm, StringUtils.TrimExt(file.Name)), name = string.Format("Bandori {0} {1}", bgm, StringUtils.TrimExt(file.Name)),
author = "©BanG Dream! Project ©Craft Egg Inc. ©bushiroad", author = "©BanG Dream! Project ©Craft Egg Inc. ©bushiroad",

View File

@@ -23,7 +23,6 @@ namespace Cryville.Crtr.Extensions.Malody {
src = JsonConvert.DeserializeObject<MalodyChart>(reader.ReadToEnd()); src = JsonConvert.DeserializeObject<MalodyChart>(reader.ReadToEnd());
} }
if (src.meta.mode != 0) throw new NotImplementedException("The chart mode is not supported"); if (src.meta.mode != 0) throw new NotImplementedException("The chart mode is not supported");
if (src.meta.mode_ext.column != 4) throw new NotImplementedException("The key count is not supported");
var ruleset = "malody!" + MODES[src.meta.mode]; var ruleset = "malody!" + MODES[src.meta.mode];
if (src.meta.mode == 0) { if (src.meta.mode == 0) {
@@ -91,14 +90,14 @@ namespace Cryville.Crtr.Extensions.Malody {
}); });
chart.motions.Add(new Chart.Motion { chart.motions.Add(new Chart.Motion {
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]), time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
motion = "svm:" + (tev.bpm / baseBpm).ToString() motion = "svm:" + (tev.bpm / baseBpm.Value).ToString(CultureInfo.InvariantCulture)
}); });
} }
else if (ev is MalodyChart.Effect) { else if (ev is MalodyChart.Effect) {
var tev = (MalodyChart.Effect)ev; var tev = (MalodyChart.Effect)ev;
if (tev.scroll != null) group.motions.Add(new Chart.Motion { if (tev.scroll != null) group.motions.Add(new Chart.Motion {
time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]), time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]),
motion = "svm:" + tev.scroll.ToString() motion = "svm:" + tev.scroll.Value.ToString(CultureInfo.InvariantCulture)
}); });
} }
else if (ev is MalodyChart.Note) { else if (ev is MalodyChart.Note) {
@@ -120,7 +119,7 @@ namespace Cryville.Crtr.Extensions.Malody {
var rn = new Chart.Note() { var rn = new Chart.Note() {
time = new BeatTime(tev.beat[0], tev.beat[1], tev.beat[2]), time = new BeatTime(tev.beat[0], tev.beat[1], tev.beat[2]),
motions = new List<Chart.Motion> { motions = new List<Chart.Motion> {
new Chart.Motion() { motion = "track:" + tev.column.ToString() } new Chart.Motion() { motion = "track:" + tev.column.ToString(CultureInfo.InvariantCulture) }
}, },
}; };
if (tev.endbeat != null) { if (tev.endbeat != null) {

View File

@@ -225,7 +225,7 @@ namespace Cryville.Crtr {
_etor.ContextCascadeDiscard(); _etor.ContextCascadeDiscard();
if (tv.Type == PdtInternalType.Null) _activeCounts[id.Source]--; if (tv.Type == PdtInternalType.Null) _activeCounts[id.Source]--;
} }
_judge.Cleanup(target, ft, tt); _judge.Cleanup(target, tt);
_vecs[pid] = tv; _vecs[pid] = tv;
} }
} }

View File

@@ -89,10 +89,12 @@ namespace Cryville.Crtr {
int num3 = num + (num2 - num >> 1); int num3 = num + (num2 - num >> 1);
int num4 = -list[num3].Definition.stack.CompareTo(stack); int num4 = -list[num3].Definition.stack.CompareTo(stack);
if (num4 == 0) num4 = list[num3].StartClip.CompareTo(time); if (num4 == 0) num4 = list[num3].StartClip.CompareTo(time);
if (num4 >= 0) num2 = num3 - 1; if (num4 > 0) num2 = num3 - 1;
else num = num3 + 1; else if (num4 < 0) num = num3 + 1;
else if (num != num3) num2 = num3;
else return num;
} }
return num + 1; return ~num;
} }
public void Feed(Identifier target, float ft, float tt) { public void Feed(Identifier target, float ft, float tt) {
Forward(target, tt); Forward(target, tt);
@@ -135,7 +137,7 @@ namespace Cryville.Crtr {
} }
return false; return false;
} }
public void Cleanup(Identifier target, float ft, float tt) { public void Cleanup(Identifier target, float tt) {
Forward(target, tt); Forward(target, tt);
var actlist = activeEvs[target]; var actlist = activeEvs[target];
for (int i = actlist.Count - 1; i >= 0; i--) { for (int i = actlist.Count - 1; i >= 0; i--) {

View File

@@ -2,6 +2,7 @@ using Cryville.Common;
using Cryville.Common.Pdt; using Cryville.Common.Pdt;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using UnityEngine; using UnityEngine;
@@ -170,6 +171,7 @@ namespace Cryville.Crtr {
public class RealtimeMotionValue { public class RealtimeMotionValue {
public Vector AbsoluteValue; public Vector AbsoluteValue;
List<MotionNode> RelativeNodes; List<MotionNode> RelativeNodes;
internal byte CloneTypeFlag;
public RealtimeMotionValue Init(Vector init) { public RealtimeMotionValue Init(Vector init) {
RelativeNodes = new List<MotionNode> { RelativeNodes = new List<MotionNode> {
@@ -433,7 +435,7 @@ namespace Cryville.Crtr {
} }
public override string ToString() { public override string ToString() {
return Value.ToString(); return Value.ToString(CultureInfo.InvariantCulture);
} }
public override float[] ToArray() { public override float[] ToArray() {
@@ -493,7 +495,7 @@ namespace Cryville.Crtr {
} }
public override string ToString() { public override string ToString() {
return Value.ToString(); return Value.ToString(CultureInfo.InvariantCulture);
} }
public override float[] ToArray() { public override float[] ToArray() {
@@ -553,7 +555,7 @@ namespace Cryville.Crtr {
} }
public override string ToString() { public override string ToString() {
return Value.ToString(); return Value.ToString(CultureInfo.InvariantCulture);
} }
public override float[] ToArray() { public override float[] ToArray() {
@@ -648,8 +650,8 @@ namespace Cryville.Crtr {
public static string ToString(float? w, float? h) { public static string ToString(float? w, float? h) {
List<string> list = new List<string>(); List<string> list = new List<string>();
if (w != null) list.Add(w.ToString() + "w"); if (w != null) list.Add(w.Value.ToString(CultureInfo.InvariantCulture) + "w");
if (h != null) list.Add(h.ToString() + "h"); if (h != null) list.Add(h.Value.ToString(CultureInfo.InvariantCulture) + "h");
return string.Join("+", list.ToArray()); return string.Join("+", list.ToArray());
} }
@@ -744,9 +746,9 @@ namespace Cryville.Crtr {
public override string ToString() { public override string ToString() {
return string.Format("{0},{1},{2}", return string.Format("{0},{1},{2}",
x != null ? x.ToString() : "", x != null ? x.Value.ToString(CultureInfo.InvariantCulture) : "",
y != null ? y.ToString() : "", y != null ? y.Value.ToString(CultureInfo.InvariantCulture) : "",
z != null ? z.ToString() : "" z != null ? z.Value.ToString(CultureInfo.InvariantCulture) : ""
); );
} }
@@ -915,7 +917,7 @@ namespace Cryville.Crtr {
} }
public override string ToString() { public override string ToString() {
return VecPtComp.ToString(xw, xh) + "," + VecPtComp.ToString(yw, yh) + "," + (z != null ? z.ToString() : ""); return VecPtComp.ToString(xw, xh) + "," + VecPtComp.ToString(yw, yh) + "," + (z != null ? z.Value.ToString(CultureInfo.InvariantCulture) : "");
} }
public override float[] ToArray() { public override float[] ToArray() {

View File

@@ -3,6 +3,7 @@ using Cryville.Common.Pdt;
using Cryville.Crtr.Event; using Cryville.Crtr.Event;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using UnityEngine; using UnityEngine;
namespace Cryville.Crtr { namespace Cryville.Crtr {
@@ -298,7 +299,7 @@ namespace Cryville.Crtr {
ret.SetArraySuffix(PdtInternalType.String, fc); ret.SetArraySuffix(PdtInternalType.String, fc);
int o = 0; int o = 0;
for (int i = f; i <= t; i++) { for (int i = f; i <= t; i++) {
var s = pf + i.ToString(); var s = pf + i.ToString(CultureInfo.InvariantCulture);
ret.SetString(s, o); ret.SetString(s, o);
o += sizeof(int) + s.Length * sizeof(char); o += sizeof(int) + s.Length * sizeof(char);
} }

View File

@@ -175,6 +175,26 @@ namespace Cryville.Crtr {
} }
} }
[Category("debug")]
public bool ClearLogOnPlay {
get {
return PlayerPrefs.GetInt("ClearLogOnPlay", 1) == 1;
}
set {
PlayerPrefs.SetInt("ClearLogOnPlay", value ? 1 : 0);
}
}
[Category("debug")]
public bool HideLogOnPlay {
get {
return PlayerPrefs.GetInt("HideLogOnPlay", 1) == 1;
}
set {
PlayerPrefs.SetInt("HideLogOnPlay", value ? 1 : 0);
}
}
public void Save() { PlayerPrefs.Save(); } public void Save() { PlayerPrefs.Save(); }
public void Reset() { PlayerPrefs.DeleteAll(); } public void Reset() { PlayerPrefs.DeleteAll(); }
} }

View File

@@ -36,7 +36,7 @@ namespace Cryville.Crtr {
} }
} }
Dictionary<string, List<PropertyInfo>> _categories = new Dictionary<string, List<PropertyInfo>>(); readonly Dictionary<string, List<PropertyInfo>> _categories = new Dictionary<string, List<PropertyInfo>>();
public void LoadProperties() { public void LoadProperties() {
_categories.Clear(); _categories.Clear();
_invalidated = false; _invalidated = false;

View File

@@ -43,7 +43,7 @@ namespace Cryville.Crtr {
public override int Priority { public override int Priority {
get { return StartEvent == null ? 4 : 6; } get { return StartEvent == null ? 4 : 6; }
} }
protected override int cmpExtra(StampedEvent other) { protected override int CompareExtra(StampedEvent other) {
return Equals(StartEvent, other) ? 1 : 0; return Equals(StartEvent, other) ? 1 : 0;
} }
} }
@@ -75,12 +75,12 @@ namespace Cryville.Crtr {
if (u != 0) return u; if (u != 0) return u;
u = this.Duration.CompareTo(other.Duration); u = this.Duration.CompareTo(other.Duration);
if (u != 0) return u; if (u != 0) return u;
u = cmpExtra(other); u = CompareExtra(other);
if (u != 0) return u; if (u != 0) return u;
return GetHashCode().CompareTo(other.GetHashCode()); return GetHashCode().CompareTo(other.GetHashCode());
} }
protected virtual int cmpExtra(StampedEvent other) { protected virtual int CompareExtra(StampedEvent other) {
return 0; return 0;
} }
} }

View File

@@ -9,6 +9,7 @@ using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Style", "IDE0020")] [assembly: SuppressMessage("Style", "IDE0020")]
[assembly: SuppressMessage("Style", "IDE0038")] [assembly: SuppressMessage("Style", "IDE0038")]
[assembly: SuppressMessage("Style", "IDE0018")] [assembly: SuppressMessage("Style", "IDE0018")]
[assembly: SuppressMessage("Style", "IDE0019")]
// Null operators not supported // Null operators not supported
[assembly: SuppressMessage("Style", "IDE0016")] [assembly: SuppressMessage("Style", "IDE0016")]
@@ -40,3 +41,6 @@ using System.Diagnostics.CodeAnalysis;
// Local function not supported // Local function not supported
[assembly: SuppressMessage("Style", "IDE0039")] [assembly: SuppressMessage("Style", "IDE0039")]
// Readonly struct not supported
[assembly: SuppressMessage("Style", "IDE0250")]

Binary file not shown.