• 0

    posted a message on How to mix AceGUI widgets with Xml frames?
    Instead, you'd use AceConfigDialog-3.0 which uses AceGUI-3.0 internally, and was specifically designed for handling options tables.


    That's what I wanted to say :P

    I made a AceGUI widget for loot items (has a place for and items name, texture, type, drop rate) then i make 1-4 container frames (depending on how many difficulty's a dungeon has) this container i fill with a AceGUI Scrollframe, then i simply add all the items to the scrollframe which takes care of the layout for me thus saving me from needing to write all the scrollframe and layout code.


    This a good example of the issue I'm facing.

    It's pretty clear to me now that I shouldn't be using AceGUI for my main UI. I have a lot to rewrite now :P

    Thank you people!
    Posted in: Ace3
  • 0

    posted a message on How to mix AceGUI widgets with Xml frames?
    Ok, I'm not saying AceGUI it's the better option for me, just that it does some things I don't know how to handle the most important being "AceGUI:Release()". I understand this function disposes the frame to improve memory management.

    Anyway, Torhal you solved the main issue:

    For some reason, there's a major misconception by novice AddOn authors that AceGUI will make frame creation and manipulation easier - this isn't actually what it was designed for, and it is actually easier to use the default UI API for those things.


    I guess the best approach would be to use AceGUI to handle the option frames, and the default UI API for the rest. Isn't that right?
    Posted in: Ace3
  • 0

    posted a message on How to mix AceGUI widgets with Xml frames?
    Let me explain better. I have some of functionalities that are in the WoW API are not present in AceGUI, p.e.: the method SetResizable() on a frame widget, or SetTexture() on an options group. Maybe they exist, but they are not documented. So I just wanted to use those functions to create my addon's UI.

    Perhaps a better aproach is let AceGUI handle the Options frame so they look just how most addons do, and create the main window without AceGUI. I guess I could do that whith:

    local frm = Frame:Create()
    ...
    frm:Show()
    


    or something similar (I know where to find that documentation :P), but then I would have to handle a few things myself that now are handled by AceGUI.
    Posted in: Ace3
  • 0

    posted a message on How to mix AceGUI widgets with Xml frames?
    Hi everyone,

    First, I'm not sure if this is the correct forum since I want to mix Ace3 with non Ace code. Sorry if it should go somewhere ele.


    My question is, how to add a custom frame (xml designed) to an Ace widget. I know I can acces the widget's frame object this way:

    local mainWindow = gui:Create("Window")
    
    local frm = mainWindow.frame 
    


    I can access the API functions of that frame and so on, but let's say I have a frame defined in xml such as:

    <Frame name="EnsenameLaPasta" setAllPoints="true" hidden="true">
             <Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background"
                              edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
                <EdgeSize>
                   <AbsValue val="16"/>
                </EdgeSize>
                <TileSize>
                   <AbsValue val="16"/>
                </TileSize>
                <BackgroundInsets>
                   <AbsInset left="5" right="5" top="5" bottom="5"/>
                </BackgroundInsets>
             </Backdrop>
             <Layers>
                <Layer level="BACKGROUND">
                   <Texture name="EnMetalico" file="Interface\AddOns\EnsenameLaPasta\EnMetalico">
                      <Size x="16" y="16"/>
    
    ...

    (Extracted from Blizzards tutorial)

    Given this, how can I assign the frame's layout to the widget? :S

    Thanks!
    Posted in: Ace3
  • 0

    posted a message on How to handle "shift click"?
    Thanks to you both. Actually I had the blizzard's tool installed, but I've been looking for examples always on other addons. Obviously it's better to learn from Blizzard that any other user (even though the code might be better, but I've been to ¿newbie? to figure out that.

    It's just that I'm used to OOP programming with C#, which is a really good documented, and is been quite a change working with Lua and the WoW API!
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to handle "shift click"?
    Thanks It was really simple.

    What I was missing was "ChatEdit_InsertLink". I didn't know about this function nor where to search for it.

    I'm sorry to ask so many questions, but it's hard to get started on wow api developement when there's no much documentation.

    Thank you one more time.
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to handle "shift click"?
    Ok now I'm evene more confused. I changed SetItemRef to GameTooltip as you suggested, and works ok, but I still have the same problem. How do I handle shift-click to link the item in the chat?

    Here's the current code:

    local eqIcon = gui:Create("Icon")
            eqIcon:SetImage(eqTexture)
            eqIcon:SetImageSize(30,30)
            eqIcon:SetWidth(30)    
            eqIcon:SetCallback("OnEnter",function() BiSList:ShowItemTooltip(root,eqLink)end)
            eqIcon:SetCallback("OnLeave",function() GameTooltip:Hide() end)
            eqIcon:SetPoint("TOPLEFT", 5, 15)
            baseFrame:AddChild(eqIcon)


    edit: Notice that shift entering the icon, I get the two tooltips with item comparison (just as in any item link/icon on the inventory or chat, but still no "Shift-click to link" function
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to handle "shift click"?
    Thanks Elkano and jerry, I'm using SetItemRef for the "OnEnter" event. Let me explain myself with an image and some code:



    local eqIcon = gui:Create("Icon")
            eqIcon:SetImage(eqTexture)
            eqIcon:SetImageSize(30,30)
            eqIcon:SetWidth(30)    
            eqIcon:SetCallback("OnEnter",function() SetItemRef(eqLink,eqId) end)
            eqIcon:SetCallback("OnLeave",function() SetItemRef(eqLink,eqId) end)
            eqIcon:SetCallback("OnClick", function(self, button)
                                                local alt_key = IsAltKeyDown()
                                                local shift_key = IsShiftKeyDown()
                                                local control_key = IsControlKeyDown()
    
                                                if (button == "LeftButton" or button == "RightButton")  then
                                                    if alt_key then
                                                    elseif shift_key then
                                                        
                                                    elseif control_key then
                                                    else -- No modifier key is pressed
                                                    end
                                                else -- Handle MiddleButton
                                                end
                                            end)
            eqIcon:SetPoint("TOPLEFT", 5, 15)
            baseFrame:AddChild(eqIcon)


    Ok, the posted code is from the first column of icons. I like to display the ItemRef frame on OnEnter event, that's ok. I might change it to GameTooltip, but that's no an issue.

    What I want to add is the behaviour on items/item's links when you shift-click them from (p.e.) the inventory. You know, When you write on chat "hey I want [Som item shift-clicked from inventory], you know who drops it?"

    Or maybe, is there a way to write directly into the chat editbox?
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to handle "shift click"?
    @Torhal, thanks a lot, really clear code ^^. I'll try later since our servers are going under maintenance right now in spain. I figure with SendChatMessage would be able to link the item on the chat right?

    @Nevcairiel, sorry for that.. again. It's hard to tell for a newbie what is Ace3 code and what's WoW API code, since everything is written in Lua
    Posted in: Lua Code Discussion
  • 0

    posted a message on How to handle "shift click"?
    Hi everyone,

    I managed (thanks to this forum) to have item links with OnClick, OnEnter, OnLeave handlers but, how do I add a "Shift click handler"?

    I would like to emulate the behaviour on many addons and the game itself where the user shift-click an item to link it on the current chat frame.

    Any help?

    Thanks!
    Posted in: Lua Code Discussion
  • 0

    posted a message on AceComm chunk message
    It turned out all was about mispelling "success" on the if... Message was not cut, but chat message display only a limited amount of characters, that's what I got confused :P
    Posted in: Ace3
  • 0

    posted a message on AceComm chunk message
    Perhaps I should point that with this line:

    BiSList:Print(message)
    


    I get the table printed, but it's just a chunk of the table. I'm not sure if is because of AceComm having limits (it's not supposed to) or the Print() function
    Posted in: Ace3
  • 0

    posted a message on AceComm chunk message
    Actually, the code I'm using is from Ace3 Getting started page:

    MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceSerializer-3.0")
    
    serializedData = MyAddon:Serialize(MyVal1, MyVal2, MyVal3)
    
    success, MyVal1, MyVal2, MyVal3 = MyAddon:Deserialize(serializedData)
    


    I just can't see the difference between my code a this code :S
    Posted in: Ace3
  • 0

    posted a message on AceComm chunk message
    Hi everyone,

    I'm usin AceComm + AceSerializer to share information with other instances of my addon. Just to test that funcionality, I've tried with self.db.profile table. Here's the code:

    function BiSList:ShareProfile()
    
        local serializedProfile = BiSList:Serialize(self.db.profile)
        BiSList:SendCommMessage("bislistprofiledata",serializedProfile , "WHISPER", "Feadür")
    
    end
    
    
    function BiSList:OnCommReceived(prefix, message, distribution, sender)
        success, data = BiSList:Deserialize(message)
    
        BiSList:Print(message)
    
        if(succes)then
            BiSList:Print(data)
        else
            BiSList:Print("Error: " .. data)
        end
    end
    
    BiSList:RegisterComm("bislistprofiledata")


    BiSList:OnCommReceived is recieving the data, but it's just a chunk of the serialized table, and it never gets deserialized.

    I've read in http://www.wowace.com/addons/ace3/pages/api/ace-comm-3-0/ that there's no message length, so I don't know what it's happening.

    Any clue?

    Thanks!
    Posted in: Ace3
  • 0

    posted a message on Help with GameTooltip
    Thanks OrionShock, it's a bit weird for me developing with Lua since I come from from full OOP languages like c# or Java, but I'm getting it step by step thanks to this forums :)
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.