commit from backup

This commit is contained in:
mikx
2018-01-05 06:40:15 -05:00
commit 58b08d6ae0
142 changed files with 29080 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
-- MxW (MxW Addon)
-- By mikx
-- https://git.mikx.ca/wow-addons/MxW_Addon
-- Licensed under the GNU General Public License 3.0
-- See included License file for more informations.
local MX = LibStub("AceAddon-3.0"):GetAddon("MxW");
local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
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);
end
end)

4
Event/Load_Events.xml Normal file
View File

@@ -0,0 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="ENCOUNTER_LOOT_RECEIVED.lua"/>
<Script file="PLAYER_MONEY.lua"/>
</Ui>

44
Event/PLAYER_MONEY.lua Normal file
View File

@@ -0,0 +1,44 @@
-- MxW (MxW Addon)
-- By mikx
-- https://git.mikx.ca/wow-addons/MxW_Addon
-- Licensed under the GNU General Public License 3.0
-- See included License file for more informations.
local MX = LibStub("AceAddon-3.0"):GetAddon("MxW");
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
end)