EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > UI Developer Discussion

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Unread 08-18-2009, 03:10 PM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Its possible to check for "spell exist", but its a bit of a pain as EQ2Aditu describes.

Basically you'd script up a macro window initialization routine that fires once when the window containing your macros is opened. It assigns a script to the casting window's onshow handler to set a spellname variable as true, then attempts to cast the spell. If the cast window pops up, the variable gets assigned and you know the spell exists, otherwise you assume it doesn't exist. Repeat for each spell you want to test. At the end of the test routine, you assign those values to the corresponding macro button's enabled property, and clear the onshow scripts so they don't get triggered by something else.

Seudo script
Code:
clearallqueuedabilities
cancel_spellcast
castingwindow.onshow='PathBackToMacroWindow.spell1Exists=true
cancel_spellcast'
useability spell1

clearallqueuedabilities
cancel_spellcast
castingwindow.onshow='PathBackToMacroWindow.spell2Exists=true
cancel_spellcast'
useability spell2
...
parent.macro1.enabled=spell1Exists
parent.macro2.enabled=spell2Exists

castingwindow.onshow=''
onShow=''
You may have some execution order problems with the final "enabled" assignments handled in the same script that's testing for existence. If so, you'll need to move that stuff out to another invisible button that gets pressed later.

Generally I find all of this more hassle and a bigger performance hit than its worth.

If you're dealing with a bunch of macro buttons, you could streamline the repetitive code by generalizing the test routine into a dedicated button script that receives the name of the spell to test as input and a returnPath for the object that should receive the result.
Reply With Quote
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:52 PM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI