• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
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