From dbb50ecc964ee8986195d94d8383bbcf9fafa12c Mon Sep 17 00:00:00 2001 From: mikx Date: Fri, 13 Nov 2020 14:41:52 -0500 Subject: [PATCH] 1.9.0_9.0.1 --- Event/LOOT_OPENED.lua | 15 +- Event/PLAYER_MONEY.lua | 4 +- Frame/MainFrame.lua | 34 +- Function/Alert.lua | 17 +- Function/Chat.lua | 2 +- Function/DB.lua | 2 +- Function/Item.lua | 18 + Function/Load_Functions.xml | 1 + Function/Math.lua | 2 +- Function/Money.lua | 2 +- Function/Option.lua | 2 +- Function/TSM.lua | 5 +- Libraries/DropDownMenu/DropDownMenu.xml | 8 - Libraries/DropDownMenu/EasyMenu.lua | 34 - Libraries/DropDownMenu/UIDropDownMenu.lua | 1232 ----------------- .../DropDownMenu/UIDropDownMenuTemplates.xml | 413 ------ Libraries/DropDownMenu/readme.txt | 71 - Libraries/Load_Libraries.xml | 1 - Locale/frFR.lua | 2 +- Locale/usEN.lua | 2 +- Media/Font/Consola.ttf | Bin 0 -> 459180 bytes Media/Font/Verdana.ttf | Bin 0 -> 243304 bytes MxW.toc | 8 +- init.lua | 12 +- 24 files changed, 93 insertions(+), 1794 deletions(-) create mode 100644 Function/Item.lua delete mode 100644 Libraries/DropDownMenu/DropDownMenu.xml delete mode 100644 Libraries/DropDownMenu/EasyMenu.lua delete mode 100644 Libraries/DropDownMenu/UIDropDownMenu.lua delete mode 100644 Libraries/DropDownMenu/UIDropDownMenuTemplates.xml delete mode 100644 Libraries/DropDownMenu/readme.txt create mode 100644 Media/Font/Consola.ttf create mode 100644 Media/Font/Verdana.ttf diff --git a/Event/LOOT_OPENED.lua b/Event/LOOT_OPENED.lua index 90bd638..95740a0 100644 --- a/Event/LOOT_OPENED.lua +++ b/Event/LOOT_OPENED.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.xyz/wow/MxW_Addon +-- https://git.mikx.xyz/mikx/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. @@ -29,7 +29,10 @@ LOOT_OPENED_Frame:SetScript("OnEvent", -- get the iteminfo using the slot itemlink name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(iLink) -- get the item value using the link, return nil if the item has no value - value = MX.TSM:GetItemValue(link, "DBMarket"); + local itemId = MX:ToItemID(link); + if (itemId ~= nil) then + value = MX.TSM:GetItemValue(itemId, "DBMarket"); + end -- MINIMUM QUALITY SETTINGS ------ local eq = 2 -- equipable quality @@ -72,8 +75,12 @@ LOOT_OPENED_Frame:SetScript("OnEvent", MX:ChatGuildLootMessage(link,value); end end - value = nil - iLink = nil + end + if (value ~= nil) then + Farmer_Money_LootSession = Farmer_Money_LootSession + value; + MX:UpdateMainUI() + value = nil + iLink = nil end end end diff --git a/Event/PLAYER_MONEY.lua b/Event/PLAYER_MONEY.lua index 95998cd..1732d3c 100644 --- a/Event/PLAYER_MONEY.lua +++ b/Event/PLAYER_MONEY.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.xyz/wow/MxW_Addon +-- https://git.mikx.xyz/mikx/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. @@ -17,7 +17,7 @@ PLAYER_MONEY_Frame:SetScript("OnEvent", function(self, event, ...) if (DiffGold > 0) then -- Gold gain - local date = C_Calendar.GetDate(); + local date = C_DateAndTime.GetCurrentCalendarTime(); local weekday, month, day, year = date.weekday, date.month, date.monthDay, date.year; -- Write to SavedVariables diff --git a/Frame/MainFrame.lua b/Frame/MainFrame.lua index 6bb7976..b225ae8 100644 --- a/Frame/MainFrame.lua +++ b/Frame/MainFrame.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.xyz/wow/MxW_Addon +-- https://git.mikx.xyz/mikx/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. @@ -12,7 +12,7 @@ local GUI_LOOTCOLLECTED, GUI_SCROLLCONTAINER local lootCollectedLastEntry = nil local mxwVersion = GetAddOnMetadata("MxW", "Version") -local date = C_Calendar.GetDate(); +local date = C_DateAndTime.GetCurrentCalendarTime(); local weekday, month, day, year = date.weekday, date.month, date.monthDay, date.year; local backdrop = { @@ -25,27 +25,30 @@ local backdrop = { local labTodayGold = AceGUI:Create("Label") local labMonthGold = AceGUI:Create("Label") local labDailyRecord = AceGUI:Create("Label") +local labLootSession = AceGUI:Create("Label") local labDayCounter = AceGUI:Create("Label") local EditBoxMinAlert = AceGUI:Create("EditBox") function MX:ShowMainUI() local MAIN_UI = AceGUI:Create("Window") - MAIN_UI:SetHeight(30) + MAIN_UI:SetHeight(100) MAIN_UI:SetTitle("MxW " .. self.db.profile.version) MAIN_UI:SetStatusTable(self.db.profile.mainUI) MAIN_UI:SetLayout("List") MAIN_UI:SetWidth(200) MAIN_UI:EnableResize(false) - labTodayGold:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10) + labTodayGold:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 12) labTodayGold:SetColor(1, 1, 1) labTodayGold:SetFullWidth(true) + labTodayGold:SetPoint("LEFT", 30, 15) MAIN_UI:AddChild(labTodayGold) - labMonthGold:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10) + labMonthGold:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 12) labMonthGold:SetColor(1, 1, 1) labMonthGold:SetFullWidth(true) + labMonthGold:SetPoint("LEFT", 30, 15) MAIN_UI:AddChild(labMonthGold) local labSpaceB = AceGUI:Create("Label") @@ -55,15 +58,27 @@ function MX:ShowMainUI() labSpaceB:SetText(" ") MAIN_UI:AddChild(labSpaceB) - labDailyRecord:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10) + labDailyRecord:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 12) labDailyRecord:SetColor(1, 1, 1) labDailyRecord:SetFullWidth(true) MAIN_UI:AddChild(labDailyRecord) - local BUTTON_SETTINGS = AceGUI:Create("Button") + labLootSession:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Consola.ttf", 12) + labLootSession:SetColor(1, 1, 1) + labLootSession:SetFullWidth(true) + MAIN_UI:AddChild(labLootSession) + + local labSpaceB = AceGUI:Create("Label") + labSpaceB:SetFont("Fonts\\FRIZQT__.TTF", 10) + labSpaceB:SetColor(1, 1, 1) + labSpaceB:SetFullWidth(true) + labSpaceB:SetText(" ") + MAIN_UI:AddChild(labSpaceB) + + local BUTTON_SETTINGS = AceGUI:Create("Button") BUTTON_SETTINGS:SetAutoWidth(true) - BUTTON_SETTINGS:SetText(L["MainForm_Button_Settings"]) - BUTTON_SETTINGS:SetPoint("RIGHT", 5, 15) + BUTTON_SETTINGS:SetText("C") + BUTTON_SETTINGS:SetPoint("LEFT", 5, 15) BUTTON_SETTINGS:SetCallback("OnClick", function() MX:ShowSettingsUI() @@ -192,6 +207,7 @@ function MX:UpdateMainUI() labTodayGold:SetText(format("%s (%s)", MX:FormatMoney(Farmer_Money_DayGlobal),L["MainForm_Label_Money_Lab_Today"])) labMonthGold:SetText(format("%s (%s)", MX:FormatMoney(Farmer_Money_MonthGlobal),L["MainForm_Label_Money_Lab_Month"])) labDailyRecord:SetText(format("%s %s", MX:FormatMoneyGoldOnly(DailyRecord), L["Chat_ChatGuildDailyRecordUI"])) + labLootSession:SetText(format("%s (Loot)", MX:FormatMoneyGoldOnly(Farmer_Money_LootSession))) end function MX:ShowMain() diff --git a/Function/Alert.lua b/Function/Alert.lua index 876aa58..a149483 100644 --- a/Function/Alert.lua +++ b/Function/Alert.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.xyz/wow/MxW_Addon +-- https://git.mikx.xyz/mikx/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. @@ -42,9 +42,18 @@ function CookAlert(frame, item, fvalue) background:SetTexCoord(0, 0.605, 0, 0.703); background:SetPoint("TOPLEFT", 0, 0); background:SetPoint("BOTTOMRIGHT", 0, 0); - frame:SetBackdrop(backdrop) - frame:SetBackdropColor(0, 0, 0) - frame:SetBackdropBorderColor(0.4, 0.4, 0.4) + 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, }, + }; + frame.Backdrop:SetBackdrop(frame.Backdrop.backdropInfo); + --frame:SetBackdrop(backdrop) + frame.Backdrop:SetBackdropColor(51, 51, 51); + frame.Backdrop:SetBackdropBorderColor(0, 0, 0); --local iconBorder = frame.Icon.Overlay; --iconBorder:SetTexture("Interface\\AchievementFrame\\UI-Achievement-IconFrame"); --iconBorder:SetTexCoord(0, 0.5625, 0, 0.5625); diff --git a/Function/Chat.lua b/Function/Chat.lua index 642016f..28e3e4d 100644 --- a/Function/Chat.lua +++ b/Function/Chat.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.xyz/wow/MxW_Addon +-- https://git.mikx.xyz/mikx/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. diff --git a/Function/DB.lua b/Function/DB.lua index c458744..198409f 100644 --- a/Function/DB.lua +++ b/Function/DB.lua @@ -1,5 +1,5 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.xyz/wow/MxW_Addon +-- https://git.mikx.xyz/mikx/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. diff --git a/Function/Item.lua b/Function/Item.lua new file mode 100644 index 0000000..de147a2 --- /dev/null +++ b/Function/Item.lua @@ -0,0 +1,18 @@ +-- 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"); + +function MX:ToItemID(itemString) + if not itemString then + return + end + + local _, _, Color, Ltype, Id, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, reforging, Name = string.find(itemString, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?") + + return tonumber(Id) +end diff --git a/Function/Load_Functions.xml b/Function/Load_Functions.xml index 40af5c2..c03eb82 100644 --- a/Function/Load_Functions.xml +++ b/Function/Load_Functions.xml @@ -2,6 +2,7 @@