Esempio n. 1
0
    public override void OnSRPGCKInspectorGUI()
    {
        StatusEffect se = target as StatusEffect;

        se.effectType = EditorGUILayout.TextField("Effect Type", se.effectType).NormalizeName();
        se.always     = EditorGUILayout.Toggle("Unremovable", se.always);
        if (se.always)
        {
            se.usesDuration = false;
        }
        GUILayout.BeginHorizontal();
        se.usesDuration     = EditorGUILayout.Toggle("Time-Limited", se.usesDuration);
        se.ticksInLocalTime = EditorGUILayout.Toggle("Uses Char. Spd", se.ticksInLocalTime);
        GUILayout.EndHorizontal();
        if (se.usesDuration)
        {
            se.tickDuration = (float)EditorGUILayout.IntField((se.ticksInLocalTime ? "CT" : "Global") + " Ticks", (int)se.tickDuration);
        }
        else
        {
            se.tickDuration     = 0;
            se.ticksInLocalTime = false;
        }
        GUILayout.BeginHorizontal();
        se.overrides = EditorGUILayout.Toggle("Overrides Similar Effects", se.overrides);
        if (se.overrides)
        {
            se.overridePriority = EditorGUILayout.IntField("Strength", se.overridePriority);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        se.replaces = EditorGUILayout.Toggle("Replaces Similar Effects", se.replaces);
        if (se.replaces)
        {
            se.replacementPriority = EditorGUILayout.IntField("Strength", se.replacementPriority);
        }
        GUILayout.EndHorizontal();
        EditorGUILayout.Space();
        //now, effects!
        se.passiveEffects = EditorGUIExt.StatEffectFoldout("Passive Effect", se.passiveEffects, StatEffectContext.Normal, "" + se.GetInstanceID(), formulaOptions, lastFocusedControl, ref showPassiveEffects);

        if (se.tickIntervalEffects != null && se.tickIntervalEffects.Length > 0)
        {
            se.tickEffectInterval = EditorGUILayout.IntField((se.ticksInLocalTime ? "CT" : "Global") + " Tick Effect Interval", (int)se.tickEffectInterval);
        }
        se.tickIntervalEffects = EditorGUIExt.StatEffectFoldout("Tick Interval Effect", se.tickIntervalEffects, StatEffectContext.Normal, "" + se.GetInstanceID(), formulaOptions, lastFocusedControl, ref showTickIntervalEffects);

        se.characterActivatedEffects = EditorGUIExt.StatEffectFoldout("Character-Activation Effect", se.characterActivatedEffects, StatEffectContext.Normal, "" + se.GetInstanceID(), formulaOptions, lastFocusedControl, ref showCharacterActivatedEffects);

        se.characterDeactivatedEffects = EditorGUIExt.StatEffectFoldout("Character-Deactivation Effect", se.characterDeactivatedEffects, StatEffectContext.Normal, "" + se.GetInstanceID(), formulaOptions, lastFocusedControl, ref showCharacterDeactivatedEffects);

        se.statusEffectAppliedEffects = EditorGUIExt.StatEffectFoldout("On-Application Effect", se.statusEffectAppliedEffects, StatEffectContext.Normal, "" + se.GetInstanceID(), formulaOptions, lastFocusedControl, ref showStatusEffectAppliedEffects);

        se.statusEffectRemovedEffects = EditorGUIExt.StatEffectFoldout("On-Removal Effect", se.statusEffectRemovedEffects, StatEffectContext.Normal, "" + se.GetInstanceID(), formulaOptions, lastFocusedControl, ref showStatusEffectRemovedEffects);
    }
Esempio n. 2
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
            );
    }
Esempio n. 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);
    }
Esempio n. 4
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
                );
        }
    }