//Presets saving window private void SavePreset(int id) { GUILayout.BeginVertical(); GUILayout.Label("Preset name:", skins.label); presetName = GUILayout.TextField(presetName, skins.textField); GUILayout.Label("Preset description", skins.label); presetDescription = GUILayout.TextArea(presetDescription, skins.textArea, GUILayout.Height(100)); GUILayout.BeginHorizontal(); if (GUILayout.Button("Save...", skins.button)) { if (presetName == string.Empty) { PopupDialog.SpawnPopupDialog("Error!", "Preset name cannot be empty!", "Close", false, skins); } else if (presets.presetNames.Any(n => n == presetName)) { this.presetWarningVisible = true; saveWarning = true; } else if ((pChute.GetErrors("general").Count != 0 || pChute.GetErrors("main").Count != 0 || (pChute.secondaryChute && pChute.GetErrors("secondary").Count != 0))) { this.failedVisible = true; } else { pChute.CreatePreset(); this.presetSaveVisible = false; } } if (GUILayout.Button("Cancel", skins.button)) { this.presetSaveVisible = false; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); }
//Presets saving window private void SavePreset(int id) { GUILayout.BeginVertical(); GUILayout.Label("Preset name:", this.skins.label); this.presetName = GUILayout.TextField(this.presetName, this.skins.textField); GUILayout.Label("Preset description", this.skins.label); this.presetDescription = GUILayout.TextArea(this.presetDescription, skins.textArea, GUILayout.Height(100)); GUILayout.BeginHorizontal(); if (GUILayout.Button("Save...", this.skins.button)) { if (this.presetName == string.Empty) { PopupDialog.SpawnPopupDialog("Error!", "Preset name cannot be empty!", "Close", false, this.skins); } else if (this.presets.ContainsPreset(this.presetName)) { this.presetWarningVisible = true; this.saveWarning = true; } else if (this.pChute.GetErrors(true).Count != 0 || pChute.GetErrors(false).Count != 0) { this.failedVisible = true; } else { this.pChute.CreatePreset(); this.presetSaveVisible = false; } } if (GUILayout.Button("Cancel", this.skins.button)) { this.presetSaveVisible = false; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); }