Make pause
input optional.
This commit is contained in:
@@ -585,7 +585,7 @@ namespace Cryville.Crtr {
|
||||
|
||||
inputProxy = new InputProxy(pruleset, judge);
|
||||
inputProxy.LoadFrom(_rscfg.inputs);
|
||||
if (!inputProxy.IsCompleted) {
|
||||
if (!inputProxy.IsCompleted()) {
|
||||
throw new ArgumentException("Input config not completed\nPlease complete the input settings");
|
||||
}
|
||||
|
||||
|
@@ -27,19 +27,18 @@ namespace Cryville.Crtr.Config {
|
||||
if (e.Used) {
|
||||
m_button.interactable = false;
|
||||
m_value.text = "(Not Required)";
|
||||
m_value.color = Color.black;
|
||||
}
|
||||
else {
|
||||
m_button.interactable = true;
|
||||
if (e.Proxy == null) {
|
||||
m_value.text = "(Unassigned)";
|
||||
m_value.color = Color.yellow;
|
||||
|
||||
}
|
||||
else {
|
||||
m_value.text = e.Proxy.Value.Handler.GetTypeName(e.Proxy.Value.Type);
|
||||
m_value.color = Color.black;
|
||||
}
|
||||
}
|
||||
m_value.color = e.Required ? Color.yellow : Color.black;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -81,13 +81,15 @@ namespace Cryville.Crtr {
|
||||
public bool IsUsed(InputSource src) {
|
||||
return _sproxies.ContainsKey(src);
|
||||
}
|
||||
public bool IsCompleted {
|
||||
get {
|
||||
foreach (var i in _use)
|
||||
if (i.Value == 0 && !_tproxies.ContainsKey(i.Key)) return false;
|
||||
return true;
|
||||
}
|
||||
public bool IsCompleted() {
|
||||
foreach (var i in _use)
|
||||
if (!IsCompleted(i.Key)) return false;
|
||||
return true;
|
||||
}
|
||||
bool IsCompleted(Identifier name) {
|
||||
return name.Key == _var_pause || _use[name] != 0 || _tproxies.ContainsKey(name);
|
||||
}
|
||||
static readonly int _var_pause = IdentifierManager.SharedInstance.Request("pause");
|
||||
void IncrementUseRecursive(Identifier name) {
|
||||
BroadcastProxyChanged(name);
|
||||
var passes = _ruleset.inputs[name].pass;
|
||||
@@ -128,7 +130,7 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
public ProxyChangedEventArgs this[Identifier name] {
|
||||
get {
|
||||
return new ProxyChangedEventArgs(name, _tproxies.ContainsKey(name) ? _tproxies[name].Source : null, _use[name] > 0);
|
||||
return new ProxyChangedEventArgs(name, _tproxies.ContainsKey(name) ? _tproxies[name].Source : null, _use[name] > 0, !IsCompleted(name));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -266,10 +268,12 @@ namespace Cryville.Crtr {
|
||||
public Identifier Name { get; private set; }
|
||||
public InputSource? Proxy { get; private set; }
|
||||
public bool Used { get; private set; }
|
||||
public ProxyChangedEventArgs(Identifier name, InputSource? src, bool used) {
|
||||
public bool Required { get; private set; }
|
||||
public ProxyChangedEventArgs(Identifier name, InputSource? src, bool used, bool required) {
|
||||
Name = name;
|
||||
Proxy = src;
|
||||
Used = used;
|
||||
Required = required;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user