Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Newcomer Chat to channelnames #92

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions BasicConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BCM.modules[#BCM.modules+1] = function()
BCM_PlayerSeparator:SetText(bcmDB.playerSeparator)
elseif panel == "BCM_ChannelNames" and BCM_ChanName_Input then
BCM_ChanName_Input:SetText("1234567890")
BCM_ChanName_Input:SetText(bcmDB.shortNames[1])
BCM_ChanName_Input:SetText(bcmDB.replacementNames[1])
elseif panel == "BCM_PlayerNames" and BCM_PlayerLevel_Button then
BCM_PlayerBrackDesc:SetParent(frame)
BCM_PlayerBrackDesc:SetPoint("TOPLEFT", 16, -240)
Expand Down Expand Up @@ -316,10 +316,10 @@ BCM.modules[#BCM.modules+1] = function()
local input = BCM_ChanName_Input
input:EnableMouse(true)
input:SetText("1234567890") --for some reason the text wont display without calling something long
input:SetText(bcmDB.shortNames[v.value])
input:SetText(bcmDB.replacementNames[v.value])
input.value = v.value
end
local tbl = {BCM.GENERAL, BCM.TRADE_SERVICES, BCM.TRADE, BCM.WORLDDEFENSE, BCM.LOCALDEFENSE, BCM.LFG, BCM.GUILDRECRUIT, INSTANCE_CHAT, INSTANCE_CHAT_LEADER, GUILD, PARTY, PARTY_LEADER, gsub(CHAT_PARTY_GUIDE_GET, ".*%[(.*)%].*", "%1"), OFFICER, RAID, RAID_LEADER, RAID_WARNING, BCM.CUSTOMCHANNEL}
local tbl = {BCM.GENERAL, BCM.TRADE_SERVICES, BCM.TRADE, BCM.WORLDDEFENSE, BCM.LOCALDEFENSE, BCM.LFG, BCM.NEWCOMER_CHAT, BCM.GUILDRECRUIT, INSTANCE_CHAT, INSTANCE_CHAT_LEADER, GUILD, PARTY, PARTY_LEADER, gsub(CHAT_PARTY_GUIDE_GET, ".*%[(.*)%].*", "%1"), OFFICER, RAID, RAID_LEADER, RAID_WARNING, BCM.CUSTOMCHANNEL}
for i=1, #tbl do
info.text = tbl[i]
info.value = i
Expand All @@ -339,7 +339,7 @@ BCM.modules[#BCM.modules+1] = function()
chanNameInput:SetMaxLetters(10)
chanNameInput:EnableMouse(false)
chanNameInput:SetScript("OnTextChanged", function(frame, changed)
if changed then bcmDB.shortNames[frame.value] = frame:GetText() end
if changed then bcmDB.replacementNames[frame.value] = frame:GetText() end
end)
chanNameInput:SetScript("OnEnterPressed", chanNameInput:GetScript("OnEscapePressed"))
end
Expand Down
1 change: 1 addition & 0 deletions Locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ L["WORLDDEFENSE"] = "Weltverteidigung"

--L.protectedText = "<Protected Text>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ L.TRADE_SERVICES = "Trade (Services)"
L.WORLDDEFENSE = "WorldDefense"
L.LOCALDEFENSE = "LocalDefense"
L.LFG = "LookingForGroup"
L.NEWCOMER_CHAT = "Newcomer Chat"
L.GUILDRECRUIT = "GuildRecruitment"
L.CHANNELNUMBER = "Channel Number"
L.CHANNELNAME = "Channel Name"
Expand Down
1 change: 1 addition & 0 deletions Locales/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ L["WORLDDEFENSE"] = "DefensaGeneral"

--L.protectedText = "<Protected Text>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ L["WORLDDEFENSE"] = "DéfenseUniverselle"

--L.protectedText = "<Protected Text>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/itIT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ local _, L = ...

--L.protectedText = "<Protected Text>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ L["CLICKTOCOPY"] = "Shift-클릭으로 대화를 복사합니다."

--BCM.protectedText = "<Protected Text>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/ptBR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ local _, L = ...

--L.protectedText = "<Protected Text>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ L["WORLDDEFENSE"] = "Оборона: глобальный"

L.protectedText = "<Protected Text>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ L["WORLDDEFENSE"] = "世界防务"

L.protectedText = "<被保护的文本>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
1 change: 1 addition & 0 deletions Locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ L["WORLDDEFENSE"] = "世界防務"

L.protectedText = "<受保護的文本>"
--L.TRADE_SERVICES = "Trade (Services)"
--L.NEWCOMER = "Newcomer Chat"
21 changes: 15 additions & 6 deletions channelnames.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@

--[[ Channel Name Replacements Module ]]--

channelnames_version = 10 -- Update if you need to clear old names.
local _, BCM = ...
BCM.modules[#BCM.modules+1] = function()
bcmDB.replacements = nil -- Remove old SV, 10.0.5
if bcmDB.BCM_ChannelNames then bcmDB.shortNames = nil return end
if not bcmDB.channelnames_version then
bcmDB.channelnames_version = channelnames_version
bcmDB.replacements = nil -- Remove old SV, 10.0.5
bcmDB.shortNames = nil -- Remove old SV, 11.0.5
end
if bcmDB.channelnames_version ~= channelnames_version then
bcmDB.replacementNames = nil -- Clean old SV for updated module
end
if bcmDB.BCM_ChannelNames then bcmDB.replacementNames = nil return end

if not bcmDB.shortNames then
bcmDB.shortNames = {
if not bcmDB.replacementNames then
bcmDB.replacementNames = {
"[GEN]", --General
"[T(S)]", --Trade (Services)
"[T]", --Trade
"[WD]", --WorldDefense
"[LD]", --LocalDefense
"[LFG]", --LookingForGroup
"[NEW]", --Newcomer Chat
"[GR]", --GuildRecruitment
"[I]", --Instance
"[IL]", --Instance Leader
Expand All @@ -29,7 +37,7 @@ BCM.modules[#BCM.modules+1] = function()
}
end

local rplc = bcmDB.shortNames
local rplc = bcmDB.replacementNames
local gsub = gsub
local chn = {
"%[%d%d?%. General[^%]]*%]",
Expand All @@ -38,6 +46,7 @@ BCM.modules[#BCM.modules+1] = function()
"%[%d%d?%. WorldDefense[^%]]*%]",
"%[%d%d?%. LocalDefense[^%]]*%]",
"%[%d%d?%. LookingForGroup[^%]]*%]",
"%[%d%d?%. Newcomer Chat[^%]]*%]",
"%[%d%d?%. GuildRecruitment[^%]]*%]",
gsub(CHAT_INSTANCE_CHAT_GET, ".*%[(.*)%].*", "%%[%1%%]"),
gsub(CHAT_INSTANCE_CHAT_LEADER_GET, ".*%[(.*)%].*", "%%[%1%%]"),
Expand Down