private void Settings_Load(object sender, EventArgs e) { DelayBar.Value = Config.InjectionDelay; MethodBox.SelectedIndex = MethodBox.FindString(Config.InjectionMethod); AsyncInjectionCheck.Checked = Config.AsyncInjection; SecureModeCheck.Checked = Config.SecureMode; }
private void AddMethodToUI(Type method) { //Add new method box GameObject newBox = Instantiate(MethodDataBoxInstance.gameObject, MethodContentArea); MethodBox box = newBox.GetComponent <MethodBox>(); box.Title.text = method.Name; box.GenInstance = GenerationInst; box.method = GenerationInst.GeneratorSys.MethodList[CurrentIndex]; newBox.SetActive(true); MakeDataPairs(method, box); CurrentIndex++; }
private void UpdateConvertMethodUI(int index) { if (_currentConvertMethodBox != null) { Destroy(_currentConvertMethodBox); } //Make a new ui box for this method and populate it with the correct data. GameObject newBox = Instantiate(ConversionMethodBoxInstance.gameObject, ConvertMethodContentArea); MethodBox box = newBox.GetComponent <MethodBox>(); box.Title.text = ConversionMethods[index].Name; newBox.SetActive(true); _currentConvertMethodBox = box.gameObject; MakeDataPairs(ConversionMethods[index], box, true); }
private void MakeDataPairs(Type method, MethodBox box, bool conversionMethod = false) { //Get a list of the configurable values List <ConfigurableField> values = GenerationInst.GetConfigList(method); //If we have any values to display. if (values != null) { List <MethodDataPair> pairs; if (!conversionMethod) { _dataPairs.Add(new List <MethodDataPair>()); pairs = _dataPairs[CurrentIndex]; } else { _converterDataPairs.Clear(); pairs = _converterDataPairs; } foreach (ConfigurableField field in values) { GameObject newVal = Instantiate(box.DataPairObject.gameObject, box.DataPanel); MethodDataPair dataPair = newVal.GetComponent <MethodDataPair>(); dataPair.Name.text = field.Name + ":"; dataPair.FieldData = field; if (field.ValueType == ConfigurableField.Type.BOOLEAN) { //Field is a boolean. dataPair.EnableToggle(); dataPair.Toggle.isOn = field.BoolValue; } else { //field is any other type. dataPair.Input.text = field.StringValue; SetTextInputToType(dataPair.Input, field.ValueType); } pairs.Add(dataPair); dataPair.gameObject.SetActive(true); } } box.FitContent(); }