From 04345705c941a63f0b29f838eadfe2776aab82c0 Mon Sep 17 00:00:00 2001 From: mikx Date: Fri, 16 Nov 2018 23:41:09 -0500 Subject: [PATCH] 1.6.0 - 8.0.1 --- CHANGELOG | 53 +- Event/LOOT_OPENED.lua | 90 +- Event/PLAYER_MONEY.lua | 25 +- Frame/MainFrame.lua | 157 +++- Function/Alert.lua | 40 +- Function/Chat.lua | 88 ++ Function/DB.lua | 2 +- Function/Load_Functions.xml | 1 + Function/Math.lua | 2 +- Function/Money.lua | 28 +- Function/Option.lua | 2 +- Function/TSM.lua | 4 +- Libraries/AceGUI-3.0/AceGUI-3.0.lua | 813 ++++++++++++++++++ Libraries/AceGUI-3.0/AceGUI-3.0.xml | 28 + .../AceGUIContainer-BlizOptionsGroup.lua | 138 +++ .../widgets/AceGUIContainer-DropDownGroup.lua | 157 ++++ .../widgets/AceGUIContainer-Frame.lua | 316 +++++++ .../widgets/AceGUIContainer-InlineGroup.lua | 103 +++ .../widgets/AceGUIContainer-ScrollFrame.lua | 204 +++++ .../widgets/AceGUIContainer-SimpleGroup.lua | 69 ++ .../widgets/AceGUIContainer-TabGroup.lua | 350 ++++++++ .../widgets/AceGUIContainer-TreeGroup.lua | 710 +++++++++++++++ .../widgets/AceGUIContainer-Window.lua | 336 ++++++++ .../widgets/AceGUIWidget-Button.lua | 103 +++ .../widgets/AceGUIWidget-CheckBox.lua | 295 +++++++ .../widgets/AceGUIWidget-ColorPicker.lua | 188 ++++ .../widgets/AceGUIWidget-DropDown-Items.lua | 471 ++++++++++ .../widgets/AceGUIWidget-DropDown.lua | 737 ++++++++++++++++ .../widgets/AceGUIWidget-EditBox.lua | 265 ++++++ .../widgets/AceGUIWidget-Heading.lua | 78 ++ .../AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 140 +++ .../widgets/AceGUIWidget-InteractiveLabel.lua | 101 +++ .../widgets/AceGUIWidget-Keybinding.lua | 249 ++++++ .../AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 173 ++++ .../widgets/AceGUIWidget-MultiLineEditBox.lua | 366 ++++++++ .../widgets/AceGUIWidget-Slider.lua | 285 ++++++ Libraries/Load_Libraries.xml | 6 +- Locale/frFR.lua | 20 +- Locale/usEN.lua | 18 +- Media/Font/Homespun.ttf | Bin 0 -> 21196 bytes Media/Sound/register.mp3 | Bin 0 -> 15173 bytes {Texture => Media/Texture}/MainForm.tga | Bin MxW.toc | 7 +- init.lua | 111 ++- 44 files changed, 7222 insertions(+), 107 deletions(-) create mode 100644 Function/Chat.lua create mode 100644 Libraries/AceGUI-3.0/AceGUI-3.0.lua create mode 100644 Libraries/AceGUI-3.0/AceGUI-3.0.xml create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIContainer-Window.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-Button.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-Label.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua create mode 100644 Libraries/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua create mode 100644 Media/Font/Homespun.ttf create mode 100644 Media/Sound/register.mp3 rename {Texture => Media/Texture}/MainForm.tga (100%) diff --git a/CHANGELOG b/CHANGELOG index 2a0b72f..6cf1518 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,2 +1,51 @@ -[0.0.10][June 11, 2017] -- Experimental Release \ No newline at end of file +[1.5.0][February 18, 2018] +U Updated the locales of the main UI. +U Removed the message displaying the daily record when the player enter the world. +U Updated the day reset logic. +U Updated the reset logic. +A Added a day counter to the main UI. +A Added a logic reseting the addon for a new month on DayCounter 31. +A Added a command: "/mxw config" to show the settings. + +[1.4.0][February 17, 2018] +U Updated the daily value locales of the main UI. +U Updated the daily record guild message. +A Added a message displaying the daily record when the player enter the world. +A The daily record value is now displayed on the main UI. + +[1.3.3][February 12, 2018] +U Updated the dependencies for the TSM4 beta. + +[1.3.2][February 12, 2018] +F Fixed an init bug. Don't commit codes before testing... + +[1.3.1][February 12, 2018] +F Fixed a bug with the daily stage message system. +U Updated the daily stage message locales. + +[1.3.0][February 12, 2018] +U Chat system optimization. +U General code optimization. +A Added a daily stage message for the daily money counter. +A Added a daily record system for the daily money counter. + +[1.2.0][February 11, 2018] +A Added a guild message system sending the alert content to the guild channel. +A Added a command: "/mxw gmsg" to turn on/off the guild message. + +[1.1.1][February 11, 2018] +F Fixed the bug clearing the daily counter on each new client launch. + +[1.1.0][February 11, 2018] +U The daily counter is now reset during the addon init on a new day. +A Added a command: "/mxw reset" to reset the monthly counter. +A Added a command: "/mxw alert" to turn on/off the alert. + +[1.0.0][January 30, 2018] +! First stable release. (If you are still using 1.3.0b, update ASAP!) +F Fixed the alert being empty under certain circumstances. +F Fixed a bug where a previous alert was repeating if you looted a corpse with money only. +U The alert frame now use the item link instead of using the name. +U Improved the Alert frame appearance. +A Added a settings frame with the minimum alert threshold and a reset button. +A Added a command: "/mxw restore" to restore the backed up global variable after a reset. diff --git a/Event/LOOT_OPENED.lua b/Event/LOOT_OPENED.lua index 3c6f7d7..90bd638 100644 --- a/Event/LOOT_OPENED.lua +++ b/Event/LOOT_OPENED.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.ca/wow-addons/MxW_Addon +-- https://git.mikx.xyz/wow/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. @@ -8,6 +8,8 @@ local MX = LibStub("AceAddon-3.0"):GetAddon("MxW"); local L = LibStub("AceLocale-3.0"):GetLocale("MxW"); local numItems +local iLink +local value local LOOT_OPENED_Frame = CreateFrame("Frame") LOOT_OPENED_Frame:RegisterEvent("LOOT_OPENED") @@ -22,50 +24,58 @@ LOOT_OPENED_Frame:SetScript("OnEvent", for i = 1, numItems do -- get loot slot link to get iteminfo, we can't use item name due to API limitation iLink = GetLootSlotLink(i) - -- get the iteminfo only if the itemlink is not empty (EXEMPLE: money in a slot = empty) + -- 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) - end - -- get the item value using the link, return nil if the item has no value - value = MX.TSM:GetItemValue(link, "DBMarket"); + -- get the item value using the link, return nil if the item has no value + value = MX.TSM:GetItemValue(link, "DBMarket"); - -- 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) then - if(class == L["Alert_Class_Armor"]) then - if (value >= Farmer_Logic_MinAlert and quality >= eq) then - MX:SendAlert(link,value); + -- 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 - elseif(class == L["Alert_Class_Weapon"]) then - if (value >= Farmer_Logic_MinAlert and quality >= eq) then - MX:SendAlert(link,value); - end - elseif(class == L["Alert_Class_TradeGoods"]) then - if (value >= Farmer_Logic_MinAlert and quality >= mq) then - MX:SendAlert(link,value); - end - elseif(class == L["Alert_Class_Consumable"]) then - if (value >= Farmer_Logic_MinAlert and quality >= cq) then - MX:SendAlert(link,value); - end - elseif(class == L["Alert_Class_Misc"]) then - if (value >= Farmer_Logic_MinAlert and quality >= oq) then - MX:SendAlert(link,value); - end - elseif(class == "Recipe") then - if (value >= Farmer_Logic_MinAlert and quality >= rq) then - MX:SendAlert(link,value); - end - end - end + value = nil + iLink = nil + end + end end end diff --git a/Event/PLAYER_MONEY.lua b/Event/PLAYER_MONEY.lua index 78c0558..ff74be5 100644 --- a/Event/PLAYER_MONEY.lua +++ b/Event/PLAYER_MONEY.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.ca/wow-addons/MxW_Addon +-- https://git.mikx.xyz/wow/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. @@ -17,19 +17,28 @@ PLAYER_MONEY_Frame:SetScript("OnEvent", function(self, event, ...) if (DiffGold > 0) then -- Gold gain - local weekday, month, day, year = CalendarGetDate(); - -- Reset Global Daily Counter - if (Farmer_Logic_Day ~= day) then - Farmer_Money_DayGlobal = 0; - MX:UpdateMainUI() - Farmer_Logic_Day = day; - end + local date = C_Calendar.GetDate() + local weekday = date.weekday + local month = date.month + local day = date.monthDay + local year = date.year -- Write to SavedVariables Farmer_Money_MonthGlobal = Farmer_Money_MonthGlobal + DiffGold; Farmer_Money_DayGlobal = Farmer_Money_DayGlobal + DiffGold; + if(Farmer_Money_DayGlobal >= DailyRecord and DailyRecordFlag == false) then + MX:ChatGuildDailyRecord(DailyRecord) + DailyRecord = Farmer_Money_DayGlobal; + DailyRecordFlag = true; + end + + if(DailyRecordFlag) then + DailyRecord = Farmer_Money_DayGlobal; + end + MX:UpdateMainUI() + MX:ChatGuildDailyMoneyThresholdMessage(Farmer_Money_DayGlobal) elseif (DiffGold <= 0) then -- Gold lost diff --git a/Frame/MainFrame.lua b/Frame/MainFrame.lua index b690a2f..2a003cc 100644 --- a/Frame/MainFrame.lua +++ b/Frame/MainFrame.lua @@ -1,6 +1,6 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.ca/wow-addons/MxW_Addon +-- https://git.mikx.xyz/wow/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. @@ -21,43 +21,114 @@ local backdrop = { local labTodayGold = AceGUI:Create("Label") local labMonthGold = AceGUI:Create("Label") +local labDailyRecord = 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(100) + MAIN_UI:SetHeight(80) MAIN_UI:SetTitle("MxW " .. self.db.profile.version) MAIN_UI:SetStatusTable(self.db.profile.mainUI) MAIN_UI:SetLayout("List") - MAIN_UI:SetWidth(300) + MAIN_UI:SetWidth(200) MAIN_UI:EnableResize(false) - labTodayGold:SetFont("Fonts\\FRIZQT__.TTF", 10) + labDayCounter:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10) + labDayCounter:SetColor(1, 1, 1) + labDayCounter:SetFullWidth(true) + MAIN_UI:AddChild(labDayCounter) + + local labSpaceA = AceGUI:Create("Label") + labSpaceA:SetFont("Fonts\\FRIZQT__.TTF", 10) + labSpaceA:SetColor(1, 1, 1) + labSpaceA:SetFullWidth(true) + labSpaceA:SetText(" ") + MAIN_UI:AddChild(labSpaceA) + + labTodayGold:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10) labTodayGold:SetColor(1, 1, 1) labTodayGold:SetFullWidth(true) MAIN_UI:AddChild(labTodayGold) - labMonthGold:SetFont("Fonts\\FRIZQT__.TTF", 10) + labMonthGold:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10) labMonthGold:SetColor(1, 1, 1) labMonthGold:SetFullWidth(true) MAIN_UI:AddChild(labMonthGold) - local labSpace = AceGUI:Create("Label") - labSpace:SetFont("Fonts\\FRIZQT__.TTF", 10) - labSpace:SetColor(1, 1, 1) - labSpace:SetFullWidth(true) - labSpace:SetText(" ") - MAIN_UI:AddChild(labSpace) + 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_LOOTLIST = AceGUI:Create("Button") - BUTTON_LOOTLIST:SetAutoWidth(true) - BUTTON_LOOTLIST:SetText(L["MainForm_Button_LootList"]) - BUTTON_LOOTLIST:SetPoint("RIGHT", 5, 15) - BUTTON_LOOTLIST:SetCallback("OnClick", + labDailyRecord:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10) + labDailyRecord:SetColor(1, 1, 1) + labDailyRecord:SetFullWidth(true) + MAIN_UI:AddChild(labDailyRecord) + + 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:SetCallback("OnClick", function() - MX:ShowListUI() + MX:ShowSettingsUI() end ) - MAIN_UI:AddChild(BUTTON_LOOTLIST) + --MAIN_UI:AddChild(BUTTON_SETTINGS) +end + +function MX:ShowSettingsUI() + local SETTINGS_UI = AceGUI:Create("Window") + SETTINGS_UI:SetHeight(150) + SETTINGS_UI:SetTitle(L["MainForm_Button_Settings"]) + SETTINGS_UI:SetStatusTable(self.db.profile.settingsUI) + SETTINGS_UI:SetLayout("List") + SETTINGS_UI:SetWidth(300) + + EditBoxMinAlert:SetLabel(L["SettingsUI_EditBox_MinAlert"]) + local money = floor(Farmer_Logic_MinAlert / (COPPER_PER_SILVER * SILVER_PER_GOLD)) + EditBoxMinAlert:SetText(money) + EditBoxMinAlert:SetCallback("OnEnterPressed", + function() + local value = EditBoxMinAlert:GetText() + local fv = floor(value * (COPPER_PER_SILVER * SILVER_PER_GOLD)) + Farmer_Logic_MinAlert = fv + ReloadUI(); + end + ) + SETTINGS_UI:AddChild(EditBoxMinAlert) + + local labSpace = AceGUI:Create("Label") + labSpace:SetFont("Fonts\\FRIZQT__.TTF", 10) + labSpace:SetColor(1, 1, 1) + labSpace:SetFullWidth(true) + labSpace:SetText(" ") + SETTINGS_UI:AddChild(labSpace) + + local BUTTON_RESET = AceGUI:Create("Button") + BUTTON_RESET:SetAutoWidth(true) + BUTTON_RESET:SetText(L["SettingsUI_Button_Reset"]) + BUTTON_RESET:SetPoint("RIGHT", 5, 15) + BUTTON_RESET:SetCallback("OnClick", + function() + if (Farmer_Logic_Day ~= day) then + Farmer_Money_DayGlobal = 0; + Farmer_Money_MonthBack = Farmer_Money_MonthGlobal; + Farmer_Money_MonthGlobal = 0; + ReloadUI(); + else + Farmer_Money_MonthBack = Farmer_Money_MonthGlobal; + Farmer_Money_MonthGlobal = Farmer_Money_DayGlobal; + Farmer_Money_DayGlobal = 0; + ReloadUI(); + end + end + ) + SETTINGS_UI:AddChild(BUTTON_RESET) end function MX:ShowListUI() @@ -91,14 +162,64 @@ end) local MainFrame_Event_PLAYER_ENTERING_WORLD = CreateFrame("Frame") MainFrame_Event_PLAYER_ENTERING_WORLD :RegisterEvent("PLAYER_ENTERING_WORLD") MainFrame_Event_PLAYER_ENTERING_WORLD :SetScript("OnEvent", function(self, event, ...) + local date = C_Calendar.GetDate() + local weekday = date.weekday + local month = date.month + local day = date.monthDay + local year = date.year -- Init gold variable CurrentGold = GetMoney() + -- Reset Global Daily Counter + if(DailyRecord == nil) then + DailyRecord = Farmer_Money_DayGlobal; + DailyRecordFlag = false; + end + if (Farmer_Logic_Day ~= day) then + if(DailyRecordFlag) then + DailyRecordFlag = false; + end + Farmer_Money_DayGlobal = 0; + Farmer_Logic_Day = day; + DailyTen = false; + DailyTwenty = false; + DailyThirty = false; + DailyForty = false; + DailyFifty = false; + DailySixty = false; + DailySeventy = false; + DailyEighty = false; + DailyNinety = false; + DailyHundred = false; + DayCounter = DayCounter + 1; + end + if (DayCounter >= 31) then + Farmer_Money_MonthBack = Farmer_Money_MonthGlobal; + Farmer_Money_MonthGlobal = 0; + Farmer_Money_DayGlobal = 0; + DayCounter = 1; + DailyRecord = 1; + DailyRecordFlag = false; + DailyTen = false; + DailyTwenty = false; + DailyThirty = false; + DailyForty = false; + DailyFifty = false; + DailySixty = false; + DailySeventy = false; + DailyEighty = false; + DailyNinety = false; + DailyHundred = false; + end MX:UpdateMainUI() end) function MX:UpdateMainUI() + local DayColor = "|cff1ead01"; + local GoldMedian = floor(Farmer_Money_MonthGlobal / DayCounter); 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"])) + labDayCounter:SetText(format("%s %s%i/30|r (~%s/%s)", L["MainForm_Label_DayCounter"], DayColor, DayCounter, MX:FormatMoneyGoldOnly(GoldMedian),L["MainForm_Label_Money_Lab_Today"])) end function MX:ShowMain() diff --git a/Function/Alert.lua b/Function/Alert.lua index 550c1d5..876aa58 100644 --- a/Function/Alert.lua +++ b/Function/Alert.lua @@ -1,12 +1,19 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.ca/wow-addons/MxW_Addon +-- https://git.mikx.xyz/wow/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 backdrop = { + bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], + edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], + edgeSize = 2, + insets = { left = 1, right = 1, top = 1, bottom = 1 } + } + -- Alert Cooking -- Based on [[ AchievementAlertFrame ]] from Blizzard function CookAlert(frame, item, fvalue) @@ -20,7 +27,7 @@ function CookAlert(frame, item, fvalue) local unlocked = frame.Unlocked; local oldCheevo = frame.OldAchievement; - displayName:SetText(itemName); + displayName:SetText(itemLink); AchievementShield_SetPoints(0, shieldPoints, GameFontNormal, GameFontNormalSmall); @@ -31,28 +38,31 @@ function CookAlert(frame, item, fvalue) frame.guildDisplay = nil; frame:SetHeight(88); local background = frame.Background; - background:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Background"); + background:SetTexture([[Interface\Tooltips\UI-Tooltip-Background]]); background:SetTexCoord(0, 0.605, 0, 0.703); background:SetPoint("TOPLEFT", 0, 0); background:SetPoint("BOTTOMRIGHT", 0, 0); - local iconBorder = frame.Icon.Overlay; - iconBorder:SetTexture("Interface\\AchievementFrame\\UI-Achievement-IconFrame"); - iconBorder:SetTexCoord(0, 0.5625, 0, 0.5625); - iconBorder:SetPoint("CENTER", -1, 2); + frame:SetBackdrop(backdrop) + frame:SetBackdropColor(0, 0, 0) + frame:SetBackdropBorderColor(0.4, 0.4, 0.4) + --local iconBorder = frame.Icon.Overlay; + --iconBorder:SetTexture("Interface\\AchievementFrame\\UI-Achievement-IconFrame"); + --iconBorder:SetTexCoord(0, 0.5625, 0, 0.5625); + --iconBorder:SetPoint("CENTER", -1, 2); frame.Icon:SetPoint("TOPLEFT", -26, 16); displayName:SetPoint("BOTTOMLEFT", 72, 36); displayName:SetPoint("BOTTOMRIGHT", -60, 36); unlocked:SetPoint("TOP", 7, -23); - unlocked:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE") + unlocked:SetFont("Interface\\Addons\\MxW\\Media\\Font\\Homespun.ttf", 10, "OUTLINEMONOCHROME") unlocked:SetText(fvalue); frame.GuildName:Hide(); frame.GuildBorder:Hide(); frame.GuildBanner:Hide(); - frame.glow:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Glow"); - frame.glow:SetTexCoord(0, 0.78125, 0, 0.66796875); - frame.shine:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Glow"); - frame.shine:SetTexCoord(0.78125, 0.912109375, 0, 0.28125); - frame.shine:SetPoint("BOTTOMLEFT", 0, 8); + --frame.glow:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Glow"); + --frame.glow:SetTexCoord(0, 0.78125, 0, 0.66796875); + --frame.shine:SetTexture("Interface\\AchievementFrame\\UI-Achievement-Alert-Glow"); + --frame.shine:SetTexCoord(0.78125, 0.912109375, 0, 0.28125); + --frame.shine:SetPoint("BOTTOMLEFT", 0, 8); shieldIcon:SetTexture([[Interface\AchievementFrame\UI-Achievement-Shields-NoPoints]]); @@ -73,8 +83,8 @@ function MX:SendAlert(iLink,value) fvalue = MX:FormatMoney(value); - FarmerAlert:AddAlert(itemName,fvalue); - PlaySoundFile("Sound\\Spells\\AchievmentSound1.ogg") + FarmerAlert:AddAlert(itemLink,fvalue); + PlaySoundFile("Interface\\Addons\\MxW\\Media\\Sound\\register.mp3", "Master") end local COLOR_GREY = "|cff888888" diff --git a/Function/Chat.lua b/Function/Chat.lua new file mode 100644 index 0000000..642016f --- /dev/null +++ b/Function/Chat.lua @@ -0,0 +1,88 @@ +-- MxW (MxW Addon) +-- By mikx +-- https://git.mikx.xyz/wow/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"); + +----------------- +-- Guild channel +----------------- + +---- Loot Alert Guild Message +function MX:ChatGuildLootMessage(link,value) + if (Settings_GuildMessage_Enabled) then + local msg = format("[MxW] %s [%s]",link,MX:FormatMoneyNoColor(value)); + SendChatMessage(msg, "GUILD", nil); + end +end + +---- Daily Record Guild Message +function MX:ChatGuildDailyRecord(oldvalue) + if (Settings_GuildMessage_Enabled) then + local pname = UnitName("player") + local ogv = floor(oldvalue / (COPPER_PER_SILVER * SILVER_PER_GOLD)) + local msg = format("[MxW] %s %s %ig!",pname,L["Chat_ChatGuildDailyRecordA"],ogv); + SendChatMessage(msg, "GUILD", nil); + end +end + +---- Daily Money Threshold Guild Message +function MX:ChatGuildDailyMoneyThresholdMessage(value) + if (Settings_GuildMessage_Enabled) then + + local gv = floor(value / (COPPER_PER_SILVER * SILVER_PER_GOLD)) + local post = false + local msg + local pname = UnitName("player") + if(gv >= 10000 and DailyTen == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],10000); + DailyTen = true; + post = true; + elseif(gv >= 20000 and DailyTwenty == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],20000); + DailyTwenty = true; + post = true; + elseif(gv >= 30000 and DailyThirty == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],30000); + DailyThirty = true; + post = true; + elseif(gv >= 40000 and DailyForty == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],40000); + DailyForty = true; + post = true; + elseif(gv >= 50000 and DailyFifty == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],50000); + DailyFifty = true; + post = true; + elseif(gv >= 60000 and DailySixty == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],60000); + DailySixty = true; + post = true; + elseif(gv >= 70000 and DailySeventy == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],70000); + DailySeventy = true; + post = true; + elseif(gv >= 80000 and DailyEighty == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],80000); + DailyEighty = true; + post = true; + elseif(gv >= 90000 and DailyNinety == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],90000); + DailyNinety = true; + post = true; + elseif(gv >= 100000 and DailyHundred == false) then + msg = format("[MxW] %s %s %ig!",pname,L["Chat_GuildDailyMoneyThresholdMessage"],100000); + DailyHundred = true; + post = true; + end + + if(post) then + SendChatMessage(msg, "GUILD", nil); + post = false; + end + + end +end diff --git a/Function/DB.lua b/Function/DB.lua index f4788a3..c458744 100644 --- a/Function/DB.lua +++ b/Function/DB.lua @@ -1,5 +1,5 @@ -- MxW (MxW Addon) -- By mikx --- https://git.mikx.ca/wow-addons/MxW_Addon +-- https://git.mikx.xyz/wow/MxW_Addon -- Licensed under the GNU General Public License 3.0 -- See included License file for more informations. diff --git a/Function/Load_Functions.xml b/Function/Load_Functions.xml index a1cafe8..40af5c2 100644 --- a/Function/Load_Functions.xml +++ b/Function/Load_Functions.xml @@ -1,6 +1,7 @@