Author Topic: [Feature Suggestion] Auto-link event handlers  (Read 476 times)

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
[Feature Suggestion] Auto-link event handlers
« on: 12 May 2020, 19:39 »
One of the most common newbie errors is to not link an event handler to an event property, so that the function never runs. (And honestly, not even just a newbie error, though more experienced AGS devs know how to fix it on our own.)

So I was thinking: why not do it for them? At compile time, for each event property that doesn't have an event handler set, check if the default function name (with the correct function signature) exists in the relevant script, and if so, automatically link it. (Probably with a warning in the output pane, or maybe even a popup dialog box.)

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    • I can help with proof reading
    • I can help with scripting
    • Gurok worked on one or more games that won an AGS Award!
    •  
    • Gurok worked on one or more games that was nominated for an AGS Award!
Re: [Feature Suggestion] Auto-link event handlers
« Reply #1 on: 15 May 2020, 01:47 »
Nice idea. Perhaps even with support for an annotation a la
Code: [Select]
// $AUTOCOMPLETEIGNORE$ that will tell the compiler not to spit a warning for a particular function.