Macro compatibility
meyverick opened this issue ยท 6 comments
Is your feature request related to a problem? Please describe.
I can't use WIM if the Minimap button isn't enabled.
Describe the solution you'd like
I'd like to be able to create a macro /wim toggleAll
that show all windows on click or hide all if already shown.
Describe alternatives you've considered
Browsing your code thinking something like ShowUIPanel(WIMFrame)
exists but I haven't found something similar.
You can write a macro using scripts utilizing the following exposed methods.
WIM.ShowAllWindows(['whisper', 'chat'])
WIM.ShowAllUnreadWindows(['whisper', 'chat'])
WIM.HideAllWindows(['whisper', 'chat'])
In each of these, the arguments are optional. They are available to filter specific types of windows if desired.
Example:
/script WIM.ShowAllWindows()
to show all windows (derr)
/script WIM.HideAllWindows('whisper')
to hide all whisper windows only.
I don't recall if there is anything exposed to see if a window is currently open so you can determine what to do (hide or show), but you could create your own variable and keep track yourself.
Example:
/script _wimHidden = not _wimHidden; if _wimHidden then WIM.ShowAllWindows() else WIM.HideAllWindows() end
I will leave this open as a feature request, but these tools should provide you with what you are trying to do. Window behaviors such as animations can be controlled from WIM's settings.
In addition to addingthe new slash command: /wim toggle { all | whisper | chat }
, I added a new public method which would go with my previous post. It is being used internally for the toggle command.
local listOfShownWindows = WIM.GetWindowsShown(['whisper', 'chat']);
I wanted to use this neat functionality in order to get rid of that minimap button. However, while I can execute /wim toggle all from the chat command line, it doesn't work when executed from a macro. Any idea what might be going wrong here? /wim also cannot be executed from a macro.
I am on wotlk classic.
There was a work around made for slash commands since Wow's API was tainting everything that registered a slash command. It must not work within macros...
I might have to expose the function so it can be called as a script.
I exposed the function so you can call a script in your macro.
WIM.ToggleWindows(type) where type takes the same arguments as /wim toggle.