Bugfixes + Added new sounds WHYYYYYYY
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,60 +1,4 @@
|
||||
|
||||
-- SYSMSG
|
||||
local function GetGuildRankForPlayer(name)
|
||||
if not IsInGuild() then return nil end
|
||||
|
||||
GuildRoster() -- Update guild data
|
||||
local numMembers = GetNumGuildMembers(true)
|
||||
|
||||
for i = 1, numMembers do
|
||||
local memberName, rank = GetGuildRosterInfo(i)
|
||||
local shortName = memberName
|
||||
local dashPos = string.find(memberName or "", "-")
|
||||
if dashPos then
|
||||
shortName = string.sub(memberName, 1, dashPos - 1)
|
||||
end
|
||||
|
||||
if shortName == name then
|
||||
return rank
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
local frame = CreateFrame("Frame", "FakeSysFrame")
|
||||
frame:RegisterEvent("CHAT_MSG_ADDON")
|
||||
|
||||
|
||||
frame:SetScript("OnEvent", function()
|
||||
if event == "CHAT_MSG_ADDON" then
|
||||
if arg1 == "FakeSys" then
|
||||
-- Display the fake system message
|
||||
DEFAULT_CHAT_FRAME:AddMessage(arg2, 1.0, 1.0, 0.0)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Slash command handler
|
||||
local function FakeSysHandler(msg)
|
||||
-- Check if player is an officer
|
||||
local playerName = UnitName("player")
|
||||
local rank = GetGuildRankForPlayer(playerName)
|
||||
|
||||
if not rank or (rank ~= "Officer") then
|
||||
return
|
||||
end
|
||||
|
||||
if msg and msg ~= "" then
|
||||
SendAddonMessage("FakeSys", msg, "GUILD")
|
||||
end
|
||||
end
|
||||
|
||||
-- Register the slash command
|
||||
SLASH_FAKESYS1 = "/fakesys"
|
||||
SlashCmdList["FAKESYS"] = FakeSysHandler
|
||||
|
||||
|
||||
-- PARSE ID
|
||||
SLASH_PARSEID1 = "/parseid"
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
## X-Website: https://github.com/cinecom/shootyepgp/
|
||||
## X-Category: Guild
|
||||
## X-Credits: shooty, Qcat(zhCN)
|
||||
## Version: 10.11 <ERROR>
|
||||
## Version: 10.12 <ERROR>
|
||||
## X-Alpha:
|
||||
## OptionalDeps: Ace2
|
||||
## SavedVariables: sepgp_saychannel, sepgp_groupbyclass, sepgp_groupbyarmor, sepgp_groupbyrole, sepgp_raidonly, sepgp_dbver, sepgp_debug, sepgp_fubar, sepgp_sound
|
||||
|
||||
Reference in New Issue
Block a user