Skip to content

Changed menus to call func instead of subroutines#35

Open
spice3d wants to merge 1 commit intoLiveEnhancementSuite:developfrom
spice3d:develop
Open

Changed menus to call func instead of subroutines#35
spice3d wants to merge 1 commit intoLiveEnhancementSuite:developfrom
spice3d:develop

Conversation

@spice3d
Copy link

@spice3d spice3d commented Aug 1, 2023

It was a bit tough because the code uses subroutines and not functions. Here's what I did to get it to work:
-Negated the IF statement where the menu gets created so it adds the menu item when it knows the query
-Added a handler that binds the query to a new function called OpenPluginHelper
-Subtract 1 from the Array[] so it uses the title in the menu text
-Replace menuitemcount with handler variable in menu add
-Commented out the ELSE section since we don't need the queryname# variables anymore
-Declared queryname as a global variable. You have to do this before it's used in the OpenPluginHelper function as variables in functions are local by default and the openplugin subroutine needs it to run. Note that subroutines, don't have this "limitation" even if called from within a function, like we are doing.
-Added the OpenPluginHelper function. This sets the queryname (global) variable and calls the openplugin subroutine.
-Commented out the #include menuindex.ahk line :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant