(beta) Full AceGui3.0 usage
This commit is contained in:
@@ -11,10 +11,11 @@ local ENCOUNTER_LOOT_RECEIVED_Frame = CreateFrame("Frame")
|
||||
ENCOUNTER_LOOT_RECEIVED_Frame:RegisterEvent("ENCOUNTER_LOOT_RECEIVED")
|
||||
ENCOUNTER_LOOT_RECEIVED_Frame:SetScript("OnEvent",
|
||||
function(self, event, ...)
|
||||
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ...
|
||||
name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(arg2)
|
||||
value = MX.TSM:GetItemValue(arg2, "DBMarket");
|
||||
if (value ~= nil and value >= Farmer_Logic_MinAlert and quality >= 1) then
|
||||
MX:SendAlert(arg2,value);
|
||||
local encounterID, itemID, itemLink, quantity, playerName, className, arg7, arg8, arg9 = ...
|
||||
name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(itemID)
|
||||
value = MX.TSM:GetItemValue(itemID, "DBMarket");
|
||||
local pn = UnitName("player");
|
||||
if (value ~= nil and value >= Farmer_Logic_MinAlert and quality >= 1 and playerName == pn) then
|
||||
MX:SendAlert(itemID,value);
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -10,35 +10,32 @@ local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
|
||||
local PLAYER_MONEY_Frame = CreateFrame("Frame")
|
||||
PLAYER_MONEY_Frame:RegisterEvent("PLAYER_MONEY")
|
||||
PLAYER_MONEY_Frame:SetScript("OnEvent", function(self, event, ...)
|
||||
local tmpMoney = GetMoney()
|
||||
if self.CurrentMoney then
|
||||
self.DiffMoney = tmpMoney - self.CurrentMoney
|
||||
else
|
||||
self.DiffMoney = 0
|
||||
end
|
||||
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();
|
||||
-- Reset Global Daily Counter
|
||||
if (Farmer_Logic_Day ~= day) then
|
||||
Farmer_Money_DayGlobal = 0;
|
||||
MX:UpdateText()
|
||||
Farmer_Logic_Day = day;
|
||||
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
|
||||
Farmer_Money_DayPlayer = Farmer_Money_DayPlayer + self.DiffMoney;
|
||||
Farmer_Money_MonthPlayer = Farmer_Money_MonthPlayer + self.DiffMoney;
|
||||
Farmer_Money_MonthGlobal = Farmer_Money_MonthGlobal + self.DiffMoney;
|
||||
Farmer_Money_DayGlobal = Farmer_Money_DayGlobal + self.DiffMoney;
|
||||
elseif self.DiffMoney < 0 then
|
||||
-- Money Lost
|
||||
end
|
||||
|
||||
local DiffGold = 0
|
||||
local NewGold = GetMoney() -- Get the player gold after the event
|
||||
DiffGold = NewGold - CurrentGold -- Get the gold difference
|
||||
|
||||
if (DiffGold > 0) then -- Gold gain
|
||||
|
||||
local weekday, month, day, year = CalendarGetDate();
|
||||
-- Reset Global Daily Counter
|
||||
if (Farmer_Logic_Day ~= day) then
|
||||
Farmer_Money_DayGlobal = 0;
|
||||
MX:UpdateMainUI()
|
||||
Farmer_Logic_Day = day;
|
||||
end
|
||||
|
||||
-- Write to SavedVariables
|
||||
Farmer_Money_MonthGlobal = Farmer_Money_MonthGlobal + DiffGold;
|
||||
Farmer_Money_DayGlobal = Farmer_Money_DayGlobal + DiffGold;
|
||||
|
||||
MX:UpdateMainUI()
|
||||
|
||||
elseif (DiffGold <= 0) then -- Gold lost
|
||||
|
||||
end
|
||||
|
||||
CurrentGold = GetMoney()
|
||||
DiffGold = 0
|
||||
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user