1.6.0 - 8.0.1
This commit is contained in:
@@ -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"
|
||||
|
||||
88
Function/Chat.lua
Normal file
88
Function/Chat.lua
Normal file
@@ -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
|
||||
@@ -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.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/">
|
||||
<Script file="Alert.lua"/>
|
||||
<Script file="DB.lua"/>
|
||||
<Script file="Chat.lua"/>
|
||||
<Script file="Math.lua"/>
|
||||
<Script file="Money.lua"/>
|
||||
<Script file="TSM.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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -26,6 +26,20 @@ function MX:FormatMoney(money)
|
||||
end
|
||||
end
|
||||
|
||||
function MX:FormatMoneyGoldOnly(money)
|
||||
local ret = ""
|
||||
local gold = floor(money / (COPPER_PER_SILVER * SILVER_PER_GOLD));
|
||||
local silver = floor((money - (gold * COPPER_PER_SILVER * SILVER_PER_GOLD)) / COPPER_PER_SILVER);
|
||||
local copper = mod(money, COPPER_PER_SILVER);
|
||||
|
||||
if (gold == 0) then
|
||||
return "0g"
|
||||
end
|
||||
if (gold > 0) then
|
||||
return format("%s%02dg|r", COLOR_GOLD, gold)
|
||||
end
|
||||
end
|
||||
|
||||
function MX:FormatMoneyShort(money)
|
||||
local ret = ""
|
||||
local gold = floor(money / (COPPER_PER_SILVER * SILVER_PER_GOLD));
|
||||
@@ -39,3 +53,15 @@ function MX:FormatMoneyShort(money)
|
||||
return format("%s%sg%s", COLOR_GOLD, gold, COLOR_WHITE)
|
||||
end
|
||||
end
|
||||
|
||||
function MX:FormatMoneyNoColor(money)
|
||||
local gold = floor(money / (COPPER_PER_SILVER * SILVER_PER_GOLD));
|
||||
local silver = floor((money - (gold * COPPER_PER_SILVER * SILVER_PER_GOLD)) / COPPER_PER_SILVER);
|
||||
local copper = mod(money, COPPER_PER_SILVER);
|
||||
if (gold == 0) then
|
||||
return format("%ss %sc", silver, copper)
|
||||
end
|
||||
if (gold > 0) then
|
||||
return format("%sg %ss %sc", gold, silver, copper)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -16,5 +16,5 @@ MX.TSM = MX.TSM or {}
|
||||
-- GetItemValue(itemID, priceSource)
|
||||
-- Return itemID value as a int using priceSource
|
||||
function MX.TSM:GetItemValue(itemID, priceSource)
|
||||
return TSMAPI:GetItemValue(itemID, priceSource)
|
||||
return TSMAPI_FOUR.CustomPrice.GetValue(priceSource, itemID)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user