diff --git a/Event/LOOT_OPENED.lua b/Event/LOOT_OPENED.lua
index 2cbbe54..86e9189 100644
--- a/Event/LOOT_OPENED.lua
+++ b/Event/LOOT_OPENED.lua
@@ -10,6 +10,7 @@ local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
local numItems
local iLink
local value
+local by = 300
local LOOT_OPENED_Frame = CreateFrame("Frame")
LOOT_OPENED_Frame:RegisterEvent("LOOT_OPENED")
@@ -22,59 +23,21 @@ LOOT_OPENED_Frame:SetScript("OnEvent",
numItems = GetNumLootItems()
-- loop each loot slot
for i = 1, numItems do
+ -- get lootslotinfo to get item stack size
+ lootIcon, lootName, lootQuantity, currencyID, lootQuality, locked, isQuestItem, questID, isActive = GetLootSlotInfo(i)
-- get loot slot link to get iteminfo, we can't use item name due to API limitation
iLink = GetLootSlotLink(i)
-- get the iteminfo and continue only if the itemlink is not empty (EXEMPLE: money in a slot = empty)
if (iLink ~= nil) then
- -- get the iteminfo using the slot itemlink
- name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(iLink)
+ name, link, quality, iLevel, reqLevel, class, subclass, stack, equipSlot, texture, vendorPrice = GetItemInfo(iLink)
-- get the item value using the link, return nil if the item has no value
local itemId = MX:ToItemID(link);
if (itemId ~= nil) then
value = MX.TSM:GetItemValue(itemId, "DBMinBuyout");
end
- -- MINIMUM QUALITY SETTINGS ------
- local eq = 2 -- equipable quality
- local mq = 1 -- mats quality
- local cq = 1 -- consumable quality
- local oq = 1 -- other quality
- local rq = 1 -- recipe quality
- ----------------------------------
- -- if value is nil, the object is not BoE/not known by TSM & Looter is the player
- -- we use locales because the item class is localized by the client
- if (value ~= nil and Settings_Alert_Enabled) then
- if(class == L["Alert_Class_Armor"]) then
- if (value >= Farmer_Logic_MinAlert and quality >= eq) then
- MX:SendAlert(link,value);
- MX:ChatGuildLootMessage(link,value);
- end
- elseif(class == L["Alert_Class_Weapon"]) then
- if (value >= Farmer_Logic_MinAlert and quality >= eq) then
- MX:SendAlert(link,value);
- MX:ChatGuildLootMessage(link,value);
- end
- elseif(class == L["Alert_Class_TradeGoods"]) then
- if (value >= Farmer_Logic_MinAlert and quality >= mq) then
- MX:SendAlert(link,value);
- MX:ChatGuildLootMessage(link,value);
- end
- elseif(class == L["Alert_Class_Consumable"]) then
- if (value >= Farmer_Logic_MinAlert and quality >= cq) then
- MX:SendAlert(link,value);
- MX:ChatGuildLootMessage(link,value);
- end
- elseif(class == L["Alert_Class_Misc"]) then
- if (value >= Farmer_Logic_MinAlert and quality >= oq) then
- MX:SendAlert(link,value);
- MX:ChatGuildLootMessage(link,value);
- end
- elseif(class == "Recipe") then
- if (value >= Farmer_Logic_MinAlert and quality >= rq) then
- MX:SendAlert(link,value);
- MX:ChatGuildLootMessage(link,value);
- end
- end
+ MX:SendAlert(iLink,lootQuantity,value,by)
+ by = by - 85
end
if (value ~= nil) then
Farmer_Money_LootSession = Farmer_Money_LootSession + value;
@@ -82,8 +45,54 @@ LOOT_OPENED_Frame:SetScript("OnEvent",
value = nil
iLink = nil
end
- end
+ end
+ by = 300
+ end
+ end)
+
+function MX:SendAlert(link,lootQuantity,value,y)
+ -- get the iteminfo using the slot itemlink
+ name, link, quality, iLevel, reqLevel, class, subclass, stack, equipSlot, texture, vendorPrice = GetItemInfo(link)
+ -- MINIMUM QUALITY SETTINGS ------
+ local eq = 2 -- equipable quality
+ local mq = 1 -- mats quality
+ local cq = 1 -- consumable quality
+ local oq = 1 -- other quality
+ local rq = 1 -- recipe quality
+ ----------------------------------
+ -- if value is nil, the object is not BoE/not known by TSM & Looter is the player
+ -- we use locales because the item class is localized by the client
+ if (value ~= nil and Settings_Alert_Enabled) then
+ if(class == L["Alert_Class_Armor"]) then
+ if (value >= Farmer_Logic_MinAlert and quality >= eq) then
+ MX:ShowAlert(link,lootQuantity,value,y);
+ MX:ChatGuildLootMessage(link,value);
+ end
+ elseif(class == L["Alert_Class_Weapon"]) then
+ if (value >= Farmer_Logic_MinAlert and quality >= eq) then
+ MX:ShowAlert(link,lootQuantity,value,y);
+ MX:ChatGuildLootMessage(link,value);
+ end
+ elseif(class == L["Alert_Class_TradeGoods"]) then
+ if (value >= Farmer_Logic_MinAlert and quality >= mq) then
+ MX:ShowAlert(link,lootQuantity,value,y);
+ MX:ChatGuildLootMessage(link,value);
+ end
+ elseif(class == L["Alert_Class_Consumable"]) then
+ if (value >= Farmer_Logic_MinAlert and quality >= cq) then
+ MX:ShowAlert(link,lootQuantity,value,y);
+ MX:ChatGuildLootMessage(link,value);
+ end
+ elseif(class == L["Alert_Class_Misc"]) then
+ if (value >= Farmer_Logic_MinAlert and quality >= oq) then
+ MX:ShowAlert(link,lootQuantity,value,y);
+ MX:ChatGuildLootMessage(link,value);
+ end
+ elseif(class == "Recipe") then
+ if (value >= Farmer_Logic_MinAlert and quality >= rq) then
+ MX:ShowAlert(link,lootQuantity,value,y);
+ MX:ChatGuildLootMessage(link,value);
end
end
-
-end)
+ end
+end
diff --git a/Frame/Frame_Alert.lua b/Frame/Frame_Alert.lua
new file mode 100644
index 0000000..4b93721
--- /dev/null
+++ b/Frame/Frame_Alert.lua
@@ -0,0 +1,88 @@
+-- MxW (MxW Addon)
+-- By mikx
+-- https://git.mikx.xyz/mikx/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 AceGUI = LibStub("AceGUI-3.0")
+local GUI_LOOTCOLLECTED, GUI_SCROLLCONTAINER
+local lootCollectedLastEntry = nil
+local mxwVersion = GetAddOnMetadata("MxW", "Version")
+
+local date = C_DateAndTime.GetCurrentCalendarTime();
+local weekday, month, day, year = date.weekday, date.month, date.monthDay, date.year;
+
+function MX:ShowAlert(item,stackqty,value,y)
+ local AlertUI = CreateFrame("Frame", string.format("%sAlert%d", "mxw", y), nil, "BackdropTemplate")
+ local AlertIcon = AlertUI:CreateTexture(nil,"ARTWORK")
+ local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(item)
+
+ AlertUI:SetFrameStrata("BACKGROUND")
+ AlertUI:SetWidth(300)
+ AlertUI:SetHeight(80)
+ AlertUI:SetPoint("CENTER", 0, y)
+
+ AlertUI:SetBackdrop(
+ {
+ bgFile = "Interface/Tooltips/UI-Tooltip-Background",
+ edgeFile = "Interface/Buttons/WHITE8x8",
+ tile = true, tileSize = 16, edgeSize = 1,
+ insets = { left = 2, right = 2, top = 2, bottom = 2 }
+ });
+ AlertUI:SetBackdropColor(0.20,0.20,0.20,1);
+
+ -- Label - Title
+ AlertUI.title = AlertUI:CreateFontString(nil, "ARTWORK");
+ AlertUI.title:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 12);
+ AlertUI.title:SetPoint("CENTER",35,30);
+ AlertUI.title:SetTextColor(1.00,0.49,0.04);
+ AlertUI.title:SetText(L["Alert_Frame_Title"]);
+
+ -- Label - Thresold
+ AlertUI.thresold = AlertUI:CreateFontString(nil, "ARTWORK");
+ AlertUI.thresold:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 10);
+ AlertUI.thresold:SetPoint("CENTER",35,17);
+ AlertUI.thresold:SetTextColor(1,1,1);
+ AlertUI.thresold:SetText(L["Alert_Frame_Thresold"]..MX:FormatMoneyGoldOnly(Farmer_Logic_MinAlert));
+
+ -- Label - ItemLink
+ AlertUI.itemlink = AlertUI:CreateFontString(nil, "ARTWORK");
+ AlertUI.itemlink:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 10);
+ AlertUI.itemlink:SetPoint("CENTER",35,0);
+ AlertUI.itemlink:SetTextColor(1,1,1);
+ AlertUI.itemlink:SetText(itemLink);
+
+ -- Label - Item Value
+ AlertUI.itemlink = AlertUI:CreateFontString(nil, "ARTWORK");
+ AlertUI.itemlink:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 10);
+ AlertUI.itemlink:SetPoint("CENTER",35,-11);
+ AlertUI.itemlink:SetTextColor(1,1,1);
+ AlertUI.itemlink:SetText(MX:FormatMoney(value));
+
+ -- Label - Item Stack
+ AlertUI.itemlink = AlertUI:CreateFontString(nil, "ARTWORK");
+ AlertUI.itemlink:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 10);
+ AlertUI.itemlink:SetPoint("CENTER",35,-22);
+ AlertUI.itemlink:SetTextColor(1,1,1);
+ AlertUI.itemlink:SetText(L["Alert_Frame_Stack"]..stackqty);
+
+ -- Label - Item Quantity
+ AlertUI.itemlink = AlertUI:CreateFontString(nil, "ARTWORK");
+ AlertUI.itemlink:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 10);
+ AlertUI.itemlink:SetPoint("CENTER",35,-32);
+ AlertUI.itemlink:SetTextColor(1,1,1);
+ local itemId = MX:ToItemID(itemLink);
+ local qty = MX.TSM:GetItemQuantity(itemId);
+ local fqty = qty + stackqty;
+ AlertUI.itemlink:SetText(L["Alert_Frame_Quantity"]..fqty);
+
+ AlertIcon:SetPoint("LEFT", 10, 0);
+
+ PlaySoundFile("Interface\\Addons\\MxW\\Media\\Sound\\register.mp3", "Master")
+
+ AlertIcon:SetTexture(itemTexture);
+
+ UIFrameFlash(AlertUI, 1, 10, 10, false, 12, 0);
+end
diff --git a/Frame/Frame_Main.lua b/Frame/Frame_Main.lua
index ed4c2b6..52f4a43 100644
--- a/Frame/Frame_Main.lua
+++ b/Frame/Frame_Main.lua
@@ -38,31 +38,38 @@ MainUI:SetBackdrop(
});
MainUI:SetBackdropColor(0.20,0.20,0.20,1);
--- Label - Title + version
+-- Label - Titleersion
MainUI.title = MainUI:CreateFontString(nil, "ARTWORK");
-MainUI.title:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 10);
-MainUI.title:SetPoint("CENTER",0,27);
+MainUI.title:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 14);
+MainUI.title:SetPoint("CENTER",0,30);
MainUI.title:SetTextColor(1.00,0.49,0.04);
-MainUI.title:SetText("MxW " .. mxwVersion);
+MainUI.title:SetText("MxW");
+
+-- Label - Version
+MainUI.version = MainUI:CreateFontString(nil, "ARTWORK");
+MainUI.version:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 8);
+MainUI.version:SetPoint("CENTER",0,23);
+MainUI.version:SetTextColor(1.00,0.49,0.04);
+MainUI.version:SetText(mxwVersion);
-- Label - Daily
MainUI.daily = MainUI:CreateFontString(nil, "ARTWORK");
-MainUI.daily:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 8);
+MainUI.daily:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 11);
MainUI.daily:SetPoint("LEFT",4,10);
-- Label - Monthly
MainUI.monthly = MainUI:CreateFontString(nil, "ARTWORK");
-MainUI.monthly:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 8);
-MainUI.monthly:SetPoint("LEFT",4,2);
+MainUI.monthly:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 11);
+MainUI.monthly:SetPoint("LEFT",4,0);
-- Label - Record
MainUI.record = MainUI:CreateFontString(nil, "ARTWORK");
-MainUI.record:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 8);
+MainUI.record:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 11);
MainUI.record:SetPoint("LEFT",4,-13);
-- Label - Session Loot
MainUI.loot = MainUI:CreateFontString(nil, "ARTWORK");
-MainUI.loot:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 8);
+MainUI.loot:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 11);
MainUI.loot:SetPoint("LEFT",4,-23);
-- Button - Config
@@ -137,8 +144,8 @@ MainUI:Show()
function MX:MainUIUpdate()
local DayColor = "|cff1ead01";
local GoldMedian = floor(Farmer_Money_MonthGlobal / DayCounter);
- MainUI.daily:SetText(format("%s (%s)", MX:FormatMoney(Farmer_Money_DayGlobal),L["MainForm_Label_Money_Lab_Today"]))
- MainUI.monthly:SetText(format("%s (%s)", MX:FormatMoney(Farmer_Money_MonthGlobal),L["MainForm_Label_Money_Lab_Month"]))
+ MainUI.daily:SetText(format("%s (%s)", MX:FormatMoneyGoldOnly(Farmer_Money_DayGlobal),L["MainForm_Label_Money_Lab_Today"]))
+ MainUI.monthly:SetText(format("%s (%s)", MX:FormatMoneyGoldOnly(Farmer_Money_MonthGlobal),L["MainForm_Label_Money_Lab_Month"]))
MainUI.record:SetText(format("%s %s", MX:FormatMoneyGoldOnly(DailyRecord), L["Chat_ChatGuildDailyRecordUI"]))
MainUI.loot:SetText(format("%s (Loot)", MX:FormatMoneyGoldOnly(Farmer_Money_LootSession)))
end
diff --git a/Frame/Load_Frames.xml b/Frame/Load_Frames.xml
index 9718396..9823c7b 100644
--- a/Frame/Load_Frames.xml
+++ b/Frame/Load_Frames.xml
@@ -1,3 +1,4 @@
+
diff --git a/Function/Alert.lua b/Function/Alert.lua
index a149483..32ab4ea 100644
--- a/Function/Alert.lua
+++ b/Function/Alert.lua
@@ -45,14 +45,14 @@ function CookAlert(frame, item, fvalue)
frame.Backdrop = CreateFrame("Frame", name.."Backdrop", f, "BackdropTemplate");
frame.Backdrop:SetAllPoints();
frame.Backdrop.backdropInfo = {
- bgFile = "Interface\Tooltips\UI-Tooltip-Background",
- edgeFile = "Interface\Tooltips\UI-Tooltip-Border",
- edgeSize = 2,
- insets = { left = 11, right = 12, top = 12, bottom = 9, },
+ bgFile = "Interface/Tooltips/UI-Tooltip-Background",
+ edgeFile = "Interface/Buttons/WHITE8x8",
+ tile = true, tileSize = 16, edgeSize = 1,
+ insets = { left = 2, right = 2, top = 2, bottom = 2 },
};
frame.Backdrop:SetBackdrop(frame.Backdrop.backdropInfo);
--frame:SetBackdrop(backdrop)
- frame.Backdrop:SetBackdropColor(51, 51, 51);
+ frame.Backdrop:SetBackdropColor(0.20,0.20,0.20,1);
frame.Backdrop:SetBackdropBorderColor(0, 0, 0);
--local iconBorder = frame.Icon.Overlay;
--iconBorder:SetTexture("Interface\\AchievementFrame\\UI-Achievement-IconFrame");
diff --git a/Function/Load_Functions.xml b/Function/Load_Functions.xml
index c03eb82..0debafe 100644
--- a/Function/Load_Functions.xml
+++ b/Function/Load_Functions.xml
@@ -1,5 +1,4 @@
-
diff --git a/Function/TSM.lua b/Function/TSM.lua
index 8367427..11fb4f6 100644
--- a/Function/TSM.lua
+++ b/Function/TSM.lua
@@ -19,3 +19,8 @@ function MX.TSM:GetItemValue(itemID, priceSource)
local itemLink = "i:" .. tostring(itemID);
return TSM_API.GetCustomPriceValue(priceSource, itemLink)
end
+
+function MX.TSM:GetItemQuantity(itemID)
+ local itemLink = "i:" .. tostring(itemID);
+ return TSM_API.GetPlayerTotals(itemLink)
+end
diff --git a/Locale/frFR.lua b/Locale/frFR.lua
index baae3b4..e443d86 100644
--- a/Locale/frFR.lua
+++ b/Locale/frFR.lua
@@ -51,3 +51,9 @@ L["Alert_Class_Consumable"] = "Consommable";
L["Alert_Class_TradeGoods"] = "Artisanat";
L["Alert_Class_Weapon"] = "Arme";
L["Alert_Class_Armor"] = "Armure";
+
+-- Alert Frame
+L["Alert_Frame_Title"] = "MxW (Alerte)";
+L["Alert_Frame_Thresold"] = "Seuil : ";
+L["Alert_Frame_Stack"] = "Pile : ";
+L["Alert_Frame_Quantity"] = "Inventaire : ";
diff --git a/Locale/usEN.lua b/Locale/usEN.lua
index dd665fa..dd44fb9 100644
--- a/Locale/usEN.lua
+++ b/Locale/usEN.lua
@@ -51,3 +51,9 @@ L["Alert_Class_Consumable"] = "Consumable";
L["Alert_Class_TradeGoods"] = "Trade Goods";
L["Alert_Class_Weapon"] = "Weapon";
L["Alert_Class_Armor"] = "Armor";
+
+-- Alert Frame
+L["Alert_Frame_Title"] = "MxW (Alert)";
+L["Alert_Frame_Thresold"] = "Thresold: ";
+L["Alert_Frame_Stack"] = "Stack: ";
+L["Alert_Frame_Quantity"] = "Inventory: ";
diff --git a/MxW.toc b/MxW.toc
index dab04aa..ae4a9ba 100644
--- a/MxW.toc
+++ b/MxW.toc
@@ -1,6 +1,6 @@
## Interface: 90001
## Title: |cff1784d1MxW|r
-## Version: 2.0.0
+## Version: 2.1.0
## Author: mikx
## Notes: MxW Addon
## RequiredDeps: TradeSkillMaster
diff --git a/init.lua b/init.lua
index e13e31c..954180e 100644
--- a/init.lua
+++ b/init.lua
@@ -165,6 +165,13 @@ local function MyAddonCommands(msg, editbox)
end
elseif (msg == 'config') then
MX:ShowSettingsUI();
+ elseif (msg == 'atest') then
+ local by = 300;
+ for i = 4,1,-1 do
+ MX:ShowAlert("\124cff1eff00\124Hitem:171830::::::::60:::::\124h[Oxxein Ore]\124h\124r",4,50000000,by);
+ by = by - 90;
+ end
+ local by = 300;
else
print(L["ChatCMD_Help"])
end