Skip to content

Releases: Nebby1999/RoR2EditorKit

Editor Assembly is now actually Editor Only.

08 Dec 19:19
Compare
Choose a tag to compare

0.2.4

Just forgot to make the assembly definition editor only.

(Also, 3 releases in one day? Woowee)

Entity State Configuration Ignores Hide In Inspector Attribute

08 Dec 18:28
Compare
Choose a tag to compare

0.2.3

ESC Inspector now Ignores fields with Hide In Inspector attributes.

Something very common in modded entity state configurations is re-using existing assets for entity states, Tracers and hit effects are a very prominent example of this. The way how this is usually serialized is by hand-written calls to the Resources.Load() method. However, the ESC would constantly overwrite these hand-written calls by default, making it impossible to re-use Resources methods.

As Such, the ESC inspector now ignores all fields that have the HideInInspector attribute added to them.

public class FirePistol : BaseSkillState
{
    [TokenModifier("SS2_EXECUTIONER_PISTOL_DESCRIPTION", StatTypes.Percentage, 0)]
    public static float damageCoefficient;
    public static float procCoefficient;
    public static float baseDuration;
    public static float recoil;
    public static float spreadBloom;
    public static float force;

    [HideInInspector]
    public static GameObject muzzleEffectPrefab = Resources.Load<GameObject>("prefabs/effects/muzzleflashes/Muzzleflash1");
    [HideInInspector]
    public static GameObject tracerPrefab = Resources.Load<GameObject>("prefabs/effects/tracers/tracercommandodefault");
    [HideInInspector]
    public static GameObject hitPrefab = Resources.Load<GameObject>("prefabs/effects/HitsparkCommando");
}

Inspector Changes

08 Dec 16:25
Compare
Choose a tag to compare

0.2.2

Inspector Changes

This minor update to RoR2EditorKit brings QoL changes to the inspector system it has...

HGButton Inspector

Anreol, an user from the ror2 modding discord notified me that there was a Type used for UI controllers for the Buttons ingame. the type itself being HGButton. After talking with Ben from Hopoo Games, i've learned that the HGButtonInspector needs its own custom inspector for it to work properly, otherwise it would show the default ButtonEditor (The inspector used for the Button component).

After receiving an image detailing how the button looks on their end, i proceeded to create a new inspector for this type.

Inspector Changes

While working on the HGButton Inspector, i noticed that one of the key features of the Extended Inspector class (That is, enabling or disabling it via a toggle on the HeaderGUI) wouldn't work for Components.

As Such, i decided to extend further the ExtendedInspector class, and created the ComponentInspector and ScriptableObject Inspector.

As their names suggest, any component inspector should ideally inherit from ComponentInspector and any Scriptable Object inspector should inherit from the other one, Both inherit the framework for settings and utility methods the extended inspector has. While their main difference is how the toggle box is drawn.

Inspector Utilities, More ScriptableObjects, and Property Drawers

30 Nov 16:22
Compare
Choose a tag to compare

0.2.1

Inspector Utilities

I've added a few protected methods that i've been using a lot with the new inspectors i've been writting lately. These protected methods act as shorthands and faster ways to write default methods found inside EditorGUILayout.

The utilities are the following:

DrawField(string propName) - Draws a property field by finding the property inside the SerializedObject that's being inspected
DrawField(SerializedProperty property, string propName) - Draws a property field by finding a child property of the given property.
Drawfield(SerializedProperty property) - Draws a property field
Header(string label) - Creates a LabelField that acts the same way as the [Header] attribute
Header(string label, string tooltip) - Creates a LabelField that acts the same way as a Header attribute, and contains a tooltip.

More ScriptableObjects

MynachMelyn, an user from the Risk of Rain 2 Modding discord told me the fact that a special skilldef called "SteppedSkillDef" couldn't be created in the Editor, this was due to the SteppedSkillDef not having the CreateAssetMenu attribute applied to it.

As a result, i dug deeper, and i found a total of 11 SkillDefs that didn't had the CreateAssetMenu, knowing this, i decided to revamp the "UnlockableDefCreator" into a "ScriptableCreator". which now contains methods for creating ScriptableObjects that are normally impossible to create due to lacking the CreateAssetMenu Attribute

PropertyDrawers

I've decided to add an EditorGUILayoutProperyDrawer class that extends from property drawer. it's main purpose is for the "Lazy" creation of extremely simple property drawers so that the end user doesnt have to deal with Rects and the complex system that GUILayout uses.

This EditorGUILayoutPropertyDrawer class is not going to replace the property drawer class used in the RoR2EditorKit property drawers, and its not meant to be an extension to the base class, unlike ExtendedInspector or ExtendedEditorWindow.

Drawer Fixes, Interactable Creation and Proper Enum Flags

26 Nov 19:09
Compare
Choose a tag to compare

0.2.0

Drawer Fixes

I've written a few new additions to the SerializableSystemType drawer, considering the immense utility this type has, the main fix consist on situations where more than 1 field of this type was present on an inspected object, it would always select the first instance of the type instead of another field.

The fix makes it so it works constantly regardless of the amount of serializable types.

It also includes a new fallback system for finding the value set in the RequiredBaseType attribute that the SerializableSystemType uses.

Interactable Creation

I've been trying to figure out a good system for creating boilerplate prefabs for certain aspects of Risk of Rain 2, the first 2 tries where with projectiles and characterbodies, both of which are currently disabled and commented out. the attempts ive made where difficult but i decided to try again with interactables.

RoR2EditorKit now comes with an asset creation option for creating an Interactable in the form of a boilerplate. The base interactable contains the most common and what seems to be the necesary settings for creating an Interactable object in Risk of Rain 2, the default components that are added to the prefab are:

  • Main Game Object:
    • Entity State Machine
    • Network Identity
    • Network Transform
    • Network State Machine
    • Model Locator
    • Highlight
    • Generic Display Name Provider
    • SFX Locator
  • Mdl Game Object:
    • Entity Locator
    • Child Locator

The window also comes with the ability to add extra components and modify the prefab itself, these include:

  • Name for the interactable, will be used for the prefab's name, and the language tokens.
  • Has Cost: Wether or not the interactable costs something to use, setting this to true enables the following settings:
    • Cost Type: What type of cost the interactable uses
    • Cost: How much the interactable Costs
    • Is Shrine: Wether or not the interactable counts as a shrine
  • Is Chest: Wether or not to add a Chest Behavior to this Interactable
  • Summons something on interaction: Wether or not this interactable summons something on interaction, used for example, on broken drones/turrets
  • Is Portal: Wether or not the interactable is a portal
  • Create Matching ISC: Creates an Interactable Spawn Card for the prefab.

Proper Enum Flags

RoR2 currently contains a total of 8 enums that have the Flags Attribute applied to, however, none of these enum work as flag enums by default in the editor, this makes using these enum difficult at best and borderline impossible to use at worst.

RoR2EditorKit now comes with a PropertyDrawer for EnumMasks. which allows proper flag usage inside the editor.

image