Forum rules - please read before posting.

MenuSystem.OnElementClick() after AC upgrades.

I would like to trigger some custom C# code by pressing a menu button. If I understand correctly, that requires adding that code to OnElementClick() inside MenuSystem.cs. Does that mean that my custom code should be added to MenuSystem.cs after every AC upgrade? Not a big deal, but is there any way to keep custom code in a separate file?



Comments

  • The MenuSystem script was introducted when AC was very young, and there are better ways of calling scripts now.  The recommended way is to write a custom Action that calls the C# code in question, and have that Action run when the Button is clicked on.

    Editing MenuSystem is still perfectly viable, though.  You don't need to re-write it after every AC upgrade - just don't re-import it.  I ensure that no changes are ever made to it on the "official" side, so that a modified script by you will always work regardless of the AC version.
  • Thank you for clarifying that. AC rocks!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.