0.1.159: Brett-Brief ueber den Freewood-Briefkasten (sichtbar, Auto-Senden), dynamisches Sendetempo, Betreff so breit wie Text

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:33:28 +01:00
parent faf347129d
commit 396e446875
4 changed files with 156 additions and 7 deletions
+62 -2
View File
@@ -606,7 +606,7 @@ local function BuildSend(parent)
dd:SetPoint("LEFT", toBox, "RIGHT", 8, 0)
Heading(f, T("MAIL_SUBJECT"), 0, -54)
local subjBox = MakeEdit(f, 628, nil, 64)
local subjBox = MakeEdit(f, 616, nil, 64) -- genauso breit wie das Textfeld (dessen Rollbalken nimmt 12 ab)
subjBox:SetPoint("TOPLEFT", f, "TOPLEFT", 0, -74)
Heading(f, T("MAIL_BODY"), 0, -108)
@@ -642,6 +642,57 @@ local function BuildSend(parent)
local send = UI.CreateButton(f, T("MAIL_SEND"), 150, 30, nil, "primary")
send:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 0, 0)
-- Brett-Brief: sichtbare Vorbereitung im eigenen Fenster (verdeckt das Formular, solange der Auftrag den Brief fuellt)
local bl = UI.CreatePanel(f, "bgDeep", "gold")
bl:SetPoint("TOPLEFT", f, "TOPLEFT", -8, 8)
bl:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 8, -8)
bl:SetFrameLevel(f:GetFrameLevel() + 30)
bl:EnableMouse(true)
bl:Hide()
local blTitle = UI.CreateLabel(bl, T("MAIL_BOARD_TITLE"), { font = "heading", size = 15, color = "goldLight" })
blTitle:SetPoint("TOPLEFT", bl, "TOPLEFT", 16, -14)
bl.lines = {}
for i = 1, 6 do
local l = UI.CreateLabel(bl, "", { size = 12 })
l:SetPoint("TOPLEFT", bl, "TOPLEFT", 16, -48 - (i - 1) * 24)
l:SetPoint("TOPRIGHT", bl, "TOPRIGHT", -16, -48 - (i - 1) * 24)
l:SetWordWrap(false)
bl.lines[i] = l
end
bl.status = UI.CreateLabel(bl, "", { size = 12, color = "goldLight", justifyV = "TOP" })
bl.status:SetPoint("TOPLEFT", bl, "TOPLEFT", 16, -208)
bl.status:SetPoint("TOPRIGHT", bl, "TOPRIGHT", -16, -208)
bl.status:SetHeight(48)
bl.status:SetWordWrap(true)
bl.add = UI.CreateButton(bl, T("MAIL_BOARD_ADD"), 180, 28, function()
if FW.Creator and FW.Creator.MailAdd then pcall(FW.Creator.MailAdd) end
if f.Refresh then f.Refresh() end
end, "default")
bl.add:SetPoint("BOTTOMLEFT", bl, "BOTTOMLEFT", 16, 16)
bl.now = UI.CreateButton(bl, T("MAIL_BOARD_SEND"), 160, 28, function()
Mail:BoardSend()
if f.Refresh then f.Refresh() end
end, "primary")
bl.now:SetPoint("BOTTOMRIGHT", bl, "BOTTOMRIGHT", -16, 16)
local function BoardRefresh()
local b = Mail.BoardLetter()
if not b then bl:Hide() return false end
bl:Show()
for i, l in ipairs(bl.lines) do
local c = b.list[i]
l:SetText(c and ((c.ok and "|cff6cc070[x] " or "|cffff7060[ ] ") .. c.text .. "|r") or "")
end
local auto = Mail.db.settings.boardAuto
if b.state == "locked" then bl.status:SetText("|cffff7060" .. T("MAIL_BOARD_LOCKED") .. "|r")
elseif b.state == "armed" then bl.status:SetText(auto and T("MAIL_BOARD_READY_AUTO") or T("MAIL_BOARD_READY_MANUAL"))
else bl.status:SetText(T("MAIL_BOARD_FILLING")) end
bl.now:SetShown(b.state == "armed" and b.all)
bl.add:SetShown(b.state == "filling" and not b.all)
Mail:BoardAuto()
return true
end
local function Copper()
return (tonumber(goldBox.edit:GetText()) or 0) * 10000 + (tonumber(silverBox.edit:GetText()) or 0) * 100 + (tonumber(copperBox.edit:GetText()) or 0)
end
@@ -662,6 +713,7 @@ local function BuildSend(parent)
end
function f.Refresh()
if BoardRefresh() then return end
for i, pk in ipairs(picks) do local pk, i = pk, i
local row = rows[i]
if not row then
@@ -1065,6 +1117,7 @@ local function HideWindow()
end
FW:On("MAIL_WINDOW_SHOW", function() ShowWindow() end, OWNER)
FW:On("CREATOR_MAIL_PREPARING", function() if window and window:IsShown() then SelectTab("send") end end, OWNER)
FW:On("MAIL_WINDOW_HIDE", function() HideWindow() end, OWNER)
FW:On("MAIL_STATE", function() RefreshCurrent() end, OWNER)
FW:On("MAIL_INBOX_CHANGED", function() RefreshCurrent() end, OWNER)
@@ -1078,7 +1131,7 @@ FW:On("MAIL_LISTS_CHANGED", function() RefreshCurrent() if picker and picker:IsS
if UI.RegisterSettingsSection then
UI:RegisterSettingsSection("mail", {
order = 118,
height = 190,
height = 220,
build = function(parent)
local f, stack = UI.CreateSection(parent, T("MAIL_SET_HEADER"))
local boxes = {}
@@ -1096,6 +1149,13 @@ if UI.RegisterSettingsSection then
end)
stack:Add(chat, { fit = true, gap = 4 })
boxes[#boxes + 1] = chat
local boardAuto = UI.CreateCheckbox(f, T("MAIL_SET_BOARDAUTO"), function()
return Mail.db.settings.boardAuto
end, function(value)
Mail.db.settings.boardAuto = value and true or false
end)
stack:Add(boardAuto, { fit = true, gap = 4 })
boxes[#boxes + 1] = boardAuto
local cleanup = UI.CreateCheckbox(f, T("MAIL_SET_CLEANUP"), function()
return Mail.db.settings.cleanup
end, function(value)