Example #1
0
    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
            );
    }
Example #2
0
 public override void OnSRPGCKInspectorGUI()
 {
     it.name   = EditorGUILayout.TextField("Name", it.name);
     it.prefab = EditorGUILayout.ObjectField(
         "Prefab",
         it.prefab as UnityEngine.Object,
         typeof(Transform),
         false
         ) as Transform;
     it.weight     = EditorGUILayout.FloatField("Weight", it.weight);
     it.stackSize  = EditorGUILayout.IntField("Stack Size", it.stackSize);
     it.parameters = EditorGUIExt.ParameterFoldout(
         "Parameter",
         it.parameters,
         "item." + it.name + ".params.",
         formulaOptions,
         lastFocusedControl,
         ref it.editorShowParameters
         );
 }
Example #3
0
    public override void OnSRPGCKInspectorGUI()
    {
        e.equipmentName = EditorGUILayout.TextField("Name", e.equipmentName).NormalizeName();
        float halfWidth = Screen.width / 2;

        EditorGUILayout.BeginHorizontal(GUILayout.Width(Screen.width - 32));
        e.equipmentSlots      = EditorGUIExt.ArrayFoldout("Slots", e.equipmentSlots, ref showSlots, false, halfWidth - 16, "body");
        e.equipmentCategories = EditorGUIExt.ArrayFoldout("Categories", e.equipmentCategories, ref showCategories, false, halfWidth - 16, "armor");
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space();

        e.parameters = EditorGUIExt.ParameterFoldout("Parameter", e.parameters, "" + e.GetInstanceID(), formulaOptions, lastFocusedControl, ref showParameters);

        EditorGUILayout.Space();

        e.passiveEffects = EditorGUIExt.StatEffectFoldout("Passive Effect", e.passiveEffects, StatEffectContext.Normal, "" + e.GetInstanceID(), formulaOptions, lastFocusedControl, ref showPassiveEffects);

        EditorGUILayout.Space();

        e.statusEffectPrefabs = EditorGUIExt.ObjectArrayFoldout <StatusEffect>("Status Effect Prefabs", e.statusEffectPrefabs, ref showStatusEffects);
    }
Example #4
0
    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();
    }
Example #5
0
    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
                );
        }
    }
Example #6
0
    public override void OnSRPGCKInspectorGUI()
    {
        //Be sure that changing the team ID checks for duplicates!
        int newID = EditorGUILayout.IntField("ID", team.id);

        if (newID != team.id)
        {
            if (team.arbiter.GetTeam(newID) != null)
            {
                Debug.LogError("Cannot assign duplicate team ID " + newID);
            }
            else
            {
                team.id = newID;
            }
        }
        team.type = (TeamLocation)EditorGUILayout.EnumPopup("Type", team.type);

        team.parameters = EditorGUIExt.ParameterFoldout(
            "Parameter",
            team.parameters,
            "team." + team.id + ".params.",
            formulaOptions,
            lastFocusedControl,
            ref team.editorShowParameters
            );

        if (team.arbiter == null)
        {
            EditorGUILayout.HelpBox("Teams must be children of Arbiter objects", MessageType.Error);
            return;
        }

        //toggles for ally/enemy by team, excepting self
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.BeginVertical();
        //labels
        GUILayout.Label("Team:", GUILayout.Width(64), GUILayout.Height(18));
        GUILayout.Label("Ally", GUILayout.Width(64), GUILayout.Height(18));
        GUILayout.Label("Enemy", GUILayout.Width(64), GUILayout.Height(18));
        GUILayout.Label("Neutral", GUILayout.Width(64), GUILayout.Height(18));
        EditorGUILayout.EndVertical();

        teamScroll = EditorGUILayout.BeginScrollView(teamScroll, false, false, GUILayout.Height(90));
        EditorGUILayout.BeginHorizontal();
        foreach (var t in team.arbiter.EditorGetTeams())
        {
            if (t == team)
            {
                EditorGUILayout.BeginVertical();
                GUILayout.Label("" + t.id, GUILayout.Width(32), GUILayout.Height(16));
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndVertical();
                continue;
            }
            EditorGUILayout.BeginVertical();
            if (GUILayout.Button("" + t.id, GUILayout.Width(32), GUILayout.Height(16)))
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndHorizontal();
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = t;
                return;
            }
            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(12);
            EditorGUILayout.BeginVertical();
            //radio boxes
            bool ally    = team.allies.Contains(t.id);
            bool enemy   = !ally && team.enemies.Contains(t.id);
            bool neutral = !ally && !enemy;
            bool newAlly = EditorGUILayout.Toggle(ally, EditorStyles.radioButton, GUILayout.Width(16), GUILayout.Height(16));
            if (newAlly != ally)
            {
                if (newAlly)
                {
                    team.allies.Add(t.id); team.enemies.Remove(t.id);
                }
                else
                {
                    team.allies.Remove(t.id);
                }
            }
            if (newAlly)
            {
                enemy   = false;
                neutral = false;
            }

            bool newEnemy = EditorGUILayout.Toggle(enemy, EditorStyles.radioButton, GUILayout.Width(16), GUILayout.Height(16));
            if (newEnemy != enemy)
            {
                if (newEnemy)
                {
                    team.enemies.Add(t.id); team.allies.Remove(t.id);
                }
                else
                {
                    team.enemies.Remove(t.id);
                }
            }
            if (newEnemy)
            {
                neutral = false;
            }

            bool newNeutral = EditorGUILayout.Toggle(neutral, EditorStyles.radioButton, GUILayout.Width(16), GUILayout.Height(16));
            if (newNeutral != neutral)
            {
                if (newNeutral)
                {
                    team.enemies.Remove(t.id);
                    team.allies.Remove(t.id);
                }
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();
//			GUILayout.Space(6);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.EndVertical();
        }
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.EndScrollView();
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
    }