Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Adds Newcomer Chat to channelnames
Browse files Browse the repository at this point in the history
Requires localization. Also removes custom channelnames settings. Fixes funkydude#35 and funkydude#81
  • Loading branch information
Poccket authored Aug 6, 2024
1 parent 5d1b218 commit 97b07cc
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 8 deletions.
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.shorterNames[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.shorterNames[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.shorterNames[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"
11 changes: 7 additions & 4 deletions channelnames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
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
bcmDB.shortNames = nil -- Remove old SV, 11.0.5
if bcmDB.BCM_ChannelNames then bcmDB.shorterNames = nil return end

if not bcmDB.shortNames then
bcmDB.shortNames = {
if not bcmDB.shorterNames then
bcmDB.shorterNames = {
"[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 +31,7 @@ BCM.modules[#BCM.modules+1] = function()
}
end

local rplc = bcmDB.shortNames
local rplc = bcmDB.shorterNames
local gsub = gsub
local chn = {
"%[%d%d?%. General[^%]]*%]",
Expand All @@ -38,6 +40,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

0 comments on commit 97b07cc

Please sign in to comment.