public override void ShowGUI(List<ActionParameter> parameters) { if (AdvGame.GetReferences ().settingsManager != null && !AdvGame.GetReferences ().settingsManager.useProfiles) { EditorGUILayout.HelpBox ("Save game profiles are not enabled - please set in Settings Manager to use this Action.", MessageType.Warning); AfterRunningOption (); return; } manageProfileType = (ManageProfileType) EditorGUILayout.EnumPopup ("Method:", manageProfileType); if (manageProfileType == ManageProfileType.CreateProfile) { useCustomLabel = EditorGUILayout.Toggle ("Use custom label?", useCustomLabel); } if ((manageProfileType == ManageProfileType.CreateProfile && useCustomLabel) || manageProfileType == AC.ManageProfileType.RenameProfile) { varID = AdvGame.GlobalVariableGUI ("Label as String variable:", varID); if (varID >= 0 && AdvGame.GetReferences () && AdvGame.GetReferences ().variablesManager) { GVar _var = AdvGame.GetReferences ().variablesManager.GetVariable (varID); if (_var != null && _var.type != VariableType.String) { EditorGUILayout.HelpBox ("The chosen Variable must be a String.", MessageType.Warning); } } } if (manageProfileType == ManageProfileType.DeleteProfile || manageProfileType == ManageProfileType.RenameProfile) { string _action = "delete"; if (manageProfileType == ManageProfileType.RenameProfile) { _action = "rename"; } deleteProfileType = (DeleteProfileType) EditorGUILayout.EnumPopup ("Profile to " + _action + ":", deleteProfileType); if (deleteProfileType == DeleteProfileType.SetSlotIndex) { profileIndexParameterID = Action.ChooseParameterGUI ("Slot index to " + _action + ":", parameters, profileIndexParameterID, ParameterType.Integer); if (profileIndexParameterID == -1) { profileIndex = EditorGUILayout.IntField ("Slot index to " + _action + ":", profileIndex); } } else if (deleteProfileType == DeleteProfileType.SlotIndexFromVariable) { slotVarID = AdvGame.GlobalVariableGUI ("Integer variable:", slotVarID); if (slotVarID >= 0 && AdvGame.GetReferences () && AdvGame.GetReferences ().variablesManager) { GVar _var = AdvGame.GetReferences ().variablesManager.GetVariable (slotVarID); if (_var != null && _var.type != VariableType.Integer) { EditorGUILayout.HelpBox ("The chosen Variable must be an Integer.", MessageType.Warning); } } } if (deleteProfileType != DeleteProfileType.ActiveProfile) { EditorGUILayout.Space (); menuName = EditorGUILayout.TextField ("Menu with ProfilesList:", menuName); elementName = EditorGUILayout.TextField ("ProfilesList element:", elementName); } } AfterRunningOption (); }
override public void ShowGUI(List <ActionParameter> parameters) { if (AdvGame.GetReferences().settingsManager != null && !AdvGame.GetReferences().settingsManager.useProfiles) { EditorGUILayout.HelpBox("Save game profiles are not enabled - please set in Settings Manager to use this Action.", MessageType.Warning); AfterRunningOption(); return; } manageProfileType = (ManageProfileType)EditorGUILayout.EnumPopup("Method:", manageProfileType); if (manageProfileType == ManageProfileType.CreateProfile) { useCustomLabel = EditorGUILayout.Toggle("Use custom label?", useCustomLabel); } if ((manageProfileType == ManageProfileType.CreateProfile && useCustomLabel) || manageProfileType == AC.ManageProfileType.RenameProfile) { varID = AdvGame.GlobalVariableGUI("Label as String variable:", varID, VariableType.String); } if (manageProfileType == ManageProfileType.DeleteProfile || manageProfileType == ManageProfileType.RenameProfile || manageProfileType == ManageProfileType.SwitchActiveProfile) { string _action = "delete"; if (manageProfileType == ManageProfileType.RenameProfile) { _action = "rename"; } else if (manageProfileType == ManageProfileType.SwitchActiveProfile) { _action = "switch to"; } deleteProfileType = (DeleteProfileType)EditorGUILayout.EnumPopup("Profile to " + _action + ":", deleteProfileType); if (deleteProfileType == DeleteProfileType.SetSlotIndex) { profileIndexParameterID = Action.ChooseParameterGUI("Slot index to " + _action + ":", parameters, profileIndexParameterID, ParameterType.Integer); if (profileIndexParameterID == -1) { profileIndex = EditorGUILayout.IntField("Slot index to " + _action + ":", profileIndex); } } else if (deleteProfileType == DeleteProfileType.SlotIndexFromVariable) { slotVarID = AdvGame.GlobalVariableGUI("Integer variable:", slotVarID, VariableType.Integer); } else if (deleteProfileType == DeleteProfileType.SetProfileID) { profileIndexParameterID = Action.ChooseParameterGUI("Profile ID to " + _action + ":", parameters, profileIndexParameterID, ParameterType.Integer); if (profileIndexParameterID == -1) { profileIndex = EditorGUILayout.IntField("Profile ID to " + _action + ":", profileIndex); } } else if (deleteProfileType == DeleteProfileType.ActiveProfile) { if (manageProfileType == ManageProfileType.SwitchActiveProfile) { EditorGUILayout.HelpBox("This combination of fields will no effect - please choose another.", MessageType.Info); } } if (deleteProfileType == DeleteProfileType.SetSlotIndex || deleteProfileType == DeleteProfileType.SlotIndexFromVariable) { EditorGUILayout.Space(); menuName = EditorGUILayout.TextField("Menu with ProfilesList:", menuName); elementName = EditorGUILayout.TextField("ProfilesList element:", elementName); } } AfterRunningOption(); }