EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   For my level (https://www.eq2interface.com/forums/showthread.php?t=14631)

Mistal 08-26-2010 10:02 PM

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

gm9 08-27-2010 03:48 AM

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.

Drumstix42 08-27-2010 05:03 PM

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.

Mistal 08-27-2010 10:28 PM

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

Mistal :)


All times are GMT -5. The time now is 07:44 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI