• 0

    posted a message on Frame XML
    well when I got home I played with it a bit more and found that the frame didn't have a parent and that is what seem to have caused the problem
    Posted in: Lua Code Discussion
  • 0

    posted a message on options tables
    Quote from Phanx
    example, "#info" will be 3, so "info[#info]" => "info[3]" => "spiritshard"
    if this is the case then it would make the table
    tbl = { example, example2, },
    and so on, would it not? and the reason it was name = true, was for the check box and the way it was to be displayed or not, thus the boolean value.

    The way you explained it was very clear I am just looking for some extra clarity

    Sorry no disrespect meant, Every thing I know I have tough myself from trial and error
    Posted in: Lua Code Discussion
  • 0

    posted a message on options tables
    I am sorry but the way you put that made more sense then them docs ever will, I have read through them many or times
    Posted in: Lua Code Discussion
  • 0

    posted a message on Frame XML
    Quote from Seerah
    By the time you get in game and are able to run that slash command it might be loaded. ;)

    the question was not one of loaded but one of visable and where it is vs where it should be, using these changes to demonstrate it
    function ReCalc_DisplayControl( self, action )
         local name = self:GetName();
         for i = 1, 2, 1 do
              local Button = _G[ ( "%s_Button%s" ):format( name, i ) ]
              if ( action == "open" ) then
                   Button:Show();
                   ReCalc_CheckVisible( Button );
              elseif ( action == "close" ) then
                   if ( Button:IsVisible() ) then
                        Button:Hide();
                        ReCalc_CheckVisible( Button );
                   end
              end
         end
         if ( action == "open" ) then
              self:Show();
              -- self:SetPoint("TOPLEFT", "TradeSkillFrame", "TOPRIGHT", -35, -60);
              ReCalc_CheckVisible( self );
         elseif ( action == "close" ) then
              self:Hide();
              ReCalc_CheckVisible( self );
         end
    end
    
    function ReCalc_CheckVisible( frame )
         if ( frame:IsVisible() ) then
              print( ( "%s is visible" ):format( frame:GetName() ) );
              print( frame:GetPoint() );
         else
              print( ( "%s is not visible" ):format( frame:GetName() ) );
         end
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on options tables
    it's called once at login and when ever you discover a new token.
    ie: if you go to Terokkar forest and capture the towers then do a dungeon and get a spirit shard then it would update the list because you have a new token, I am assuming that #info is a automated way of counting?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Frame XML
    I have already tried that, the frame is loaded and you can run a check like
    /run print( FrameName:IsVisible() )
    and it returns true meaning that it is open but not where it should be, I have even tried to set the point in lua.
    so it is opening just where is the issue
    Posted in: Lua Code Discussion
  • 0

    posted a message on Frame XML
    Can anyone offer incite why this will not open docked to the frame that it is anchored to? I have tried for a few day and now it is just getting frustrating.

    XML File:
    <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
    ../FrameXML/UI.xsd">
    	<Script file="ReCalc.lua"/>
    	<Button name="ReCalcButtonTemplate" virtual="true" hidden="true">
    		<Size>
    			<AbsDimension x="32" y="32"/>
    		</Size>
    		<Layers>
    			<Layer level="BACKGROUND">
    				<Texture file="Interface\SpellBook\SpellBook-SkillLineTab">
    					<Size>
    						<AbsDimension x="64" y="64"/>
    					</Size>
    					<Anchors>
    						<Anchor point="TOPLEFT">
    							<Offset>
    								<AbsDimension x="-3" y="11"/>
    							</Offset>
    						</Anchor>
    					</Anchors>
    				</Texture>
    			</Layer>
    		</Layers>
    		<Scripts>
    			<OnClick>
    				ReCalc_FixView();
    			</OnClick>
    			<OnEnter>
    				GameTooltip:SetOwner( self, "ANCHOR_RIGHT" );
    				GameTooltip:SetText( self.tooltip );
    			</OnEnter>
    			<OnLeave>
    				GameTooltip:Hide();
    			</OnLeave>
    		</Scripts>
    		<NormalTexture/>
    		<HighlightTexture file="Interface\Buttons\ButtonHilight-Square" alphaMode="ADD"/>
    	</Button>
    	<Frame name="ReCalc_Tab">
    		<Anchors>
    			<Anchor point="TOPLEFT" relativeTo="TradeSkillFrame" relativePoint="TOPLEFT"/>
    			<Anchor point="BOTTOMRIGHT" relativeTo="TradeSkillFrame" relativePoint="BOTTOMRIGHT"/>
    		</Anchors>
    		<Frames>
    			<Button name="$parent_Button1" inherits="ReCalcButtonTemplate">
    				<Anchors>
    					<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
    						<Offset>
    							<AbsDimension x="0" y="-36"/>
    						</Offset>
    					</Anchor>
    				</Anchors>
    			</Button>
    			<Button name="$parent_Button2" inherits="ReCalcButtonTemplate">
    				<Anchors>
    					<Anchor point="TOPLEFT" relativeTo="$parent_Button1" relativePoint="BOTTOMLEFT">
    						<Offset>
    							<AbsDimension x="0" y="-17"/>
    						</Offset>
    					</Anchor>
    				</Anchors>
    			</Button>
    		</Frames>
    		<Scripts>
    			<OnLoad function="ReCalc_OnLoad"/>
    			<OnEvent function="ReCalc_OnEvent"/>
    		</Scripts>
    	</Frame>
    </Frame>
    </Ui>
    


    LUA File :
    function ReCalc_OnLoad( self )
         self:RegisterEvent( "TRADE_SKILL_SHOW" );
         self:RegisterEvent( "TRADE_SKILL_CLOSE" );
         print( "Test Reagent calculator v1.0 loaded." );
    end
    
    function ReCalc_Tab_OnClick( self )
         local name = self:GetName();
         print( ( "Frame Name : %s " ):format( name ) );
    end
    
    function ReCalc_OnEvent( self, event, ... )
         local args = ... ;
         if ( event == "TRADE_SKILL_SHOW" ) then
              ReCalc_DisplayControl( self, "open" );
         elseif ( event == "TRADE_SKILL_CLOSE" ) then
              ReCalc_DisplayControl( self, "close" );
         elseif ( event == "CHAT_MSG_LOOT" ) then
              -- print();
         end
    end
    
    function ReCalc_DisplayControl( self, action )
         local name = self:GetName();
         for i = 1, 2, 1 do
              local Button = _G[ ( "%s_Button%s" ):format( name, i ) ]
              if ( action == "open" ) then
                   Button:Show();
              elseif ( action == "close" ) then
                   if ( Button:IsVisible() ) then
                        Button:Hide();
                   end
              end
         end
         if ( action == "open" ) then
              self:Show();
              -- self:SetPoint("TOPLEFT", "TradeSkillFrame", "TOPRIGHT", -35, -60);
         elseif ( action == "close" ) then
              self:Hide();
         end
    end
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on options tables
    Thanks I will have to look this up so that I understand it better
    Posted in: Lua Code Discussion
  • 0

    posted a message on options tables
    So that work but I wonder why I would need to make it local when if you use a ace3DB it stores it in a global enviroment and it works
    Posted in: Lua Code Discussion
  • 0

    posted a message on options tables
    Can anyone help me understand what I am doing wrong?

    This chuck of code works for the most part, it fills the options table with all the names and images right for every item in the loop but the function for get/save only work for the list item in the loop. The two examples I have given here the first will toggle 14 toggles at the same time and the other will do 2.
    function BuildTokensDisplay()
         local Player = UnitName( "player" );
         local Realm = GetRealmName();      
         local title = ( "%s's Tokens" ):format( Player );
         local tCount = GetCurrencyListSize();
         local name, isHeader, isWatched, count, icon, nName
         local order = 1;
         Opts.args.cat6.args.AllowedTokens.name = ( "%s" ):format( ColorUtils( "GetCClass", Characters[ Realm ][ Player ].Class, title ) );
         for i = 1, tCount do
              TokenName, isHeader, _, _, isWatched, count, icon = GetCurrencyListInfo( i );
              if ( not isHeader ) then
                   if ( not Tokens ) then Tokens = {}; end
                   if ( not Tokens[ Player ] ) then Tokens[ Player ] = {}; end
                   if ( not Tokens[ Player ][ TokenName ] ) then Tokens[ Player ][ TokenName ] = false end
                   Opts.args.cat6.args.AllowedTokens.args[ TokenName ] = {};
                   local toggle = Opts.args.cat6.args.AllowedTokens.args[ TokenName ];
                   toggle.name = TokenName;
                   toggle.type = "toggle";
                   toggle.order = order;
                   toggle.width = "double";
                   if ( count == 0 ) then
                        toggle.name = ColorUtils( "GetCText", "sgray", TokenName );
                   else
                        toggle.name = ColorUtils( "GetCText", "white", TokenName );
                   end
                   toggle.desc = ( "\nYour have %s.\n" ):format( ColorUtils( "GetCText", "sgray", count ) );
                   toggle.image = icon;
                   toggle.get = function()
                        print( TokenName, Tokens[ Player ][ TokenName ] );
                        return Tokens[ Player ][ TokenName ];
                   end
                   toggle.set = function( _, value )
                        print( TokenName, value );
                        Tokens[ Player ][ TokenName ] = value;
                   end
                   order = order + 1;
              end
         end
    end
    Characters = {
         ["Laughing Skull"] = {
              ["Lindarena"] = {
                   ["Badge"] = "Alliance",
                   ["Gold"] = 339827774,
                   ["Class"] = "Paladin",
                   ["Faction"] = "Alliance",
                   ["rGold"] = 339827774,
                   ["Level"] = 90,
                   ["Session"] = 5975.163000000001,
                   ["Hide"] = false,
              },
              ["Bellâtrix"] = {
                   ["Badge"] = "Alliance",
                   ["Faction"] = "Alliance",
                   ["Level"] = 32,
                   ["Gold"] = 975104,
                   ["rGold"] = 975104,
                   ["Class"] = "Priest",
                   ["Session"] = 7322.992,
                   ["Hide"] = false,
              },
         },
    }
    Tokens = {
         ["Lindarena"] = {
              ["Mark of the World Tree"] = false,
              ["Ironpaw Token"] = false,
              ["Epicurean's Award"] = false,
              ["Honor Points"] = false,
              ["Conquest Points"] = false,
              ["Illustrious Jewelcrafter's Token"] = false,
              ["Dalaran Jewelcrafter's Token"] = false,
              ["Darkmoon Prize Ticket"] = false,
              ["Valor Points"] = false,
              ["Tol Barad Commendation"] = false,
              ["Justice Points"] = false,
              ["Lesser Charm of Good Fortune"] = false,
              ["Champion's Seal"] = false,
              ["Timeless Coin"] = false,
         },
         ["Bellâtrix"] = {
              ["Epicurean's Award"] = false,
              ["Conquest Points"] = true,
         },
    }
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on LFG_UPDATE_RANDOM_INFO problem
    The information that you supplied is very vague as to what you are doing. Is it fair to assume that you are looking for someone that has left the group after a boss that didn't drop a item they were looking for? I myself would think that if you are looking to get the status of LFG you might what to start your testing with one of these events
    LFG_QUEUE_STATUS_UPDATE
    LFG_ROLE_UPDATE
    LFG_ROLE_CHECK_UPDATE

    WoWWiki is not much of a help as to what the LFG events do so, I would start by looking for it in the blizzard UI source available at http://wow.go-hero.net/.

    A list of the event can be found on WoWWiki or WoWPedia.

    I hope this information is found to be of use

    EDIT: Grammar and Added link to Curse's WoWPedia
    Posted in: Need Help?
  • 0

    posted a message on Secure Hook Problem
    Thanks, I understand now :)
    Posted in: Ace3
  • 0

    posted a message on Secure Hook Problem
    This is a example of what I am using and it errors out. any help to understand what I am doing wrong would be greatly appreciated

    -- Hooking WoW API
    function ButtonMagic:OnEnable()
         -- AceHook:SecureHook([object], method, [handler])
         self:SecureHook( "ActionButton_OnUpdate" );
         self:SecureHook( "ActionButton_Update", "ActionButton_Update", "ActionButton_UpdateUsable" );
         self:SecureHook( "ActionButton_UpdateUsable" );
    end
    
    -- Custom API Handlers
    function ButtonMagic:ActionButton_OnUpdate()
         -code Here
    end
    function ButtonMagic:ActionButton_UpdateUsable()
         -- Code here
    end


    resulting in this error
    Message: ..\AddOns\ButtonMagic\ButtonMagic.lua line 201:
    Usage: SecureHook([object], method, [handler]): 'handler' - Handler specified does not exist at self[handler]
    Posted in: Ace3
  • 0

    posted a message on OnTextChanged help!
    This is what worked for me.
         local aGlobal = AceGUI:Create("EditBox");
         aGlobal:DisableButton(true);
         aGlobal:SetLabel( L["Add Global Item : "] );
         aGlobal:SetCallback( "OnEnterPressed", function( self )
                   AutoProfitX:idUtils( "idAdd", "global", self.lasttext );
                   aGlobal:SetText("");
              end
         )

    would this not need to be in a options table type setup?
    Quote from Phanx

    aGlobal.SetCallback(aGlobal, "OnTextChanged", function() end)
    Posted in: Ace3
  • 0

    posted a message on OnTextChanged help!
    Quote from OrionShock
    aGlobal:SetCallback( "OnTextChanged", function( [B][I]self[/I],[/B] text )
                   AddOn:Print( "bug", "test for input = "..text )
              end
         )


    Your missing the "self" arg in the callback function. Just about any callbacks that are done wtih Ace3 will have a "self" arg that is the originating object ( the text box in this case )


    I was thinking that but when I was browsing the widget's code to try and figure it out on my own I could not see where it was passing self back.. thanks
    Posted in: Ace3
  • To post a comment, please or register a new account.