EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 08-26-2010, 10:02 PM
Mistal Mistal is offline
Premium Member
Premium Member
Interface Author - Click to view interfaces
 
Join Date: Sep 2007
Server: Everfrost
Posts: 59
Default For my level

Hi there, I'm working on a new little mod and I was wondering if someone could help me out with a bit of info...

I am trying to make a button that will use for example a cure or poison potion and as I understand it you can set it to select the right pot for the level of the char using it .. is there an example in a mod of the code used to do this so i can figure out how to incorporate it into what I am doing?

Many thanks

Mistal
Reply With Quote
  #2  
Unread 08-27-2010, 03:48 AM
gm9 gm9 is offline
gm10-1
Premium Member
EQ2Interface Super Mod
Featured
 
Join Date: Feb 2006
Posts: 6,479
Default

The right choice of pots depend on the level of the target, not the level of the character that uses it as far as I remember.

ProfitUI has character level dependent code in group and raid windows though.
__________________
P R O F I T U I ∙ R E B O R N [Auto-Updater] | [Portal] | [F.A.Q.] | [Support Forums]
~ Retired ~
If it does not work, you likely installed it incorrectly. Always try a clean install before reporting bugs.
Reply With Quote
  #3  
Unread 08-27-2010, 05:03 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

So you'll need a text object that uses the dynamic data for your current level.
Code:
<Text DynamicData="/GameData.Self.Level" Name="PlayerLevel" Visible="false" />
To do a check in the UI script, you first need to do a comparsion line.
This code will check to see if the player is above level 89:
Code:
varCheck90=(Parent.PlayerLevel.text > 89)
The "varcheck90" is just a variable name I came up with. The "Parent.PlayerLevel.text" refers to the data that the DynamicData automatically fills into the "text" property of the Text object. And the "89" is the number I plugged in. If you're above 89, you must be level 90 (or higher).




Then we can do the comparison line:
Code:
varCheck90=(Parent.PlayerLevel.text > 89)
varCompare90=(varCheck90 ? true : false)
The "varCompare90" is just another name I came up with. If the player is above 89, it will return the "true", otherwise it will always return the "false"; in essence setting the "varCompare90" to one or the other.




So lets say you have a button called ButtonLvl90, and you only want that button to be pressed if the character is at least level 90.
This will make the button visible or keep it hidden:
Code:
varCheck90=(Parent.PlayerLevel.text > 89)
varCompare90=(varCheck90 ? true : false)

Parent.ButtonLvl90.visible=varCompare90

The method to actually press the button should be within the Button itself. You would hide the button by default, give it the property OnShow and use this code inside it:
Code:
Parent.ButtonLvl90.press=true
Visible=false
The above code will press the button, with whatever code you have in OnPress and then hide it again, making it ready to be fired off next time around.


Hope this helps.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>

Last edited by Drumstix42 : 08-27-2010 at 05:05 PM.
Reply With Quote
  #4  
Unread 08-27-2010, 10:28 PM
Mistal Mistal is offline
Premium Member
Premium Member
Interface Author - Click to view interfaces
 
Join Date: Sep 2007
Server: Everfrost
Posts: 59
Default

WoW thanks a lot for that .. i'm getting my head around it but it seems to be just what i'm looking for

Mistal
Reply With Quote
Reply



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 02:03 PM.


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