mirror of
https://github.com/Lacustat/Freewood-OctoWoW-Mail.git
synced 2026-10-31 23:06:56 +00:00
0.1.156: Brief an Absender zurueck; Codex-Datenbank ohne langes Einfrieren (Item-Werte in Zeitscheiben)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016onJCSHLwhs9udhC9ZLzk9
This commit is contained in:
+42
-6
@@ -340,17 +340,20 @@ 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, 68)
|
||||
d.bodyScroll:SetPoint("BOTTOMRIGHT", d, "BOTTOMRIGHT", -12, 100)
|
||||
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, 44)
|
||||
d.msg:SetPoint("BOTTOMLEFT", d, "BOTTOMLEFT", 12, 76)
|
||||
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.reply = UI.CreateButton(d, T("MAIL_REPLY"), 80, 26, nil, "default")
|
||||
d.reply:SetPoint("LEFT", d.take, "RIGHT", 6, 0)
|
||||
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)
|
||||
d.delete = UI.CreateButton(d, T("MAIL_DELETE"), 80, 26, nil, "danger")
|
||||
d.delete:SetPoint("BOTTOMRIGHT", d, "BOTTOMRIGHT", -12, 12)
|
||||
UI.AttachTooltip(d.delete, function() return T("MAIL_DELETE") end, function() return T("MAIL_DELETE_TIP") end)
|
||||
@@ -385,6 +388,25 @@ local function BuildInbox(parent)
|
||||
end
|
||||
f.Refresh()
|
||||
end)
|
||||
local function DoReturn(m)
|
||||
if not m then return end
|
||||
if f.retConfirm ~= m.key then
|
||||
f.retConfirm = m.key
|
||||
f.Refresh()
|
||||
return
|
||||
end
|
||||
f.retConfirm = nil
|
||||
local ok, why = Mail:ReturnMail(m)
|
||||
if ok then
|
||||
Mail.view, f.current, f.shownKey = nil, nil, nil
|
||||
ShowError(nil)
|
||||
else
|
||||
ShowError(why)
|
||||
end
|
||||
f.Refresh()
|
||||
end
|
||||
f.DoReturn = DoReturn
|
||||
d.ret:SetScript("OnClick", function() DoReturn(f.current) end)
|
||||
d.reply:SetScript("OnClick", function()
|
||||
local m = f.current
|
||||
if m and panes.send and panes.send.Prefill then
|
||||
@@ -411,19 +433,29 @@ local function BuildInbox(parent)
|
||||
row.icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
|
||||
row.l1 = UI.CreateLabel(row, "", { size = 12 })
|
||||
row.l1:SetPoint("TOPLEFT", row, "TOPLEFT", 66, -6)
|
||||
row.l1:SetPoint("RIGHT", row, "RIGHT", -40, 0)
|
||||
row.l1:SetPoint("RIGHT", row, "RIGHT", -70, 0)
|
||||
row.l1:SetWordWrap(false)
|
||||
row.l2 = UI.CreateLabel(row, "", { size = 11, color = "textDim" })
|
||||
row.l2:SetPoint("TOPLEFT", row, "TOPLEFT", 66, -22)
|
||||
row.l2:SetPoint("RIGHT", row, "RIGHT", -40, 0)
|
||||
row.l2:SetPoint("RIGHT", row, "RIGHT", -70, 0)
|
||||
row.l2:SetWordWrap(false)
|
||||
row.ret = UI.CreateButton(row, "<", 24, 22, nil, "default")
|
||||
row.ret:SetPoint("RIGHT", row, "RIGHT", -6, 0)
|
||||
UI.AttachTooltip(row.ret, function() return T("MAIL_RETURN") end, function() return T("MAIL_RETURN_TIP") end)
|
||||
row.ret:SetScript("OnClick", function()
|
||||
if row.mail then
|
||||
Mail.view = { key = row.mail.key, pair = Mail.Pair(row.mail) }
|
||||
f.DoReturn(row.mail)
|
||||
end
|
||||
end)
|
||||
row.days = UI.CreateLabel(row, "", { size = 11, color = "textDim", justify = "RIGHT" })
|
||||
row.days:SetPoint("RIGHT", row, "RIGHT", -8, 0)
|
||||
row.days:SetPoint("RIGHT", row.ret, "LEFT", -4, 0)
|
||||
Tooltip(row)
|
||||
row:SetScript("OnMouseUp", function()
|
||||
if row.mail then
|
||||
Mail.view = { key = row.mail.key, pair = Mail.Pair(row.mail) }
|
||||
f.codConfirm = nil
|
||||
f.retConfirm = nil
|
||||
ShowError(nil)
|
||||
f.Refresh()
|
||||
end
|
||||
@@ -447,7 +479,7 @@ local function BuildInbox(parent)
|
||||
end
|
||||
f.current = cur
|
||||
d.empty:SetShown(cur == nil)
|
||||
for _, w in ipairs({ d.subj, d.meta, d.attach, d.bodyScroll, d.msg, d.take, d.reply, d.delete }) do
|
||||
for _, w in ipairs({ d.subj, d.meta, d.attach, d.bodyScroll, d.msg, d.take, d.reply, d.ret, d.delete }) do
|
||||
w:SetShown(cur ~= nil)
|
||||
end
|
||||
if not cur then f.shownKey = nil return end
|
||||
@@ -483,6 +515,8 @@ local function BuildInbox(parent)
|
||||
d.take:SetButtonEnabled(canTake and not busy and Mail.open)
|
||||
d.delete:SetButtonEnabled(Mail.Deletable(cur) and not busy and Mail.open)
|
||||
d.reply:SetButtonEnabled(true)
|
||||
d.ret:SetLabel(f.retConfirm == cur.key and T("MAIL_RETURN_CONFIRM") or T("MAIL_RETURN"))
|
||||
d.ret:SetButtonEnabled(Mail.Returnable(cur) and not busy and Mail.open)
|
||||
end
|
||||
|
||||
function f.Refresh()
|
||||
@@ -518,6 +552,8 @@ local function BuildInbox(parent)
|
||||
end
|
||||
row.l2:SetText(text)
|
||||
row.days:SetText(m.days and string.format(T("MAIL_ROW_DAYS"), math.floor(m.days)) or "")
|
||||
row.ret:SetLabel(f.retConfirm == m.key and "?" or "<")
|
||||
row.ret:SetButtonEnabled(Mail.Returnable(m) and not busy and Mail.open)
|
||||
row.cb:SetShown(m.take)
|
||||
row:SetAlpha(m.take and 1 or 0.75)
|
||||
row.cb:Refresh()
|
||||
|
||||
Reference in New Issue
Block a user