0.1.161: Brett-Briefe mit Kennung, gruene Darstellung, Mail-Pflicht fuer Brief-Auftraege, doppelte Abfrage, Knopf-Reihen ohne Ueberlappung

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
Claude
2026-10-28 23:51:24 +01:00
parent 2eb5eb2727
commit 94d580ccd6
4 changed files with 48 additions and 8 deletions
+16 -7
View File
@@ -340,17 +340,17 @@ local function BuildInbox(parent)
d.attach:SetWordWrap(false)
d.bodyScroll = UI.CreateScrollFrame(d)
d.bodyScroll:SetPoint("TOPLEFT", d, "TOPLEFT", 12, -76)
d.bodyScroll:SetPoint("BOTTOMRIGHT", d, "BOTTOMRIGHT", -12, 100)
d.bodyScroll:SetPoint("BOTTOMRIGHT", d, "BOTTOMRIGHT", -12, 132)
d.body = UI.CreateLabel(d.bodyScroll.child, "", { size = 12, justifyV = "TOP" })
d.body:SetPoint("TOPLEFT", d.bodyScroll.child, "TOPLEFT", 2, -2)
d.msg = UI.CreateLabel(d, "", { size = 11, color = "danger" })
d.msg:SetPoint("BOTTOMLEFT", d, "BOTTOMLEFT", 12, 76)
d.msg:SetPoint("BOTTOMLEFT", d, "BOTTOMLEFT", 12, 108)
d.msg:SetPoint("RIGHT", d, "RIGHT", -12, 0)
d.msg:SetWordWrap(false)
d.take = UI.CreateButton(d, T("MAIL_TAKE_ITEM"), 120, 26, nil, "primary")
d.take:SetPoint("BOTTOMLEFT", d, "BOTTOMLEFT", 12, 12)
d.take:SetPoint("BOTTOMLEFT", d, "BOTTOMLEFT", 12, 76) -- drei feste Reihen: Nehmen / Zurueck / Antworten + Loeschen
d.reply = UI.CreateButton(d, T("MAIL_REPLY"), 80, 26, nil, "default")
d.reply:SetPoint("LEFT", d.take, "RIGHT", 6, 0)
d.reply:SetPoint("BOTTOMLEFT", d, "BOTTOMLEFT", 12, 12)
d.ret = UI.CreateButton(d, T("MAIL_RETURN"), 170, 26, nil, "default")
d.ret:SetPoint("BOTTOMLEFT", d, "BOTTOMLEFT", 12, 44)
UI.AttachTooltip(d.ret, function() return T("MAIL_RETURN") end, function() return T("MAIL_RETURN_TIP") end)
@@ -486,10 +486,19 @@ local function BuildInbox(parent)
view.key = cur.key
if f.shownKey ~= cur.key then
f.shownKey = cur.key
f.bodyTries = 0
f.bodyText = Mail.ReadText(cur.i)
if FW.Brett and FW.Brett.CheckMailData then pcall(FW.Brett.CheckMailData, cur.i) end
elseif (f.bodyText or "") == "" and (f.bodyTries or 0) < 5 then
-- der Server liefert den Brieftext manchmal erst einen Moment spaeter: noch einmal lesen
f.bodyTries = (f.bodyTries or 0) + 1
f.bodyText = Mail.ReadText(cur.i)
if (f.bodyText or "") == "" and C_Timer and C_Timer.After then
local key = cur.key
C_Timer.After(0.7, function() if f.shownKey == key and f:IsShown() then f.Refresh() end end)
end
end
d.subj:SetText(cur.subject ~= "" and cur.subject or T("MAIL_ARCH_NOSUBJECT"))
d.subj:SetText(cur.subject ~= "" and Mail.ColorSubject(cur.subject) or T("MAIL_ARCH_NOSUBJECT"))
d.meta:SetText(string.format(T("MAIL_DETAIL_FROM"), cur.sender) .. (cur.days and (" " .. string.format(T("MAIL_ROW_DAYS"), math.floor(cur.days))) or ""))
local parts = {}
if cur.hasItem then parts[#parts + 1] = string.format(T("MAIL_ATTACH_ITEM"), (cur.itemName or "?") .. ((cur.itemCount or 1) > 1 and (" x" .. cur.itemCount) or "")) end
@@ -498,7 +507,7 @@ local function BuildInbox(parent)
if cur.cod > 0 then attach = attach .. " |cffff7060" .. string.format(T("MAIL_ATTACH_COD"), Mail.Money(cur.cod)) .. "|r" end
d.attach:SetText(attach)
local text = f.bodyText or ""
d.body:SetText(text ~= "" and text or "|cff8a8f9a" .. T("MAIL_DETAIL_NOTEXT") .. "|r")
d.body:SetText(text ~= "" and Mail.ColorBody(text) or "|cff8a8f9a" .. T("MAIL_DETAIL_NOTEXT") .. "|r")
local bw = math.max(200, (d.bodyScroll:GetWidth() or 0) - 22)
local h = UI.FitLabel(d.body, bw, 20)
d.bodyScroll:SetContentHeight(h + 8)
@@ -538,7 +547,7 @@ local function BuildInbox(parent)
else
row.icon:SetTexture("Interface\\Icons\\INV_Misc_Note_01")
end
row.l1:SetText(m.subject ~= "" and m.subject or m.sender)
row.l1:SetText(m.subject ~= "" and Mail.ColorSubject(m.subject) or m.sender)
local parts = {}
if m.hasItem then parts[#parts + 1] = (m.itemName or "?") .. ((m.itemCount or 1) > 1 and (" x" .. m.itemCount) or "") end
if m.money > 0 then parts[#parts + 1] = Mail.Money(m.money) end