(beta) Full AceGui3.0 usage

This commit is contained in:
mikx 2018-01-18 09:34:24 -05:00
parent 70e0a3c2e6
commit 7f292e2a7b
9 changed files with 161 additions and 237 deletions

View File

@ -11,10 +11,11 @@ local ENCOUNTER_LOOT_RECEIVED_Frame = CreateFrame("Frame")
ENCOUNTER_LOOT_RECEIVED_Frame:RegisterEvent("ENCOUNTER_LOOT_RECEIVED") ENCOUNTER_LOOT_RECEIVED_Frame:RegisterEvent("ENCOUNTER_LOOT_RECEIVED")
ENCOUNTER_LOOT_RECEIVED_Frame:SetScript("OnEvent", ENCOUNTER_LOOT_RECEIVED_Frame:SetScript("OnEvent",
function(self, event, ...) function(self, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ... local encounterID, itemID, itemLink, quantity, playerName, className, arg7, arg8, arg9 = ...
name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(arg2) name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(itemID)
value = MX.TSM:GetItemValue(arg2, "DBMarket"); value = MX.TSM:GetItemValue(itemID, "DBMarket");
if (value ~= nil and value >= Farmer_Logic_MinAlert and quality >= 1) then local pn = UnitName("player");
MX:SendAlert(arg2,value); if (value ~= nil and value >= Farmer_Logic_MinAlert and quality >= 1 and playerName == pn) then
MX:SendAlert(itemID,value);
end end
end) end)

View File

@ -10,35 +10,32 @@ local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
local PLAYER_MONEY_Frame = CreateFrame("Frame") local PLAYER_MONEY_Frame = CreateFrame("Frame")
PLAYER_MONEY_Frame:RegisterEvent("PLAYER_MONEY") PLAYER_MONEY_Frame:RegisterEvent("PLAYER_MONEY")
PLAYER_MONEY_Frame:SetScript("OnEvent", function(self, event, ...) PLAYER_MONEY_Frame:SetScript("OnEvent", function(self, event, ...)
local tmpMoney = GetMoney()
if self.CurrentMoney then local DiffGold = 0
self.DiffMoney = tmpMoney - self.CurrentMoney local NewGold = GetMoney() -- Get the player gold after the event
else DiffGold = NewGold - CurrentGold -- Get the gold difference
self.DiffMoney = 0
end if (DiffGold > 0) then -- Gold gain
self.CurrentMoney = tmpMoney
if self.DiffMoney > 0 then
-- Money Gain
-- Reset daily counter if this is a new day
local weekday, month, day, year = CalendarGetDate(); local weekday, month, day, year = CalendarGetDate();
-- Reset Global Daily Counter -- Reset Global Daily Counter
if (Farmer_Logic_Day ~= day) then if (Farmer_Logic_Day ~= day) then
Farmer_Money_DayGlobal = 0; Farmer_Money_DayGlobal = 0;
MX:UpdateText() MX:UpdateMainUI()
Farmer_Logic_Day = day; Farmer_Logic_Day = day;
end end
-- Reset Player Daily Counter
if (Farmer_Logic_PlayerDay ~= day) then
Farmer_Money_DayPlayer = 0;
MX:UpdateText()
Farmer_Logic_PlayerDay = day;
end
-- Write to SavedVariables -- Write to SavedVariables
Farmer_Money_DayPlayer = Farmer_Money_DayPlayer + self.DiffMoney; Farmer_Money_MonthGlobal = Farmer_Money_MonthGlobal + DiffGold;
Farmer_Money_MonthPlayer = Farmer_Money_MonthPlayer + self.DiffMoney; Farmer_Money_DayGlobal = Farmer_Money_DayGlobal + DiffGold;
Farmer_Money_MonthGlobal = Farmer_Money_MonthGlobal + self.DiffMoney;
Farmer_Money_DayGlobal = Farmer_Money_DayGlobal + self.DiffMoney; MX:UpdateMainUI()
elseif self.DiffMoney < 0 then
-- Money Lost elseif (DiffGold <= 0) then -- Gold lost
end end
CurrentGold = GetMoney()
DiffGold = 0
end) end)

View File

@ -8,134 +8,65 @@
local MX = LibStub("AceAddon-3.0"):GetAddon("MxW"); local MX = LibStub("AceAddon-3.0"):GetAddon("MxW");
local L = LibStub("AceLocale-3.0"):GetLocale("MxW"); local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
local AceGUI = LibStub("AceGUI-3.0") local AceGUI = LibStub("AceGUI-3.0")
local GUI_LOOTCOLLECTED, GUI_SCROLLCONTAINER local GUI_LOOTCOLLECTED, GUI_SCROLLCONTAINER
local lootCollectedLastEntry = nil local lootCollectedLastEntry = nil
--
-- main frame
local f = CreateFrame("Frame","FarmerMainFrame", UIParent)
local mxwVersion = GetAddOnMetadata("MxW", "Version") local mxwVersion = GetAddOnMetadata("MxW", "Version")
local mainFrameWidth = 350;
-- make it draggable with the mouse local backdrop = {
f:SetMovable(true) bgFile = [[Interface\Tooltips\UI-Tooltip-Background]],
f:EnableMouse(true) edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
f:SetScript("OnMouseDown", function(self, button) edgeSize = 2,
if button == "LeftButton" and not self.isMoving then insets = { left = 1, right = 1, top = 1, bottom = 1 }
self:StartMoving(); }
self.isMoving = true;
end
end)
f:SetScript("OnMouseUp", function(self, button)
if button == "LeftButton" and self.isMoving then
self:StopMovingOrSizing();
self.isMoving = false;
end
end)
f:SetScript("OnHide", function(self)
if ( self.isMoving ) then
self:StopMovingOrSizing();
self.isMoving = false;
end
end)
f:SetFrameStrata("BACKGROUND") --Set its strata local labTodayGold = AceGUI:Create("Label")
f:SetHeight(100) --Give it height local labMonthGold = AceGUI:Create("Label")
f:SetWidth(mainFrameWidth) --and width
f:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", --Set the background and border textures
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
tile = true, tileSize = 16, edgeSize = 10,
insets = { left = 4, right = 4, top = 4, bottom = 4 }
})
f:SetBackdropColor(0, 0, 0) --Set the background colour to black
f:SetPoint("CENTER") --Put it in the centre of the parent frame (UIParent)
f.txtLogo = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtLogo:SetFont("Fonts\\FRIZQT__.TTF", 14) --Set the font and size
f.txtLogo:SetTextColor(1, 1, 1) --Set the text colour
f.txtLogo:SetPoint("TOP", 0, -5) --Put it in the centre of the frame
f.txtLogo:SetText("MxW") --Change the displayed text
f.txtVersion = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtVersion:SetFont("Fonts\\FRIZQT__.TTF", 9) --Set the font and size
f.txtVersion:SetTextColor(1, 1, 1) --Set the text colour
f.txtVersion:SetPoint("TOP", -(mainFrameWidth/2) + (#mxwVersion*3.0), -5) --Put it in the centre of the frame
f.txtVersion:SetText(mxwVersion) --Change the displayed text
local button = CreateFrame("Button", nil, f)
button:SetPoint("TOP", f, "TOP", (mainFrameWidth/2) - #L["MainForm_Label_Close"]*6.0, -5)
button:SetWidth(#L["MainForm_Label_Close"]*10.5)
button:SetHeight(17)
button:SetText(L["MainForm_Label_Close"])
button:SetNormalFontObject("GameFontNormal")
local ntex = button:CreateTexture()
ntex:SetTexture("Interface/Buttons/UI-Panel-Button-Up")
ntex:SetTexCoord(0, 0.625, 0, 0.6875)
ntex:SetAllPoints()
button:SetNormalTexture(ntex)
local htex = button:CreateTexture()
htex:SetTexture("Interface/Buttons/UI-Panel-Button-Highlight")
htex:SetTexCoord(0, 0.625, 0, 0.6875)
htex:SetAllPoints()
button:SetHighlightTexture(htex)
local ptex = button:CreateTexture()
ptex:SetTexture("Interface/Buttons/UI-Panel-Button-Down")
ptex:SetTexCoord(0, 0.625, 0, 0.6875)
ptex:SetAllPoints()
button:SetPushedTexture(ptex)
button:SetScript("OnClick", function(self, arg1)
f:Hide();
end)
f.txtLabTM = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtLabTM:SetFont("Fonts\\FRIZQT__.TTF", 10) --Set the font and size
f.txtLabTM:SetTextColor(1, 1, 1) --Set the text colour
f.txtLabTM:SetPoint("TOP", 0, -20) --Put it in the centre of the frame
f.txtLabTM:SetText(format("%s / %s",L["MainForm_Label_Money_Lab_Today"],L["MainForm_Label_Money_Lab_Month"])) --Change the displayed text
f.txtPlayer = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtPlayer:SetFont("Fonts\\FRIZQT__.TTF", 10) --Set the font and size
f.txtPlayer:SetTextColor(1, 1, 1) --Set the text colour
f.txtPlayer:SetPoint("TOPLEFT", 10, -32) --Put it in the centre of the frame
f.txtPlayer:SetText(L["MainForm_Label_Money_Player"]) --Change the displayed text
f.txtGlobal = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtGlobal:SetFont("Fonts\\FRIZQT__.TTF", 10) --Set the font and size
f.txtGlobal:SetTextColor(1, 1, 1) --Set the text colour
f.txtGlobal:SetPoint("TOPLEFT", 10, -42) --Put it in the centre of the frame
f.txtGlobal:SetText(L["MainForm_Label_Money_Global"]) --Change the displayed text
f.txtLootLabel = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtLootLabel:SetFont("Fonts\\FRIZQT__.TTF", 10) --Set the font and size
f.txtLootLabel:SetTextColor(1, 1, 1) --Set the text colour
f.txtLootLabel:SetPoint("TOP", 0, -56) --Put it in the centre of the frame
f.txtLootLabel:SetText(L["MainForm_Label_Loot"]) --Put it in the centre of the frame
f.txtLootLinkQty = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtLootLinkQty:SetFont("Fonts\\FRIZQT__.TTF", 10) --Set the font and size
f.txtLootLinkQty:SetTextColor(1, 1, 1) --Set the text colour
f.txtLootLinkQty:SetPoint("TOP", 0, -66)
f.txtLast = f:CreateFontString(nil, "ARTWORK") --Create a FontString to display text
f.txtLast:SetFont("Fonts\\FRIZQT__.TTF", 10) --Set the font and size
f.txtLast:SetTextColor(1, 1, 1) --Set the text colour
f.txtLast:SetPoint("TOPLEFT", 10, -62) --Put it in the centre of the frame
function MX:ShowMainUI()
local MAIN_UI = AceGUI:Create("Window") local MAIN_UI = AceGUI:Create("Window")
MAIN_UI:Hide() MAIN_UI:SetHeight(100)
MAIN_UI:SetHeight(200) MAIN_UI:SetTitle("MxW " .. self.db.profile.version)
MAIN_UI:SetTitle("MxW") MAIN_UI:SetStatusTable(self.db.profile.mainUI)
MAIN_UI:SetLayout("Flow") MAIN_UI:SetLayout("List")
MAIN_UI:SetWidth(300) MAIN_UI:SetWidth(300)
MAIN_UI:EnableResize(true) MAIN_UI:EnableResize(false)
labTodayGold:SetFont("Fonts\\FRIZQT__.TTF", 10)
labTodayGold:SetColor(1, 1, 1)
labTodayGold:SetFullWidth(true)
MAIN_UI:AddChild(labTodayGold)
labMonthGold:SetFont("Fonts\\FRIZQT__.TTF", 10)
labMonthGold:SetColor(1, 1, 1)
labMonthGold:SetFullWidth(true)
MAIN_UI:AddChild(labMonthGold)
local labSpace = AceGUI:Create("Label")
labSpace:SetFont("Fonts\\FRIZQT__.TTF", 10)
labSpace:SetColor(1, 1, 1)
labSpace:SetFullWidth(true)
labSpace:SetText(" ")
MAIN_UI:AddChild(labSpace)
local BUTTON_LOOTLIST = AceGUI:Create("Button")
BUTTON_LOOTLIST:SetAutoWidth(true)
BUTTON_LOOTLIST:SetText(L["MainForm_Button_LootList"])
BUTTON_LOOTLIST:SetPoint("RIGHT", 5, 15)
BUTTON_LOOTLIST:SetCallback("OnClick",
function()
MX:ShowListUI()
end
)
MAIN_UI:AddChild(BUTTON_LOOTLIST)
end
function MX:ShowListUI()
local LOOTLIST_UI = AceGUI:Create("Window")
LOOTLIST_UI:SetHeight(100)
LOOTLIST_UI:SetTitle(L["MainForm_Button_LootList"])
LOOTLIST_UI:SetStatusTable(self.db.profile.lootlistUI)
LOOTLIST_UI:SetLayout("List")
LOOTLIST_UI:SetWidth(300)
GUI_SCROLLCONTAINER = AceGUI:Create("SimpleGroup") GUI_SCROLLCONTAINER = AceGUI:Create("SimpleGroup")
GUI_SCROLLCONTAINER:SetFullWidth(true) GUI_SCROLLCONTAINER:SetFullWidth(true)
@ -147,44 +78,27 @@ GUI_SCROLLCONTAINER.frame:SetBackdropBorderColor(0.4, 0.4, 0.4)
GUI_LOOTCOLLECTED = AceGUI:Create("ScrollFrame") GUI_LOOTCOLLECTED = AceGUI:Create("ScrollFrame")
GUI_LOOTCOLLECTED:SetLayout("Flow") GUI_LOOTCOLLECTED:SetLayout("Flow")
LOOTLIST_UI:AddChild(GUI_SCROLLCONTAINER)
GUI_SCROLLCONTAINER:AddChild(GUI_LOOTCOLLECTED) GUI_SCROLLCONTAINER:AddChild(GUI_LOOTCOLLECTED)
MAIN_UI:AddChild(GUI_SCROLLCONTAINER) end
local MainFrame_Event_ADDON_LOADED = CreateFrame("Frame") local MainFrame_Event_ADDON_LOADED = CreateFrame("Frame")
MainFrame_Event_ADDON_LOADED:RegisterEvent("ADDON_LOADED") MainFrame_Event_ADDON_LOADED:RegisterEvent("ADDON_LOADED")
MainFrame_Event_ADDON_LOADED:SetScript("OnEvent", function(self, event, ...) MainFrame_Event_ADDON_LOADED:SetScript("OnEvent", function(self, event, ...)
MX:UpdateText()
end) end)
local MainFrame_Event_PLAYER_MONEY = CreateFrame("Frame") local MainFrame_Event_PLAYER_ENTERING_WORLD = CreateFrame("Frame")
MainFrame_Event_PLAYER_MONEY:RegisterEvent("PLAYER_MONEY") MainFrame_Event_PLAYER_ENTERING_WORLD :RegisterEvent("PLAYER_ENTERING_WORLD")
MainFrame_Event_PLAYER_MONEY:SetScript("OnEvent", function(self, event, ...) MainFrame_Event_PLAYER_ENTERING_WORLD :SetScript("OnEvent", function(self, event, ...)
MX:UpdateText() -- Init gold variable
CurrentGold = GetMoney()
MX:UpdateMainUI()
end) end)
local MainFrame_Event_ENCOUNTER_LOOT_RECEIVED = CreateFrame("Frame") function MX:UpdateMainUI()
MainFrame_Event_ENCOUNTER_LOOT_RECEIVED:RegisterEvent("ENCOUNTER_LOOT_RECEIVED") labTodayGold:SetText(format("%s (%s)", MX:FormatMoney(Farmer_Money_DayGlobal),L["MainForm_Label_Money_Lab_Today"]))
MainFrame_Event_ENCOUNTER_LOOT_RECEIVED:SetScript("OnEvent", function(self, event, ...) labMonthGold:SetText(format("%s (%s)", MX:FormatMoney(Farmer_Money_MonthGlobal),L["MainForm_Label_Money_Lab_Month"]))
local arg1, iid, ilink, iqty, arg5, arg6, arg7, arg8, arg9 = ...
--name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(iid);
value = MX.TSM:GetItemValue(iid, "DBMarket");
if (value ~= nil and value >= Farmer_Logic_MinAlert and quality >= 0) then
--f.txtLast:SetText(format("%s %s (%s) (%s %s)",L["MainForm_Label_Money_Last"],link,MX:FormatMoney(value),L["MainForm_Label_Money_Min"],MX:FormatMoney(Farmer_Logic_MinAlert)));
local fv = MX:FormatMoneyShort(value);
local tfv = MX:FormatMoneyShort(value*iqty);
if (iqty > 1) then
f.txtLootLinkQty:SetText(format("%sx %s (%s) (T. %s)", iqty, ilink, fv, tfv));
MX:addItem2LootCollectedList(format("%sx %s (%s) (T. %s)", iqty, ilink, fv, tfv),texture)
elseif (iqty == 1) then
f.txtLootLinkQty:SetText(format("%sx %s (%s)", iqty, ilink, fv));
MX:addItem2LootCollectedList(format("%sx %s (%s)", iqty, ilink, fv),texture)
end
end
end)
function MX:UpdateText()
f.txtPlayer:SetText(format("%s %s / %s",L["MainForm_Label_Money_Player"], MX:FormatMoney(Farmer_Money_DayPlayer), MX:FormatMoney(Farmer_Money_MonthPlayer))) --Change the displayed text
f.txtGlobal:SetText(format("%s %s / %s",L["MainForm_Label_Money_Global"], MX:FormatMoney(Farmer_Money_DayGlobal), MX:FormatMoney(Farmer_Money_MonthGlobal))) --Change the displayed text
end end
function MX:ShowMain() function MX:ShowMain()

View File

@ -6,7 +6,6 @@
local MX = LibStub("AceAddon-3.0"):GetAddon("MxW"); local MX = LibStub("AceAddon-3.0"):GetAddon("MxW");
local L = LibStub("AceLocale-3.0"):GetLocale("MxW"); local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
print("Alert.lua has been loaded.");
-- Alert Cooking -- Alert Cooking
-- Based on [[ AchievementAlertFrame ]] from Blizzard -- Based on [[ AchievementAlertFrame ]] from Blizzard

View File

@ -3,6 +3,5 @@
<Script file="DB.lua"/> <Script file="DB.lua"/>
<Script file="Math.lua"/> <Script file="Math.lua"/>
<Script file="Money.lua"/> <Script file="Money.lua"/>
<Script file="Option.lua"/>
<Script file="TSM.lua"/> <Script file="TSM.lua"/>
</Ui> </Ui>

View File

@ -27,6 +27,9 @@ L["MainForm_Label_Money_Min"] = "Min.";
L["MainForm_Label_LastBoE"] = "Dernier BOE :" L["MainForm_Label_LastBoE"] = "Dernier BOE :"
L["MainForm_Label_LastBoE_NONE"] = "n/d" L["MainForm_Label_LastBoE_NONE"] = "n/d"
L["MainForm_Label_Loot"] = "- BUTIN -"; L["MainForm_Label_Loot"] = "- BUTIN -";
L["MainForm_Button_LootList"] = "Liste de loot(s)";
L["MainForm_Group_Features"] = "Fonctions";
L["MainForm_Group_Gold"] = "Or";
-- Alert Classes -- Alert Classes
L["Alert_Class_Consumable"] = "Consommable"; L["Alert_Class_Consumable"] = "Consommable";

View File

@ -27,5 +27,8 @@ L["MainForm_Label_Money_Min"] = "Min.";
L["MainForm_Label_LastBoE"] = "Last BOE:" L["MainForm_Label_LastBoE"] = "Last BOE:"
L["MainForm_Label_LastBoE_NONE"] = "n/a" L["MainForm_Label_LastBoE_NONE"] = "n/a"
L["MainForm_Label_Loot"] = "- LOOT -"; L["MainForm_Label_Loot"] = "- LOOT -";
L["MainForm_Button_LootList"] = "Loot List";
L["MainForm_Group_Features"] = "Fonctions";
L["MainForm_Group_Gold"] = "Or";
L["Alert_TradeGoods"] = "Trade Goods"; L["Alert_TradeGoods"] = "Trade Goods";

View File

@ -1,12 +1,11 @@
## Interface: 70300 ## Interface: 70300
## Title: |cff1784d1MxW|r ## Title: |cff1784d1MxW|r
## Version: 1.0.0_7.3.2 ## Version: 1.1.1b_7.3.5
## Author: mikx ## Author: mikx
## Notes: MxW Addon ## Notes: MxW Addon
## RequiredDeps: TradeSkillMaster, TradeSkillMaster_AuctionDB ## RequiredDeps: TradeSkillMaster, TradeSkillMaster_AuctionDB
## OptionalDeps: TradeSkillMaster_WoWuction, TheUndermineJournal ## OptionalDeps: TradeSkillMaster_WoWuction, TheUndermineJournal
## SavedVariables: MxWDB,Farmer_Logic_Day,Farmer_Logic_MinUI,Farmer_Logic_MinAlert,Farmer_Money_MonthGlobal,Farmer_Money_DayGlobal ## SavedVariables: MxWDB,CurrentGold,Farmer_Logic_Day,Farmer_Logic_MinUI,Farmer_Logic_MinAlert,Farmer_Money_MonthGlobal,Farmer_Money_DayGlobal
## SavedVariablesPerCharacter: Farmer_Logic_PlayerDay,Farmer_Money_MonthPlayer,Farmer_Money_DayPlayer
Libraries\Load_Libraries.xml Libraries\Load_Libraries.xml
Locale\Load_Locales.xml Locale\Load_Locales.xml

View File

@ -4,9 +4,9 @@
-- Licensed under the GNU General Public License 3.0 -- Licensed under the GNU General Public License 3.0
-- See included License file for more informations. -- See included License file for more informations.
local MxW, mx = ... local MX = LibStub("AceAddon-3.0"):NewAddon("MxW", "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0");
local MX = LibStub("AceAddon-3.0"):NewAddon(mx, MxW, "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0");
local L = LibStub("AceLocale-3.0"):GetLocale("MxW"); local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
local AceGUI = LibStub("AceGUI-3.0")
local MXLDB = LibStub("LibDataBroker-1.1"):NewDataObject("MxW", { local MXLDB = LibStub("LibDataBroker-1.1"):NewDataObject("MxW", {
type = "data source", type = "data source",
@ -16,19 +16,17 @@ local MXLDB = LibStub("LibDataBroker-1.1"):NewDataObject("MxW", {
}) })
local icon = LibStub("LibDBIcon-1.0") local icon = LibStub("LibDBIcon-1.0")
function MX:OnInitialize() local defaults = {
self.db = LibStub("AceDB-3.0"):New("MxWDB", {
profile = { profile = {
minimap = { debug = false,
hide = false, version = 0,
}, minimapIcon = { hide = false, minimapPos = 220, radius = 80, },
}, mainUI = 0
}) }
icon:Register("MxW", MXLDB, self.db.profile.minimap) }
end
-- Meta Data function MX:OnInitialize()
local mxwVersion = GetAddOnMetadata("MxW", "Version") self.db = LibStub:GetLibrary("AceDB-3.0"):New("MxWDB")
-- Init Saved Variables -- Init Saved Variables
if (Farmer_Logic_Day == nil) then if (Farmer_Logic_Day == nil) then
@ -41,12 +39,6 @@ end
if (Farmer_Money_MonthGlobal == nil) then if (Farmer_Money_MonthGlobal == nil) then
Farmer_Money_MonthGlobal = 0; Farmer_Money_MonthGlobal = 0;
end end
if (Farmer_Money_DayPlayer == nil) then
Farmer_Money_DayPlayer = 0;
end
if (Farmer_Money_MonthPlayer == nil) then
Farmer_Money_MonthPlayer = 0;
end
if (Farmer_Logic_MinUI == nil) then if (Farmer_Logic_MinUI == nil) then
Farmer_Logic_MinUI = 3000; Farmer_Logic_MinUI = 3000;
end end
@ -54,5 +46,22 @@ if (Farmer_Logic_MinAlert == nil) then
Farmer_Logic_MinAlert = 3000; Farmer_Logic_MinAlert = 3000;
end end
if (self.db.profile.mainUI == nil) then
self.db.profile.mainUI = { ["height"] = 100, ["top"] = 50, ["left"] = 50, ["width"] = 300, }
end
if (self.db.profile.lootlistUI == nil) then
self.db.profile.lootlistUI = { ["height"] = 100, ["top"] = 50, ["left"] = 50, ["width"] = 300, }
end
-- Meta Data
local mxwVersion = GetAddOnMetadata("MxW", "Version")
self.db.profile.version = mxwVersion
-- Message -- Message
print("MxW v." .. mxwVersion .. L["Message_Loaded"]); print("MxW v." .. self.db.profile.version .. L["Message_Loaded"]);
end
function MX:OnEnable()
MX:ShowMainUI()
end