View Single Post
05-07-15, 04:19 PM   #6
Dorwido
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 54
Originally Posted by myrroddin View Post
Yes there is a simple way: don't use XML. XML is really only for setting up a frame that never changes, but you can do 99.9% of all frame related things in Lua, which is infinitely easier to read, and more importantly, debug.

In your ADDON_LOADED function (see my other post), assuming your saved variables in the ToC are called HistoriaDB, it should look something like this:
Code:
function private_table.eventFrame:ADDON_LOADED(AddOn)
    if not AddOn == MyAddOn then
        return
    end

    private_table.eventFrame:UnregisterEvent("ADDON_LOADED")
    HistoriaDB = HistoriaDB or {}
end

function private_table.eventFrame:PLAYER_LEVEL_UP(player_level)
    HistoriaDB["player"] = {name = UnitName("player"), level = player_level, current_time = GetTime()}
end
you should overwork
"if not AddOn == MyAddOn then
return
end"

2nd time i see you posting that which wont work
__________________
Auction Analytics
http://www.wowauction.org/
  Reply With Quote