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