Skip to content

Commit

Permalink
Mentions: Make it available to try. Default off
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvanaar committed May 19, 2020
1 parent 9ca3916 commit 6d6b285
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
27 changes: 16 additions & 11 deletions modules/Mentions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ Prat:AddModuleToLoad(function()

Prat:SetModuleDefaults(module.name, {
profile = {
on = true,
on = false,
}
})

--@debug@
PL:AddLocale(PRAT_MODULE, "enUS", {
["module_name"] = "Mentions",
["module_desc"] = "Support mentioning other players in chat",
module_info = "THIS MODULE IS EXPERIMENTAL= It adds the ability to @mention people in chat to alert them>",
})
--@end-debug@

Expand Down Expand Up @@ -126,7 +127,12 @@ end
name = PL.module_name,
desc = PL.module_desc,
type = "group",
args = {}
args = {
info = {
name = PL.module_info,
type = "description",
}
}
})

local function handleMention(match, m)
Expand All @@ -138,7 +144,15 @@ end
return match;
end

Prat:SetModulePatterns(module, {
{ pattern = "@%S+", matchfunc = handleMention, priority = 47, type = "OUTBOUND" }
})

function module:OnModuleEnable()
end


function module:RegisterTabComplete()
local CLR = Prat.CLR
local AceTab = LibStub("AceTab-3.0")
local tabcompleteName = "mentions-tab-complete"
Expand Down Expand Up @@ -185,14 +199,5 @@ end
return name:gsub(Prat.MULTIBYTE_FIRST_CHAR, string.upper, 1):match("^[^%-]+")
end)
end
-- else
-- if AceTab:IsTabCompletionRegistered(tabcompleteName) then
-- AceTab:UnregisterTabCompletion(tabcompleteName)
-- end
-- end
end

Prat:SetModulePatterns(module, {
{ pattern = "@%S+", matchfunc = handleMention, priority = 47, type = "OUTBOUND" }
})
end)
2 changes: 1 addition & 1 deletion modules/includes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Script file="Invites.lua"/>
<Script file="Keybindings.lua"/>
<!--<Script file="OriginalEditbox.lua"/>-->
<!--<Script file="Mentions.lua" />-->
<Script file="Mentions.lua" />
<Script file="Paragraph.lua"/>
<Script file="PlayerNames.lua"/>
<Script file="PopupMessage.lua"/>
Expand Down

1 comment on commit 6d6b285

@sylvanaar
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it easy to try #14

Please sign in to comment.