mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Core.git
synced 2026-11-04 05:46:56 +00:00
0.1.237: Fluesterfenster (klein, verschiebbar, nie im Kampf, nach dem Kampf wieder offen), Einstellungen dazu [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
7b53e1b963
commit
e7ae558f37
+17
-4
@@ -85,7 +85,7 @@ end
|
||||
-- Spielerdaten (Klasse, Level) merken
|
||||
------------------------------------------------------------------------
|
||||
|
||||
function CL.Note(name, class, level)
|
||||
function CL.Note(name, class, level, extra)
|
||||
if type(name) ~= "string" or name == "" then return end
|
||||
local tok = CL.ClassToken(class) or (type(class) == "string" and FALLBACK_COLORS[class] and class) or nil
|
||||
local lv = tonumber(level)
|
||||
@@ -97,10 +97,21 @@ function CL.Note(name, class, level)
|
||||
local changed = false
|
||||
if tok and r.c ~= tok then r.c = tok; changed = true end
|
||||
if lv and lv > 0 and r.l ~= lv then r.l = lv; changed = true end
|
||||
if type(extra) == "table" then
|
||||
if extra.race and extra.race ~= "" and r.r ~= extra.race then r.r = extra.race; changed = true end
|
||||
if extra.guild and r.g ~= extra.guild then r.g = extra.guild; changed = true end
|
||||
if extra.cn and extra.cn ~= "" and r.cn ~= extra.cn then r.cn = extra.cn; changed = true end
|
||||
end
|
||||
r.t = Now()
|
||||
if changed then CL.version = CL.version + 1 end
|
||||
end
|
||||
|
||||
-- ganzer Merker-Eintrag (c, l, r, g, cn) oder nil
|
||||
function CL.Detail(name)
|
||||
local db = PDB()
|
||||
return db and db[name] or nil
|
||||
end
|
||||
|
||||
function CL.Info(name)
|
||||
local db = PDB()
|
||||
local r = db and db[name]
|
||||
@@ -111,8 +122,10 @@ end
|
||||
local function NoteUnit(unit)
|
||||
if not (G.UnitExists and G.UnitExists(unit) and G.UnitIsPlayer and G.UnitIsPlayer(unit)) then return end
|
||||
local name = G.UnitName(unit)
|
||||
local _, tok = G.UnitClass(unit)
|
||||
CL.Note(name, tok, G.UnitLevel(unit))
|
||||
local cn, tok = G.UnitClass(unit)
|
||||
local guild = G.GetGuildInfo and G.GetGuildInfo(unit) or nil
|
||||
local race = G.UnitRace and G.UnitRace(unit) or nil
|
||||
CL.Note(name, tok, G.UnitLevel(unit), { race = race, guild = guild, cn = cn })
|
||||
end
|
||||
|
||||
function CL.ScanGroup()
|
||||
@@ -248,7 +261,7 @@ local function OnWho()
|
||||
while i <= n do
|
||||
local name, guild, level, race, class = G.GetWhoInfo(i)
|
||||
if name then
|
||||
CL.Note(name, class, level)
|
||||
CL.Note(name, class, level, { race = race, guild = guild or "", cn = class })
|
||||
if forced[name] then
|
||||
forced[name] = nil
|
||||
FW:Print(name .. ": " .. tostring(level) .. " " .. tostring(class) .. (guild and guild ~= "" and (" <" .. guild .. ">") or ""))
|
||||
|
||||
Reference in New Issue
Block a user