changed slash command coloring and display order
This commit is contained in:
parent
df9f0e897a
commit
f81b074aac
2 changed files with 9 additions and 4 deletions
|
@ -61,14 +61,20 @@ function core:RegisterOptions(modOptions, modDefaults)
|
|||
end
|
||||
|
||||
function core:RegisterSlashCommand(callback, ...)
|
||||
local long = ""
|
||||
local keyword
|
||||
for i=1,select('#', ...) do
|
||||
local slash = select(i, ...)
|
||||
if slashCallback[slash] then
|
||||
error(("Slash command paramter already registered: '%s'"):format(slash))
|
||||
end
|
||||
slashCallback[slash] = self[callback]
|
||||
long = string.len(slash)>string.len(long) and slash or long
|
||||
|
||||
if not keyword or slash:len() < keyword:len() then
|
||||
keyword = slash
|
||||
end
|
||||
end
|
||||
|
||||
slashList[long] = ("|cff33ff99%s|r:%s()"):format(self:GetName(), callback)
|
||||
slashList[("|cff33ff99%s|r:|cffcc7833%s()|r"):format(self:GetName(), callback)] = keyword
|
||||
end
|
||||
|
||||
function core:MainSlashHandle(msg)
|
||||
|
|
|
@ -58,7 +58,6 @@ local armorGlyphs = {
|
|||
function mod:OnInitialize()
|
||||
db = core.db.profile[self:GetName()] or {}
|
||||
self:RegisterOptions(options, defaults)
|
||||
self:RegisterSlashCommand("method", "slsh1", "slash2")
|
||||
end
|
||||
|
||||
function mod:OnEnable()
|
||||
|
|
Loading…
Reference in a new issue