protected virtual void BasicSkillGUI() { CoreSkillGUI(); s.isEnabledF = EditorGUIExt.FormulaField( "Is Enabled", s.isEnabledF, s.skillName + ".isEnabledF", formulaOptions, lastFocusedControl ); s.replacesSkill = EditorGUILayout. Toggle("Replaces Skill", s.replacesSkill); if (s.replacesSkill) { s.replacedSkill = EditorGUILayout. TextField("Skill", s.replacedSkill).NormalizeName(); s.replacementPriority = EditorGUILayout. IntField("Priority", s.replacementPriority); s.requiresReplacement = EditorGUILayout. Toggle("Requires Replacement", s.requiresReplacement); } if (!s.isPassive) { s.deactivatesOnApplication = EditorGUILayout. Toggle("Deactivates After Use", s.deactivatesOnApplication); } EditorGUILayout.Space(); //parameters LATER: group parameters by used component //(e.g. reaction. params near reaction) s.parameters = EditorGUIExt.ParameterFoldout( "Parameter", s.parameters, "" + s.GetInstanceID(), formulaOptions, lastFocusedControl, ref showParameters ); EditorGUILayout.Space(); s.passiveEffects = EditorGUIExt.StatEffectFoldout( "Passive Effect", s.passiveEffects, StatEffectContext.Normal, "" + s.GetInstanceID(), formulaOptions, lastFocusedControl, ref showPassiveEffects ); }
public override void OnSRPGCKInspectorGUI() { c.characterName = EditorGUILayout.TextField("Name", c.characterName). NormalizeName(); c.EditorSetBaseStat( "team", EditorGUIExt.FormulaField( "Team #", c.EditorGetBaseStat("team") ?? Formula.Constant(0), "character.team.param", formulaOptions, lastFocusedControl, 0 ) ); EditorGUILayout.Space(); c.size = EditorGUILayout.Vector3Field("Size (Tiles):", c.size); EditorGUILayout.Space(); c.transformOffset = EditorGUILayout.Vector3Field( "Visual Offset:", c.transformOffset ); EditorGUILayout.Space(); c.equipmentSlots = EditorGUIExt.ArrayFoldout( "Equipment Slots", c.equipmentSlots, ref showSlots, false, 128, "body" ); EditorGUILayout.Space(); c.canMountF = EditorGUIExt.FormulaField( "Can Mount (t.)", c.canMountF ?? Formula.True(), "character.canMount.param", formulaOptions, lastFocusedControl, 0 ); c.isMountableF = EditorGUIExt.FormulaField( "Mountable By (t.)", c.isMountableF ?? Formula.False(), "character.isMountable.param", formulaOptions, lastFocusedControl, 0 ); c.EditorSetBaseStat("isTargetable", EditorGUIExt.FormulaField( "Is Targetable", c.EditorGetBaseStat("isTargetable") ?? Formula.True(), "character.isTargetable.param", formulaOptions, lastFocusedControl, 0 ) ); c.stats = EditorGUIExt.ParameterFoldout( "Statistic", c.stats, "" + c.GetInstanceID(), formulaOptions, lastFocusedControl, ref showStats, skipStats ); EditorGUILayout.Space(); }
protected override void BasicSkillGUI() { CoreSkillGUI(); patk.referredSkill = EditorGUIExt.PickAssetGUI <ActionSkillDef>("Referred Skill", patk.referredSkill); if (patk.referredSkill == null) { patk.referredSkillName = EditorGUILayout.TextField("Referred Name", patk.referredSkillName); patk.referredSkillGroup = EditorGUILayout.TextField("Referred Group", patk.referredSkillGroup ?? ""); } if ((patk.mergeIsEnabledF = MergeChoiceGUI("IsEnabled", patk.mergeIsEnabledF)) != MergeMode.UseOriginal) { s.isEnabledF = EditorGUIExt.FormulaField( "Is Enabled", s.isEnabledF, s.skillName + ".isEnabledF", formulaOptions, lastFocusedControl ); } s.replacesSkill = EditorGUILayout. Toggle("Replaces Skill", s.replacesSkill); if (s.replacesSkill) { s.replacedSkill = EditorGUILayout. TextField("Skill", s.replacedSkill).NormalizeName(); s.replacementPriority = EditorGUILayout. IntField("Priority", s.replacementPriority); s.requiresReplacement = EditorGUILayout. Toggle("Requires Replacement", s.requiresReplacement); } if (!s.isPassive) { s.deactivatesOnApplication = EditorGUILayout. Toggle("Deactivates After Use", s.deactivatesOnApplication); } EditorGUILayout.Space(); if ((patk.mergeParameters = MergeListChoiceGUI("Parameters", patk.mergeParameters)) != MergeModeList.UseOriginal) { s.parameters = EditorGUIExt.ParameterFoldout( "Parameter", s.parameters, "" + s.GetInstanceID(), formulaOptions, lastFocusedControl, ref showParameters ); } EditorGUILayout.Space(); if ((patk.mergePassiveEffects = MergeListChoiceGUI("Passive Effects", patk.mergePassiveEffects)) != MergeModeList.UseOriginal) { s.passiveEffects = EditorGUIExt.StatEffectFoldout( "Passive Effect", s.passiveEffects, StatEffectContext.Normal, "" + s.GetInstanceID(), formulaOptions, lastFocusedControl, ref showPassiveEffects ); } }
protected override void TargetedSkillGUI() { if ((patk.mergeTurnToFaceTarget = MergeChoiceGUI("Face Target", patk.mergeTurnToFaceTarget)) != MergeMode.UseOriginal) { atk.turnToFaceTarget = EditorGUILayout.Toggle("Face Target", atk.turnToFaceTarget); } if ((patk.mergeDelay = MergeChoiceGUI("Scheduled Delay", patk.mergeDelay)) != MergeMode.UseOriginal) { atk.delay = EditorGUIExt.FormulaField("Scheduled Delay", atk.delay, atk.GetInstanceID() + "." + atk.name + ".delay", formulaOptions, lastFocusedControl); } if ((patk.mergeDelayedApplicationUsesOriginalPosition = MergeChoiceGUI("Trigger from Original Position", patk.mergeDelayedApplicationUsesOriginalPosition)) != MergeMode.UseOriginal) { atk.delayedApplicationUsesOriginalPosition = EditorGUILayout.Toggle("Trigger from Original Position", atk.delayedApplicationUsesOriginalPosition); } if ((patk.mergeMultiTargetMode = MergeChoiceGUI("Multi-Target Mode", patk.mergeMultiTargetMode)) != MergeMode.UseOriginal) { atk.multiTargetMode = (MultiTargetMode)EditorGUILayout.EnumPopup("Multi-Target Mode", atk.multiTargetMode); } if ((patk.mergeMaxWaypointDistanceF = MergeChoiceGUI("Max Waypoint Distance", patk.mergeMaxWaypointDistanceF)) != MergeMode.UseOriginal) { atk.maxWaypointDistanceF = EditorGUIExt.FormulaField("Max Waypoint Distance", atk.maxWaypointDistanceF, atk.GetInstanceID() + "." + atk.name + ".targeting.maxWaypointDistance", formulaOptions, lastFocusedControl); } if ((patk.mergeWaypointsAreIncremental = MergeChoiceGUI("Instantly Apply Waypoints", patk.mergeWaypointsAreIncremental)) != MergeMode.UseOriginal) { atk.waypointsAreIncremental = EditorGUILayout.Toggle("Instantly Apply Waypoints", atk.waypointsAreIncremental); } if ((patk.mergeCanCancelWaypoints = MergeChoiceGUI("Cancellable Waypoints", patk.mergeCanCancelWaypoints)) != MergeMode.UseOriginal) { atk.canCancelWaypoints = EditorGUILayout.Toggle("Cancellable Waypoints", atk.canCancelWaypoints); } if ((patk.mergeTargetSettings = MergeChoiceGUI("Target Settings", patk.mergeTargetSettings)) != MergeMode.UseOriginal) { if (atk.targetSettings == null) { atk.targetSettings = new TargetSettings[] { new TargetSettings() }; } EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); int arraySize = EditorGUILayout.IntField(atk.targetSettings.Length, GUILayout.Width(32)); GUILayout.Label(" " + "Target" + (atk.targetSettings.Length == 1 ? "" : "s")); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); var oldSettings = atk.targetSettings; if (arraySize != atk.targetSettings.Length) { TargetSettings[] newSettings = atk.targetSettings; Array.Resize(ref newSettings, arraySize); atk.targetSettings = newSettings; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(); for (int i = 0; i < atk.targetSettings.Length; i++) { TargetSettings ts = i < oldSettings.Length ? oldSettings[i] : atk.targetSettings[i]; if (ts == null) { atk.targetSettings[i] = new TargetSettings(); ts = atk.targetSettings[i]; } atk.targetSettings[i] = EditorGUIExt.TargetSettingsGUI("Target " + i, atk.targetSettings[i], atk, formulaOptions, lastFocusedControl, i); } EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); } }
protected virtual void TargetedSkillGUI() { if (!(target is MoveSkillDef)) { atk.turnToFaceTarget = EditorGUILayout.Toggle("Face Target", atk.turnToFaceTarget); } atk.delay = EditorGUIExt.FormulaField("Scheduled Delay", atk.delay, atk.GetInstanceID() + "." + atk.name + ".delay", formulaOptions, lastFocusedControl); if (Formula.NotNullFormula(atk.delay) && !(atk.delay.formulaType == FormulaType.Constant && atk.delay.constantValue == 0)) { atk.delayedApplicationUsesOriginalPosition = EditorGUILayout.Toggle("Trigger from Original Position", atk.delayedApplicationUsesOriginalPosition); } if (atk.targetSettings == null) { atk.targetSettings = new TargetSettings[] { new TargetSettings() }; } if ((atk.multiTargetMode = (MultiTargetMode)EditorGUILayout.EnumPopup("Multi-Target Mode", atk.multiTargetMode)) != MultiTargetMode.Single) { if (atk.multiTargetMode == MultiTargetMode.Chain) { atk.maxWaypointDistanceF = EditorGUIExt.FormulaField("Max Waypoint Distance", atk.maxWaypointDistanceF, atk.GetInstanceID() + "." + atk.name + ".targeting.maxWaypointDistance", formulaOptions, lastFocusedControl); } atk.waypointsAreIncremental = EditorGUILayout.Toggle("Instantly Apply Waypoints", atk.waypointsAreIncremental); atk.canCancelWaypoints = EditorGUILayout.Toggle("Cancellable Waypoints", atk.canCancelWaypoints); EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); int arraySize = EditorGUILayout.IntField(atk.targetSettings.Length, GUILayout.Width(32)); GUILayout.Label(" " + "Target" + (atk.targetSettings.Length == 1 ? "" : "s")); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); var oldSettings = atk.targetSettings; if (arraySize != atk.targetSettings.Length) { TargetSettings[] newSettings = atk.targetSettings; Array.Resize(ref newSettings, arraySize); atk.targetSettings = newSettings; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(); for (int i = 0; i < atk.targetSettings.Length; i++) { TargetSettings ts = i < oldSettings.Length ? oldSettings[i] : atk.targetSettings[i]; if (ts == null) { atk.targetSettings[i] = new TargetSettings(); ts = atk.targetSettings[i]; } atk.targetSettings[i] = EditorGUIExt.TargetSettingsGUI("Target " + i, atk.targetSettings[i], atk, formulaOptions, lastFocusedControl, i); } EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); } else { atk.targetSettings[0] = EditorGUIExt.TargetSettingsGUI("Target", atk.targetSettings[0], atk, formulaOptions, lastFocusedControl, -1); } }
public override void OnSRPGCKInspectorGUI() { if (inv.GetComponent <Character>() != null) { EditorGUILayout.HelpBox("Inventory is used for unequipped items such as commodities and consumables. Inventory items do not provide passive effects, skills, or other adjustments until they are instantiated. Formulae are in character-stat scope.", MessageType.Info); } EditorGUIUtility.LookLikeInspector(); inv.limitedStacks = EditorGUILayout.Toggle( "Limited Stacks", inv.limitedStacks ); if (inv.limitedStacks) { inv.stackLimitF = EditorGUIExt.FormulaField( "Stack Limit:", inv.stackLimitF ?? Formula.Constant(20), inv.name + ".inventory.stackLimit", formulaOptions, lastFocusedControl ); } inv.limitedStacks = EditorGUILayout.Toggle( "Override Item Stack Size", inv.limitedStackSize ); if (inv.limitedStackSize) { inv.stackSizeF = EditorGUIExt.FormulaField( "Stack Size:", inv.stackSizeF ?? Formula.Constant(1), inv.name + ".inventory.stackSize", formulaOptions, lastFocusedControl ); } inv.limitedWeight = EditorGUILayout.Toggle( "Limited Weight", inv.limitedWeight ); if (inv.limitedWeight) { inv.weightLimitF = EditorGUIExt.FormulaField( "Weight Limit:", inv.weightLimitF ?? Formula.Constant(20), inv.name + ".inventory.weightLimit", formulaOptions, lastFocusedControl ); } inv.stacksMustBeUnique = EditorGUILayout.Toggle( "Stacks Must Be Unique", inv.stacksMustBeUnique ); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(); if (inv.items == null) { inv.items = new List <Item>(); } if (inv.counts == null) { inv.counts = new List <int>(); } int arraySize = inv.items.Count; EditorGUILayout.BeginHorizontal(); GUILayout.Label("Size", GUILayout.Height(18)); GUILayout.FlexibleSpace(); arraySize = EditorGUILayout.IntField( arraySize, EditorStyles.textField, GUILayout.Height(18) ); EditorGUILayout.EndHorizontal(); while (arraySize > inv.items.Count) { Item def = null; int ct = 1; if (inv.items.Count > 0) { def = inv.items[inv.items.Count - 1]; ct = inv.counts[inv.counts.Count - 1]; } inv.items.Add(def); inv.counts.Add(ct); } while (arraySize < inv.items.Count) { inv.items.RemoveAt(inv.items.Count - 1); inv.counts.RemoveAt(inv.counts.Count - 1); } for (int i = 0; i < inv.items.Count; i++) { EditorGUILayout.BeginHorizontal(); inv.items[i] = EditorGUILayout.ObjectField( inv.items[i] as UnityEngine.Object, typeof(Item), false ) as Item; GUILayout.FlexibleSpace(); inv.counts[i] = EditorGUILayout.IntField(inv.counts[i]); EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUIUtility.LookLikeControls(); }