public void CheckValueNoEmptyStrings(string value) { ProfileSetter profileSetter = FindObjectOfType <ProfileSetter>(); if (value.Length != 0) { CorrectInputColor(gameObject); profileSetter.SetProfile(name, value); } else { OutputError(gameObject); } }
public void CheckValueD6(string value) { ProfileSetter profileSetter = FindObjectOfType <ProfileSetter>(); int nValue = ReadIntString(value); if (-1 < nValue && nValue < 8) { CorrectInputColor(gameObject); profileSetter.SetProfile(name, value); } else { OutputError(gameObject); } }
public void CheckValueNotNegative(string value) { ProfileSetter profileSetter = FindObjectOfType <ProfileSetter>(); int nValue = ReadIntString(value); if (nValue >= 0) { CorrectInputColor(gameObject); profileSetter.SetProfile(name, value); } else { OutputError(gameObject); } }
public void CheckValue(string value) { ProfileMessager message = FindObjectOfType <ProfileMessager>(); ProfileUI profileUI = GetComponent <ProfileUI>(); if (profileName == "Name") { Debug.Log("Checking profile Name from Profile Value Checker."); if (value.Length > 0) { Debug.Log("Saving Name, " + value + ", to Profile."); profileUI.SetColor(profileName, true); setter.SetProfile(profileName, value); message.ReturnToCurrentState(); } else { profileUI.SetColor(profileName, false); message.DisplayMessage("Value of " + profileName + " is not legal.", true); Debug.Log("Value of " + profileName + " is not legal."); } } else { int nValue = ReadIntString(value); bool valueChecks = false; Debug.Log("Profile Value Checker is checking a numeric Profile: " + profileName); switch (profileName) { case "MinM0": case "MinM1": case "MinM2": case "MinM3": case "MinM4": case "M0": case "M1": case "M2": case "M3": case "M4": case "S0": case "S1": case "S2": case "S3": case "S4": case "A0": case "A1": case "A2": case "A3": case "A4": case "Ld0": case "Ld1": case "Ld2": case "Ld3": case "Ld4": valueChecks = (nValue >= 0); break; case "T0": case "T1": case "T2": case "T3": case "T4": case "W0": case "W1": case "W2": case "W3": case "W4": valueChecks = (nValue > 0); break; case "WS0": case "WS1": case "WS2": case "WS3": case "WS4": case "BS0": case "BS1": case "BS2": case "BS3": case "BS4": case "Sv0": case "Sv1": case "Sv2": case "Sv3": case "Sv4": valueChecks = (0 <= nValue && nValue <= 7); break; default: break; } if (valueChecks) { Debug.Log("Profile Value Checker is saving a numeric profile to Profile: " + profileName); profileUI.SetColor(profileName, valueChecks); setter.SetProfile(profileName, nValue); CheckForWarnings(setter.CurrentProfile, profileName); } else { profileUI.SetColor(profileName, valueChecks); message.DisplayMessage("Value of " + profileName + " is not legal.", true); Debug.Log("Value of " + profileName + " is not legal."); } } }