• 0

    posted a message on Transition From Burning To WoTK
    In the past I relied on States and virtual clicks to create 1 button and several Headers (and page long state transitions) to do whatever action/spell/macro related thing.

    With the release of WoTK I see too many new options but I am still a bit confused; I got too used to States to communicate my intentions to other parts of the code but after reading the documentation about the new environment I question my self from where should I start?.

    Qs:
    Lets say I have a button SpellCaster and button ChangeSpell; btn SpellCaster is sencitive to Stance changes and can cast SpellA, SpellB and SpellC depending on the Stance and a value set by ChangeSpell btn.

    Q1: Witch would be the best way to solve this using WoTK ways?.
    Q2: The newstate and attribute action button functionality is just complete death?. I don't have to :
    <Attribute name="*statebutton-4" value="0,1,8,9:Kb_1;10:Kb_10;20,28,29:Kb_20;30,38,39:Kb_30;100:Kb_100;101:Kb_101;200:Kb_200;201:Kb_201;80:Kb_80;90:Kb_90;91:Kb_91;1000:Kb_1000;1004:Kb_1004;1010,1018,1019:Kb_1010;2000,2008,2009:Kb_2000"/>

    any more or statebutton attribute is still usable?

    Q3: Is there any real power in using the States concept to solve this problem?.

    Thanks A Lot.
    Posted in: Lua Code Discussion
  • 0

    posted a message on A Driver that sences BonusActionBar Changes
    [Edit]
    Simple Answer:
    http://forums.worldofwarcraft.com/thread.html?topicId=4665561744&postId=46649133888&sid=1#2
    FF.
    --------------------------------------------------------------------------------
    Hello There!!!:
    As far as I know the Drivers mechanism provides a system to register ActionBar page changes or Stances, but what about the BonusActionBar when some one is Possessing a target?.

    What I try and want to do:
    I have a StateHeader that senses different things and changes the actions, spells or macros of some Buttons. Like in Bear form the N key is maul and in Human form N key is a macro with self buff cast.
    So I don't know how to send a state change to this header when I'm possessing a target (like controlling your pet with Eyes Of The Beast, priest mind control, a tonk, etc).


    Q1: Is there a simple way to resister the bonus action bar changes that I am missing?.

    I have been trying many things but the following is the one I'm dealing with but I am not complete sure how to perform it.


    SecureStateDriverManager:RegisterEvent("UPDATE_BONUS_ACTIONBAR");
    hooksecurefunc(nil, "SecureStateDriver_OnLoad", function(self)
    		RegisterStateDriver(self, "bonusActionbar", "[bonusActionbar:5] 5");
    end);


    Then I'm seeking how to hook or create a code to provide a support for a statemap-bonusActionbar-(newvalue) attribute.

    Q2: Is this approach correct?. Remember it has to work in combat.

    Thanks in Advance.
    FF.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quick Help
    Hurray:
    After much trying I solve the puzzle:

    this:SetAttribute("statebutton-n", "0:n0;1:n1");
    this:SetAttribute("statebutton-m", "0:m0");
    this:SetAttribute("type", "action");
    this:SetAttribute("action-m0" , 4);
    this:SetAttribute("action-n0" , 5);
    this:SetAttribute("action-n1" , 6);
    
    FreeFog_ActionsBars_MainBar:SetAttribute("addchild", this);
    this:RegisterForClicks("AnyDown");


    So for the "click" "n" (statebutton-n) in the mentioned states (0 or 1) will be parsed as "clicks" named "n0" or "n1". More else if in state 1 and I press "m" no action occurs => no need to attribute noop it.

    Now I want My Aguila chocolate bar XD.

    Small next question.

    Q4: Missa having problems with "headstateunit" if someone can guide me how to use this attribute to create a "self cast" button would be really nice.

    FF.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quick Help
    BAM:
    Even if in a XML this doubts are about SecureStateHeader.lua and the setattribute is lua setting Xd.
    FF.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Quick Help
    --POST EDITED some posts may not seam right (tekkub, BAM).

    Hello Moto:
    I will gently thank if someone can help me here:

    Note1: I get no debug errors.

    How To:
    Q1: When presing "n" in state 0 that action 4 runs?.
    Q2: When presing "m" in state 1 that action 5 runs?.

    Q3: No way; I should use different buttons?.

    Note2:
    The Button named self cast shows that is doable; more over if I issue the command:
    /script FreeFog_ActionsBars_MainBar_Button_SpellCaster_1:Click("S0");
    it just press the button but no distinction of state, like if -S0 was taken as a Click.

    <Ui xmlns="[url]http://www.blizzard.com/wow/ui/"[/url] xmlns:xsi="[url]http://www.w3.org/2001/XMLSchema-instance"[/url] xsi:schemaLocation="[url]http://www.blizzard.com/wow/ui/">[/url]
    <Frame name="FreeFog_ActionsBars_MainBar" inherits="SecureStateHeaderTemplate" parent="UIParent">
    	<Size x="2" y="2"/>
    	<Anchors><Anchor point="CENTER"/></Anchors>
    	
    	<Frames>
    				<CheckButton name="$parent_Button_SelfCast" inherits="ActionBarButtonTemplate">
    			<Anchors><Anchor point="TOPLEFT" relativePoint="TOPLEFT"><Offset x="0" y="0"/></Anchor></Anchors>
    			<Scripts>
    				<OnLoad>
    					this:SetAttribute("type", "spell");
    					this:SetAttribute("spell-,", "First Aid");
    this:SetAttribute("spell-.", "Alchemy");
    					this:RegisterForClicks("AnyDown");
    				</OnLoad>
    			</Scripts>
    		</CheckButton>
    		<CheckButton name="$parent_Button_StateChanger_1" inherits="ActionBarButtonTemplate">
    			<Anchors><Anchor point="TOPLEFT" relativePoint="TOPLEFT"><Offset x="0" y="-50"/></Anchor></Anchors>
    			<Scripts>
    				<OnLoad>
    					this:SetAttribute("newstate", "0,1");
    					FreeFog_ActionsBars_MainBar:SetAttribute("addchild", this);
    					this:RegisterForClicks("AnyDown");
    				</OnLoad>
    			</Scripts>
    		</CheckButton>
    		<CheckButton name="$parent_Button_SpellCaster_1" inherits="ActionBarButtonTemplate">
    			<Anchors><Anchor point="TOPLEFT" relativePoint="TOPLEFT"><Offset x="0" y="-100"/></Anchor></Anchors>
    			<Scripts>
    				<OnLoad>
    					this:SetAttribute("statebutton", "0:S0;1:S1");
    					this:SetAttribute("type", "action");
    					this:SetAttribute("action-S0" , 4);
    					this:SetAttribute("action-S1" , 5);
    					FreeFog_ActionsBars_MainBar:SetAttribute("addchild", this);
    					this:RegisterForClicks("AnyDown");
    				</OnLoad>
    			</Scripts>
    		</CheckButton>
    	</Frames>
    </Frame>
    
    </Ui>


    In a lua file that loads before the above.

    print("-------------------------------------------------------------------------");
    print("Runing Test");
    
    local frame = CreateFrame("Frame")
    frame:RegisterEvent("PLAYER_LOGIN")
    frame:SetScript("OnEvent", function(self, event, ...)
    
    	SetBindingClick(",", "FreeFog_ActionsBars_MainBar_Button_SelfCast", ",");
    	SetBindingClick(".", "FreeFog_ActionsBars_MainBar_Button_SelfCast", ".");
    	SetBindingClick("n", "FreeFog_ActionsBars_MainBar_Button_SpellCaster_1", "n");
    	SetBindingClick("m", "FreeFog_ActionsBars_MainBar_Button_SpellCaster_1", "m");
    	SetBindingClick("2", "FreeFog_ActionsBars_MainBar_Button_StateChanger_1");
    end)
    
    
    print("End Of Test");
    print("-------------------------------------------------------------------------");



    Thanks in Advance.
    FF.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Table Efficiency
    This may help:

    http://www.lua.org/pil/17.html

    I'm not sure if "nilling" all keys deletes the table, the important is if something is pointing to it or if the only references are a Weak references, before the GC (garbagecolector) runs so is kept in mem.

    Tables and functions have specials names or identifiers from the lua side (like 12xjnrone, thou it can become a string is it not); think of {} and the function sentence as "functions" that creates a new object and returns a reference to it.

    Hope it helped some how.
    FF.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function


    Appreciated Seerah =).
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    First thanks everyone for the nice data about lua.

    tekktub (is FreeFog Xd not FreeFrog, as I respect the lower case "t" in your name).

    Q3:What you are saying is that I should directly tap for using xml?.
    Like I should define all "material" aspects directly in xml and use lua to handle Headers, events and so?. If you mean other think please tell me.


    About the QProperty, Q4:if not via a table how can I teach program how to handle a property?. I know is a silly table (in the sense that many entries are really redundant) but I don't see other way. In the QProperty table in the UIObject I put something like:

    QProperty.UIObject = {
    -- FF entry: I thought of puting here an __index = function to call all
    -- the simple get and set methods to save memory, but the way I implemented
    -- seems to be faster at run time (not sure).
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    ----------------------------------------------------------------------------------------------------
    --Testing
    local button = CreateFrame("CheckButton", "CustomActionButton1", UIParent, "ActionBarButtonTemplate");
    button:SetPoint("CENTER");
    button:SetAttribute("action", 2);
    
    print ("PART I");
    local function pan(...)
    	local arg1, arg2 = ...;
    	print(select('#', ...));
    	--unpack(...) = "uno", "dos", "tres", "cuatro", "cinco"; --I know this was one of my erly mistakes but was testing again.
    	print(select('#', ...));
    	local a, b = ...
    	print ("a = " .. a .. " " .. "b = " .. b);
    end
    
    pan("vingawololenga", "asdqweq", "wqwe");
    
    print ("-------------------------------------------------------------");
    print ("PART II");
    
    print(QGetPropertyValue (button, "Name"));
    QSetPropertyValue (button, "Height", 100);
    
    print ("-------------------------------------------------------------");
    print ("PART III");
    
    local function pprint (...)
    
    local a, b, c, d, e = ...;
    print("A = " .. a);
    print("B = " .. b);
    print("C = " .. c);
    print("D = " .. d);
    print("E = " .. e);
    
    end
    
    pprint (unpack({_a = "A", _b = "B", _c = "C", _d = "D", _e = "E"})); --as spected this causes an error unpack works only for numbered keys.
    ----------------------------------------------------------------------------------------------------


    As you can notice QGetPropertyValue and QSetPropertyValue seek in a table the way to set or get a property, when this 2 functions are called (Q functions) they need that variable list of parameters and in this case is provided by the tree, sometimes this tree is in the form of:

    Taking as example backdropcolor definition:

    In tree:
    
    FrameName = {
    	Property = {
    		BackdropColor = {r = 123, g = 123, b = 123, a = 0},
    	}
    }


    so this property is a table, to set it I should call:

    QGetPropertyValue (FrameName, BackdropColor, 123, 123, 23, 0);


    but this is being retribed in the loop like:
    for propertyName, propertyData in pairs(buttonData.Property) do
    	local t = _QF.GetPropertyValue(button, propertyName, propertyData);
    	if not (t) then
    		_QF.SetPropertyValue(button, propertyName, propertyData);
    	end
    end


    So since the keys in FrameName.Property.BackdropColor aren't numerical unpack fails:
    leavingme with 3 options:
    1 - Make BackdropColor (Tree)and other complex properties definitions numericaly indexed so loosing flexibility at quering and readability but keeping unpack function intact.
    2 - Make every Set Method to work with a table or unpack.
    3 - Parse the attributes using a custom unpack function (thought I lost the unpack gem coded in C).

    S_BackdropColor = function (o, r, g, b, a) o:SetBackdropColor(r, g, b, a); end;



    Please if I wasn't clear in any line ask me to rephrase and edit.
    Thanks to everyone.
    FF.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    QProperty = {};
    
    QProperty.UIObject = {
    	-- FF entry: I thought of puting here an __index = function to call all the simple get and set method to save memory, but the way I implemented seems to be faster at run time (not sure).
    
    	G_Alpha = function (o) return o:GetAlpha(); end;
    	G_Name = function (o) return o:GetName(); end;
    	G_Type = function (o) return o:GetObjectType(); end;
    	
    	S_Alpha = function (o, v) o:SetAlpha(v); end;
    };
    	
    QProperty.FontInstance = {
    	__index = QProperty.UIObject;
    	
    	G_Font = function (o) return o:GetFont(); end;
    	G_FontObject = function (o) return o:GetFontObject(); end;
    	G_JustifyH = function (o) return o:GetJustifyH(); end;
    	G_JustifyV = function (o) return o:GetJustifyV(); end;
    	G_ShadowColor = function (o) return o:GetShadowColor(); end;
    	G_ShadowColor = function (o) return o:GetShadowColor(); end;
    	G_ShadowOffset = function (o) return o:GetShadowOffset(); end;
    	G_Spacing = function (o) return o:GetSpacing(); end;
    	G_TextColor = function (o) return o:GetTextColor(); end;
    	
    	S_Font = function (o, path, height, flags) o:SetFont(path, height, flags); end;
    	S_FontObject = function (o, v) o:SetFontObject(v); end;
    	S_JustifyH = function (o, v) o:SetJustifyH(v); end;
    	S_JustifyV = function (o, v) o:SetJustifyV(v); end;
    	S_ShadowColor = function (o, r, g, b, a) o:SetShadowColor(r, g, b, a); end;
    	S_ShadowOffset = function (o, x, y) o:SetShadowOffset(x, y); end;
    	S_Spacing = function (o, v) o:SetSpacing(v); end;
    	S_TextColor = function (o, r, g, b, a) o:SetTextColor(r, g, b, a); end;
    };
    	
    QProperty.Region = {
    	__index = QProperty.UIObject;
    	
    	G_Bottom = function (o) return o:GetBottom(); end;
    	G_Center = function (o) return o:GetCenter(); end;
    	G_Height = function (o) return o:GetHeight(); end;
    	G_Left = function (o) return o:GetLeft(); end;
    	G_NumPoints = function (o) return o:GetNumPoints(); end;
    	G_Parent = function (o) return o:GetParent(); end;
    	--Region:GetPoint(pointNum) - Get details for an anchor point for this frame (point, relativeTo, relativePoint, xofs, yofs) - New in 1.10. 
    	G_Right = function (o) return o:GetRight(); end;
    	G_Top = function (o) return o:GetTop(); end;
    	G_Width = function (o) return o:GetWidth(); end;
    	G_IsProtected = function (o) return o:IsProtected(); end;
    	G_IsShown = function (o) return o:IsShown(); end;
    	G_IsVisible = function (o) return o:IsVisible(); end;
    	
    	S_Height = function (o, v) o:SetHeight(v); end;
    	S_Parent = function (o, v) o:SetParent(v); end;
    	S_Point = function (o, point, relaviteFrame, relavitePoint, off_X, off_Y)
    		o:SetPoint(point, relaviteFrame, relavitePoint, off_X, off_Y);
    	end;	
    	S_Width = function (o, v) o:SetWidth(v); end;
    };
    	
    QProperty.Font = {
    	__index = QProperty.FontInstance;
    };
    	
    QProperty.Frame = {
    	__index = QProperty.Region;
    	
    	--Frame:GetAttribute(prefix, name, suffix) - Returns the first existing attribute of (prefix..name..suffix), ("*"..name..suffix), (prefix..name.."*"), ("*"..name.."*"), (name). 
    	G_Backdrop = function (o) return o:GetBackdrop(); end;
    	G_BackdropBorderColor = function (o) return o:GetBackdropBorderColor(); end;
    	G_BackdropColor = function (o) return o:GetBackdropColor(); end;
    	G_Children = function (o) return o:GetChildren(); end;
    	G_ClampRectInsets = function (o) return o:GetClampRectInsets(); end;
    	G_EffectiveAlpha = function (o) return o:GetEffectiveAlpha(); end;
    	G_EffectiveScale = function (o) return o:GetEffectiveScale(); end;
    	G_FrameLevel = function (o) return o:GetFrameLevel(); end;
    	G_FrameStrata = function (o) return o:GetFrameStrata(); end;
    	G_FrameType = function (o) return o:GetFrameType(); end;
    	G_HitRectInsets = function (o) return o:GetHitRectInsets(); end;
    	G_ID = function (o) return o:GetID(); end;
    	G_MaxResize = function (o) return o:GetMaxResize(); end;
    	G_MinResize = function (o) return o:GetMinResize(); end;
    	G_NumChildren = function (o) return o:GetNumChildren(); end;
    	G_NumRegions = function (o) return o:GetNumRegions(); end;
    	G_Regions = function (o) return o:GetRegions(); end;
    	G_Scale = function (o) return o:GetScale(); end;
    	--Frame:GetScript("handler") - Get the function for one of this frame's handlers.
    	G_TitleRegion = function (o) return o:GetTitleRegion(); end;
    	--Frame:HasScript("handler") - Return true if the frame can be given a handler of the specified type (NOT whether it actually HAS one, use GetScript for that) - Since 1.8. 
    	G_IsClampedToScreen = function (o) return o:IsClampedToScreen(); end;
    	--Frame:IsEventRegistered("event") - Returns true if the given event is registered to the frame. - New in 2.3 
    	--Frame:IsFrameType("type") - Determine if this frame is of the specified type, or a subclass of that type.
    	G_IsKeyboardEnabled = function (o) return o:IsKeyboardEnabled(); end;
    	G_IsMouseEnabled = function (o) return o:IsMouseEnabled(); end;
    	G_IsMouseWheelEnabled = function (o) return o:IsMouseWheelEnabled(); end;
    	G_IsMovable = function (o) return o:IsMovable(); end;
    	G_IsResizable = function (o) return o:IsResizable(); end;
    	G_IsToplevel = function (o) return o:IsToplevel(); end;
    	G_IsUserPlaced = function (o) return o:IsUserPlaced(); end;
    	
    	S_DisableDrawLayer = function (o, v) o:DisableDrawLayer(v); end;
    	S_EnableDrawLayer = function (o, v) o:EnableDrawLayer(v); end;
    	S_EnableKeyboard = function (o, v) o:EnableKeyboard(v); end;
    	S_EnableMouse = function (o, v) o:EnableMouse(v); end;
    	S_EnableMouseWheel = function (o, v) o:EnableMouseWheel(v); end;	
    	S_HookScript = function (o, handler, f) o:HookScript(handler, f); end;
    	S_RegisterEvent = function (o, v) o:RegisterEvent(v); end;
    	--Frame:RegisterForDrag("buttonType"[,"buttonType"...]) - Inidicate that this frame should be notified of drag events for the specified buttons. 	
    	S_Backdrop = function (o, v) o:SetBackdrop(v); end;
    	S_BackdropBorderColor = function (o, r, g, b, a) o:SetBackdropBorderColor(r, g, b, a); end;
    	S_BackdropColor = function (o, r, g, b, a) o:SetBackdropColor(r, g, b, a); end;
    	S_ClampedToScreen = function (o, v) o:SetClampedToScreen(v); end;
    	S_ClampRectInsets = function (o, left, right, top, bottom) o:SetClampRectInsets(left, right, top, bottom); end;
    	S_FrameLevel = function (o, v) o:SetFrameLevel(v); end;
    	S_FrameStrata = function (o, v) o:SetFrameStrata(v); end;
    	S_HitRectInsets = function (o, left, right, top, bottom) o:SetHitRectInsets(left, right, top, bottom); end;
    	S_ID = function (o, v) o:SetID(v); end;
    	S_MaxResize = function (o, maxWidth, maxHeight) o:SetMaxResize(maxWidth, maxHeight); end;
    	S_MinResize = function (o, minWidth, minHeight) o:SetMinResize(minWidth, minHeight); end;
    	S_Movable = function (o, v) o:SetMovable(v); end;
    	S_Resizable = function (o, v) o:SetResizable(v); end;
    	S_Scale = function (o, v) o:SetScale(v); end;
    	S_Script = function (o, handler, f) o:SetScript(handler, f); end;
    	S_Toplevel = function (o, v) o:SetToplevel(v); end;
    	S_UserPlaced = function (o, v) o:SetUserPlaced(v); end;
    	--Frame:UnregisterAllEvents() - Indicate that this frame should no longer be notified when any events occur. 
    	S_UnregisterEvent = function (o, v) o:UnregisterEvent(v); end;
    };
    
    QProperty.LayeredRegion = {
    	__index = QProperty.Region;
    };
    	
    QProperty.Button = {
    	__index = QProperty.Frame;
    };
    
    QProperty.CheckButton = {
    	__index = QProperty.Button;
    };
    
    for objectName, objectData in pairs(QProperty) do
    	setmetatable(objectData, objectData);
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    The concept is like a tree, being the ActionBar as the roots, the Headers the body that pump the life (the awareness of events) to the branches (buttonsGroup) finally reaching the leaves (buttons). Whatever is defined in a group it saves the individual dimensioning and don't restricts to have one (individual definition).


    Skipping many parts of the code we came across with this part of the idea:

    Get every property from the definition (tree) and set it if needed. Let the User use whatever property he wants to, and if he needs any personal one he should have a way to create it and define how to set it. (I know this has it's limitations).


    After the frame creation something like the following comes:

    (this is also not finished, it has to sense if propertyData is a table or just a value)
    
    for propertyName, propertyData in pairs(buttonData.Property) do
    	local t = _QF.GetPropertyValue(button, propertyName, propertyData);
    	if not (t) then
    		_QF.SetPropertyValue(button, propertyName, propertyData);
    	end
    end
    for propertyName, propertyData in pairs(refTable.Property) do
    	local t = _QF.GetPropertyValue(button, propertyName, propertyData);
    	if not (t) then
    		_QF.SetPropertyValue(button, propertyName, propertyData);
    	end
    end



    and here is were the unpack happens to help me, some properties can be "extracted" by just calling them for their names others need additional parameters. Also in the proses of setting them they have variable number of parameters.


    Q2: Well here is the _QF.GetPropertyValue and _QF.SetPropertyValue base design, I feel I make a huge mistake here and hope any can help.

    (incomplete)
    ----------------------------------------------------------------------------------------------------
    local function print (s)
    ----------------------------------------------------------------------------------------------------
    	DEFAULT_CHAT_FRAME:AddMessage(tostring(s));
    end
    ----------------------------------------------------------------------------------------------------
    function QGetPropertyValue (object, property, ...)
    ----------------------------------------------------------------------------------------------------
    local oType = object:GetObjectType();
    print("Get "..oType);
    property = "G_" .. property;
    return QProperty[oType][property](object, ...);
    end	
    ----------------------------------------------------------------------------------------------------
    
    ----------------------------------------------------------------------------------------------------
    function QSetPropertyValue (object, property, ...)
    ----------------------------------------------------------------------------------------------------
    local oType = object:GetObjectType();
    print("Set");
    property = "S_" .. property;
    return QProperty[oType][property](object, ...);
    end	
    ----------------------------------------------------------------------------------------------------
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    (I repeat my self this is not yet the finished version and I hope you keep respectfull actitude up)


    QOA.MainBar = {};
    QOA.MainBar.Pointer = nil;
    QOA.MainBar.Property = {
    	Template = "SecureFrameTemplate";
    	Parent = UIParent;
    	Width = 2;
    	Height = 2;
    	Point = "CENTER";
    	Rel_Frame = nil; --nil to aling to parent.
    	Rel_Point = nil;
    	Offs_X = 0;
    	Offs_Y = 0;
    };
    
    QOA.MainBar.ButtonsGroup = {};
    
    QOA.MainBar.ButtonsGroup.Main = {};
    QOA.MainBar.ButtonsGroup.Main.Header = {};
    QOA.MainBar.ButtonsGroup.Main.Property = {};
    QOA.MainBar.ButtonsGroup.Main.Attribute = {};
    QOA.MainBar.ButtonsGroup.Main.Button = {};
    
    
    QOA.MainBar.ButtonsGroup.Main.Property.Frame_Type = "CheckButton";
    QOA.MainBar.ButtonsGroup.Main.Property.Template = "ActionBarButtonTemplate";
    QOA.MainBar.ButtonsGroup.Main.Property.Parent = nil;
    
    QOA.MainBar.ButtonsGroup.Main.Attribute.statebutton = "0:S0;1:S1;2:S2;3:S3;4:S4";
    
    QOA.MainBar.ButtonsGroup.Main.Attribute.ATTRIBUTE_NOOP = {
    	Name = {"type-S0","spell-S0"};
    	Value = {"spell","ATTRIBUTE_NOOP"}
    };
    
    QOA.MainBar.ButtonsGroup.Main.Button = {
    	_1 = {
    		Pointer = nil,
    		Property = {
    			Offs_X = 0;
    			Offs_Y = 0;
    		},
    		Attribute = {},
    		
    		Bind = {
    			["1"] = {"Healing Wave","Earth Shock","Alchemy","First Aid"},
    			["2"] = {"Rockbiter Weapon","Earthbind Totem","Stoneclaw Totem","Stoneskin Totem"},
    			["3"] = {"Gift of the Naaru","Lightning Bolt","Lightning Shield","Healing Wave"},
    			["4"] = {"Earth Shock","Stoneclaw Totem","Rockbiter Weapon","Lightning Bolt"}
    		}
    	};
    };
    
    QOA.MainBar.HeadersGroup = {
    	_1 = {
    		Property = {
    			Template = "SecureStateHeaderTemplate";
    			Parent = nil;
    			Point = "BOTTOMLEFT";
    			Rel_Frame = nil; --nil to aling to parent.
    			Rel_Point = nil;
    			Offs_X = 0;
    			Offs_Y = 0;
    		},
    		Attribute = {},
    		
    		Header = {
    			_1 = {
    				Pointer = nil,
    				ControledButtonsGroup = {QOA.MainBar.ButtonsGroup.Main}
    			}
    		}
    	}
    };
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    Following is an open answer to tekkub gently issued question, so if eye's of you don't care please don't point them towards the next lines unless they promise to come with wise advice and not just to criticize.

    History Made Short:

    Since the first second I sat in front of the WoW Interface I knew I had a something that can be flexed, chewed and rejoined at will, I fear that could doom me but I think it helped me a lot. I try to do things the best way I can, tend to perfection my self at every second based on observation and feelings.

    For my the key binds and the ways to use the UI are the path to make one feel like the Character actions, spell casting and else are like an extension of one self creating a really interesting INTUITIVE bond to those actions. I hate disorder so I started to create a method to solve this problem. I hope you respect the following words: after some design attempts I came to decide that the base of the design should be based on the way my hand works (basically diving it into thumb (spell command), the 3 main fingers(movement) and as last group the little one(support: targeting, modifier keys, etc)). After accomplishing the design and a method to draw designs I started my venture into this scripting world, learning from what AddOns were and how can I use them to solve my problems. Many were really promising but none offered my this small characteristics (at least I didn't found one that accomplish them as needed), for example: to create a self cast button not restricted to Ctrl, Alt or Shift (even if key board is suited this keys for those purposes), create up-down reactive buttons to change action bar pages and not be limited just to Ctrl, Alt and Shift Headers. I tested some and came into the decision to get my hands dirty as WoW seemed a damn good evolving game with a community that empowers many systems to orbit around it. I found that I could create just some small action, spell or macro buttons to complement other addons, but they all have their problems and I am not still really capable of solving them.

    I step now to deal with my code, hope to be pulled by righteous judgment. I know it can be greatly improved but there is a ton still to be done and to refine:

    First the thing I am working on now is the "ensamblator" of the Action Bars and subparts. This may seem ugly but is more or less how you define a complete Action Bar for the addon:
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    Working on the answer; thanks for all the consideration. (It will take my a while).
    FF.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Small Question About unpack function
    Hello Folks:

    Q1: Is there any function twin to unpack arrays or tables with any kind of keys or should I write my own function?.


    function AlternativeUnpack(t, ...)
    
    return t[key], AlternativeUnpack(t, NextKey)
    end



    Thanks in Advance.
    FF.
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.