MacGruber Utils

Plugins MacGruber Utils

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