(1.1.0) New major release

This commit is contained in:
mikx
2026-03-29 22:44:14 -04:00
parent f6e44ba298
commit b5110b56af
20 changed files with 1479 additions and 302 deletions

24
Event/PLAYER_MONEY.lua Normal file
View 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)