mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Core.git
synced 2026-11-04 07:36:55 +00:00
0.1.233: Kanaele: breitere/einklappbare Seitenleiste, eigene Kategorien (anlegen, umbenennen, loeschen, verschieben), Kanal beitreten/verlassen, Kanaele verschieben, Datum und Tagestrenner im Chat [ungeprueft]
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
33388f80d6
commit
c3f7db4d45
@@ -253,6 +253,42 @@ while ci <= 10 do
|
||||
ci = ci + 1
|
||||
end
|
||||
|
||||
-- Beitreten / Verlassen (JoinChannelByName legt den Kanal bei Bedarf an). Das Spiel erlaubt hoechstens 10 Kanaele.
|
||||
Ch.MAX = 10
|
||||
Ch.pendingCat = {}
|
||||
|
||||
function Ch.FreeSlots()
|
||||
local n = Ch.MAX - table.getn(Ch.list)
|
||||
if n < 0 then n = 0 end
|
||||
return n
|
||||
end
|
||||
|
||||
function Ch.Join(name, pw, catId)
|
||||
if type(name) ~= "string" or name == "" then return false end
|
||||
if Ch.FreeSlots() <= 0 then return false, "full" end
|
||||
if type(G.JoinChannelByName) ~= "function" then return false end
|
||||
if pw == "" then pw = nil end
|
||||
pcall(G.JoinChannelByName, name, pw)
|
||||
if catId then Ch.pendingCat[string.lower(name)] = catId end
|
||||
Ch.rescanAt = ((G.GetTime and G.GetTime()) or 0) + 1.5
|
||||
return true
|
||||
end
|
||||
|
||||
function Ch.Leave(name)
|
||||
if type(name) ~= "string" or name == "" then return end
|
||||
if string.find(name, "^Freewood") then return end
|
||||
if type(G.LeaveChannelByName) == "function" then pcall(G.LeaveChannelByName, name) end
|
||||
Ch.rescanAt = ((G.GetTime and G.GetTime()) or 0) + 1.0
|
||||
end
|
||||
|
||||
local rescanPump = CreateFrame("Frame")
|
||||
rescanPump:SetScript("OnUpdate", function()
|
||||
if Ch.rescanAt and G.GetTime and G.GetTime() >= Ch.rescanAt then
|
||||
Ch.rescanAt = nil
|
||||
Ch.RefreshAll()
|
||||
end
|
||||
end)
|
||||
|
||||
-- Aktionen (geschuetzt)
|
||||
function Ch.Whisper(name)
|
||||
if type(G.ChatFrame_SendTell) == "function" then pcall(G.ChatFrame_SendTell, name) end
|
||||
|
||||
Reference in New Issue
Block a user