• Hi Guest!

    We have posted a new VaM2 dev log on Patreon, starting a monthly cadence of written progress updates between Beta releases. Highlights include the new Gizmos System, Selection Carousel, and Modes System with Context-Specific Editing. Beta1.2 is 15 of 21 items complete.

    Read the full post on Patreon, or follow progress on the public Trello roadmap.
MacGruber Utils

Plugins + Scripts MacGruber Utils

Download [<1 MB]
Hi @MacGruber, I noticed two small bugs in the file (rightSide flags not passed on), and also added one small detail so text fields can be less than 40 pixels high and an Action class for On/Off events. File is attached, feel free to adapt or ignore my suggestions :)
Cheers, and thanks for letting the community use this resource so generously.
 

Attachments

  • MacGruber_Utils_edits.cs
    47 KB · Views: 0
Thanks for the trigger related code! Super useful.

To show longer trigger names in the panel:
C#:
public class EventTrigger : CustomTrigger
{
    ...
    protected override void InitPanel()
    {
        Transform panel = triggerActionsPanel.Find("Panel");
        panel.Find("Header Text").GetComponent<RectTransform>().sizeDelta = new Vector2(1000f, 50f);
        ...
    }
}

To update a trigger on atom renamed:
C#:
public abstract class CustomTrigger : Trigger
{
    ...
    public CustomTrigger(...)
    {
        ...
        SuperController.singleton.onAtomUIDRenameHandlers += OnAtomRename;
    }

    private void OnAtomRename(string oldName, string newName) => SyncAtomNames();

    public void OnRemove() => SuperController.singleton.onAtomUIDRenameHandlers -= OnAtomRename;
    ...
}
Then call OnRemove when destroying the plugin.
 
Last edited:
Back
Top Bottom