• 0

    posted a message on AceDB-3.0 config
    thanks, Think i solved it now
    Posted in: AddOn HELP!
  • 0

    posted a message on namespace
    First i create a table with strings called bgframe and then i do frames with that table. Strings and frames are different objects and i want to put the table with strings in namespace and how do i grab a table with frames from namespace?
    Posted in: Lua Code Discussion
  • 0

    posted a message on namespace
    This is what i ment. As you see i have a table called bgframe. So i guess my question is if i can use whole table in namespace and how i code it?

    -- BattleGrounds.lua --
    local ADDON_NAME, namespace = ...
    local L = namespace.L
    ---------------------
    -- Create Frames
    ---------------------
    local bgframe = {'ab','dwg','ssm','eots','tbfg'}
    for i = 1, 5 do
    bgframe[i] = CreateFrame("FRAME", bgframe[i], UIParent)
    end
    namespace.ab = ab
    namespace.eots = eots
    namespace.dwg = dwg
    namespace.tbfg = tbfg
    namespace.ssm = ssm

    -- BGCallouts.lua --
    local ADDON_NAME, namespace = ...
    local ab = namespace.ab
    local eots = namespace.eots
    local dwg = namespace.dwg
    local tbfg = namespace.tbfg
    local ssm = namespace.ssm
    local bgframe = {ab, dwg, ssm, eots, tbfg}
    Posted in: Lua Code Discussion
  • 0

    posted a message on namespace
    Hi i have my addon 'BGCallouts'
    I am not sure how to say this but i give it a try...
    In my 'BattleGrounds.lua' file (that is a draw up frames file) i put my frames in namespace one by one. In file 'BGCallouts.lua' i use my frames and need to grab them from namespace one by one.
    So my question is can i put them all in a table in namespace and grab whole table or is my coding ok as it is?

    /circoo
    Posted in: Lua Code Discussion
  • 0

    posted a message on AceDB-3.0 config
    I have an addon 'BGCallouts' and i want to save frame positions using AceDB. The problem is that it is really spoky for me. It work sometimes and sometimes the addon dont work at all. the problem lies in On Initialize() in BGCallouts.lua i think. it is when Initialize the database. One problem seems to be that i have 5 frames. And one problem is to set them visible using SetPoints(). Acctually i have no clue hove AceDB stores my positions. If you could take a look and give me a hint on these problems i would be greatful.

    /Circoo
    Posted in: AddOn HELP!
  • 0

    posted a message on what is a German server?
    Am i right if i server language is the langugage players speak on the server and client language is the language that the system use?
    Posted in: Need Help?
  • 0

    posted a message on what is a German server?
    ok but how can i know i select a German server with German client language?
    Posted in: Need Help?
  • 0

    posted a message on what is a German server?
    I have an addon "BGCallouts" and when i enter a German server the output language on the addon should be on German. I trqasferred to an German server to see if it worked, but it did not. I use this line to see what server type i am at.

    local LOCALE = GetLocale()
    when i print it out it says i am on an english/US server like this "enUS" but it should have been like this "deDE". I can force the addon to belive i am on an German server by typing this instead in the addon.

    local LOCALE = "deDE"
    So cqan anyone say what is going on with this German servers?:confused:
    Posted in: Need Help?
  • 0

    posted a message on Metatable for localization
    I was thinking of this row
    local _, namespace = ...
    compared to this
    local ADDON_NAME, namespace = ...

    why am i using _ (underscore) and not ADDON_NAME? is it the first file i load that have _ and other files use ex. 2?
    is it possible for another addon to grab variables from my addon or is it total safe?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metatable for localization
    All works great . I just wander about this row
    BGCallouts = LibStub("AceAddon-3.0"):NewAddon("BGCallouts", "AceConsole-3.0", "AceEvent-3.0" )

    AceAddon is for my initialize, enable and disable function. but AceConsole or AceEvent am i accually usig that and do i need it in my addon.

    i also wonder what Libs i have to have in my addon for this, now i have as u can see in attached file..

    i was guessing when i set up this and it was autoadded to my project in wowAddonstudio that i used when i started this project.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metatable for localization
    ok but i am not that good so i can see where i have to Show() button.. what is buttons whole name like ...
    ab.btn1 or ab.???
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metatable for localization
    I have now got rid of the .xml file and do my frames and buttons in lua file. It works very nice. All my variables and functions should now be local or in namespace. I wanna ask if i can improve 2 things.

    In BattleGrounds.lua i have

    ab.btn1:SetScript("OnClick", Farm_OnClick)

    can i improve that line to send or set variable z=L["Farm"] when i call the Farm_OnClick function? If so then i can repace all my functions in that file to one function that print out the message.

    I also made alot of buttons and they all have the same size etc. Can i code the buttons more smart so i dont have to repeat same code for different buttons all the time that would make the code 'simplier'?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metatable for localization
    can i just do this function local

    function Waterworks_OnClick()
    if (GetMouseButtonClicked()=="LeftButton") then

    to

    local function Waterworks_OnClick()
    if (GetMouseButtonClicked()=="LeftButton") then

    in .xml file i have
    <Script file="BattleGrounds.lua" />
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metatable for localization
    this code you gave me dont work and i dont know why. 'button' returns a nil value for me.

    function Waterworks_OnClick(self, button)
    -- self points to the UI object that was clicked on
    -- button is a string naming the mouse button that was used to click on it
    if (button=="LeftButton") then

    -----------------------
    can i make this function local

    function Blacksmith_OnClick(self, button)
    z=L["Blacksmith"]
    print(button)
    if (button=="LeftButton") then
    SendChatMessage(s..o..z..o..m, "INSTANCE_CHAT");
    else SendChatMessage(t..o..z..o..n, "INSTANCE_CHAT");
    end
    end

    to

    local function Blacksmith_OnClick(self, button)
    z=L["Blacksmith"]
    ...

    my .xml file have this
    <Script file="BattleGrounds.lua" />
    Posted in: Lua Code Discussion
  • 0

    posted a message on Metatable for localization
    THANK YOOOU that comma solved all problems
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.