(1.1.0) New major release
This commit is contained in:
3
Event/Load_Events.xml
Normal file
3
Event/Load_Events.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="PLAYER_MONEY.lua"/>
|
||||
</Ui>
|
||||
24
Event/PLAYER_MONEY.lua
Normal file
24
Event/PLAYER_MONEY.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
local MX = LibStub("AceAddon-3.0"):GetAddon("MxW.Farm");
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("MxW.Farm");
|
||||
|
||||
local PLAYER_MONEY_Frame = CreateFrame("Frame")
|
||||
PLAYER_MONEY_Frame:RegisterEvent("PLAYER_MONEY")
|
||||
PLAYER_MONEY_Frame:SetScript("OnEvent", function(self, event, arg1)
|
||||
if event == "PLAYER_MONEY" then
|
||||
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
|
||||
-- Write to SavedVariables
|
||||
MxW_MonthlyGlobal = MxW_MonthlyGlobal + DiffGold;
|
||||
MxW_DailyGlobal = MxW_DailyGlobal + DiffGold;
|
||||
MX:RefreshDisplay()
|
||||
|
||||
elseif (DiffGold <= 0) then -- Gold lost
|
||||
|
||||
end
|
||||
|
||||
CurrentGold = GetMoney()
|
||||
DiffGold = 0
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user