Two Questions: Variable Based Period Repaint & Combining Variables
Well, since I don't know the first thing about LUA, I need some help.
The unitframes I'm creating right now automatically switch from portrait to healthbars when you're either not at Max Health OR at Max Power. Now, there are a couple of problems with what I want. If I use two show/hide variables (in this case, IsMaxHealth & IsMaxPower) on the same subframe, one of them doesn't work. When I lose health, It doesn't update, however when I lose power, it updates. I want to combine both of them, for IsMaxHealth OR IsMaxPower for it to update. Now, with that said, there's another problem. Because I use a portrait, I can't use periodic repaint, or my portrait will flicker animations over and over again. Is it possible to create a variable based Period Repaint? When a variable is triggered it can switch between Multiplexer Parameters & Periodic Repaint events? Such as, as long as I'm IsMaxHealth & IsMaxPower, it will be Multiplexer, but if I lose health OR Power, it will trigger an event to repaint every 0.1 seconds? Otherwise I'm going to have to get rid of my portrait. D:< |
Code:
local maxhealthpower = false; |
Quote:
Code:
RDX.RegisterFeature({ |
The problem with the variable you just made is that it only adds the multiplexer for the unit health, not both. You don't need to add them again to your unit frame if you are already using the fh/fm variables which I would presume you are since you are using status bars.
|
See, what I did was, I just copy and pasted the IsMaxHealth one, and tried to combine the two.
I don't know LUA :S Though, I am having my friend help me with another part. So, I don't understand what I'd have to get rid of. I really would love to learn LUA but I don't have the time right now. :( |
So, I tried to make a variable all my own, but I've decided I can't figure out this crazy LUA language. :(
^- Is not a programmer. I tried to make it be inverse, since Warriors, Bear Druids, and Deathknights's power starts at 0, not at 100%. =( Code:
RDX.RegisterFeature({ This is the error message that I get when trying to add my variable. D:< Code:
Interface\AddOns\RDX\ObjectMgr\FeatureEditor.lua:314: attempt to index local 'feat' (a nil value) or should I never attempt this again? :( |
end);
end; UIFromDescriptor = function(desc, parent, state) :eek: |
also your code should be :
Code:
local ismaxhealthpower = false; BTW add in SVN |
this is actually something i thought about a while ago as a new feature...
something like "Variable: Combine Variables" where you could add multiple variables and combine them using logical operators like and/or/not ex: you add a variable for maxhealth and a variable: incombat, then use the feature combine variables to create a third variable x that links those two variables with an and operator, but i thought that would be used so rarely that its not worth to create a feature for it. it could use a editor somewhat like the filterset-editor but without all the sets and instead a selection of all existing variables in the object. |
I was more thinking about a generic variable, where you can choose your variable name, the type and enter a small script.
|
that would in effect lead to the same thing, using other variables that exist in the object should be possible, but you would use a small script to combine them instead of a complex feature-editor.
|
Oh, and fyi:
local str = "This feature is inverse when power is rage. \n"; should be local str = "This feature is inverse for Runic Power or Rage. \n"; I mistyped the first time. |
Also, another question before it becomes lost, is Variable Based Period Repaint possible?
To switch between multiplexer and period repaint say, if the new variable (var_ismaxhealthpower) triggered could it switch from multiplexer to 0.1 repaint or something? Or not possible? Still getting the same error by the way, when trying to drag and drop "Var: isMaxHealthPower?", not sure what I did X_X Code:
nterface\AddOns\RDX\ObjectMgr\FeatureEditor.lua:314: attempt to index local 'feat' (a nil value) Code:
Interface\AddOns\VFL\UI\DragDrop.lua:70: VFLUI.DragContext:Drag(): called twice. Error persists there, too. So it isn't just me. |
Fixed
Don't know exactly where is the problem. I copy paste an other feature and just replace the code inside. |
Yep, fixed up just fine, besides one importaint part:
Runic Power & Rage still don't work xD Code:
elseif unit:Power() >= 1 and (pt == 1 or pt == 6) then |
Code:
elseif unit:Power() = 0 and (pt == 1 or pt == 6) then So just change >= 1 to == 0 |
All times are GMT -6. The time now is 10:16 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI