0.1.160: Mail: reine Textbriefe ohne Anhang/Gold moeglich; Items-Hinweis umbrechen

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:36:22 +01:00
parent 396e446875
commit 2eb5eb2727
4 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
## Notes: Own mailbox window: open all or selected mails safely, recent recipients, mailing lists with automatic sending, multi-item mails, gold surplus and cash on delivery.
## Notes-deDE: Eigenes Briefkasten-Fenster: alles oder Ausgewähltes sicher öffnen, letzte Empfänger, Mailinglisten mit Automatik, mehrere Items, Gold-Überschuss und Nachnahme.
## Author: Lacustat
## Version: 0.1.159
## Version: 0.1.160
## Dependencies: Freewood-OctoWoW-Core
## OptionalDeps: Freewood-OctoWoW-Creator, Freewood-OctoWoW-Brett
+4 -4
View File
@@ -41,7 +41,7 @@ FW:AddLocale("enUS", {
MAIL_BODY = "Text",
MAIL_ITEMS = "Items",
MAIL_ITEMS_ADD = "Add items...",
MAIL_ITEMS_NONE = "No items. Drag items from your bags here, right-click them, or use Add items. Without items only gold (if any) is sent.",
MAIL_ITEMS_NONE = "No items. Drag items from your bags here, right-click them, or use Add items. Without items only the text and gold (if any) are sent.",
MAIL_ITEMS_REMOVE = "Remove",
MAIL_GOLD = "Gold",
MAIL_SILVER = "Silver",
@@ -50,7 +50,7 @@ FW:AddLocale("enUS", {
MAIL_SEND = "Send",
MAIL_SEND_COUNT = "%d mails will be sent one after another.",
MAIL_SEND_COUNT1 = "1 mail will be sent.",
MAIL_SEND_NOTHING = "Nothing to send: add items or gold.",
MAIL_SEND_NOTHING = "Nothing to send: write a text or add items or gold.",
MAIL_SEND_NO_TO = "Enter a recipient.",
MAIL_SEND_SELF = "You cannot mail yourself.",
MAIL_SEND_COD_NEEDS_ITEM = "Cash on delivery needs at least one item.",
@@ -191,7 +191,7 @@ FW:AddLocale("deDE", {
MAIL_BODY = "Text",
MAIL_ITEMS = "Items",
MAIL_ITEMS_ADD = "Items hinzufügen...",
MAIL_ITEMS_NONE = "Keine Items. Items aus den Taschen hierher ziehen, rechtsklicken oder \"Items hinzufügen\" nutzen. Ohne Items wird nur Gold (falls angegeben) gesendet.",
MAIL_ITEMS_NONE = "Keine Items. Items aus den Taschen hierher ziehen, rechtsklicken oder \"Items hinzufügen\" nutzen. Ohne Items werden nur Text und Gold (falls angegeben) gesendet.",
MAIL_ITEMS_REMOVE = "Entfernen",
MAIL_GOLD = "Gold",
MAIL_SILVER = "Silber",
@@ -200,7 +200,7 @@ FW:AddLocale("deDE", {
MAIL_SEND = "Senden",
MAIL_SEND_COUNT = "%d Briefe werden nacheinander gesendet.",
MAIL_SEND_COUNT1 = "1 Brief wird gesendet.",
MAIL_SEND_NOTHING = "Nichts zu senden: Items oder Gold angeben.",
MAIL_SEND_NOTHING = "Nichts zu senden: Text schreiben oder Items bzw. Gold angeben.",
MAIL_SEND_NO_TO = "Empfänger eingeben.",
MAIL_SEND_SELF = "Du kannst dir selbst nichts schicken.",
MAIL_SEND_COD_NEEDS_ITEM = "Nachnahme braucht mindestens ein Item.",
+9 -2
View File
@@ -759,7 +759,8 @@ function Mail:BuildCompose(form)
if IsSelf(to) then return nil, "self" end
local picks = form.picks or {}
local money = math.floor(tonumber(form.money) or 0)
if #picks == 0 and money <= 0 then return nil, "nothing" end
-- Ein reiner Textbrief (ohne Anhang und Gold) ist erlaubt; leer ist nur, wer weder Betreff noch Text noch Anhang hat
if #picks == 0 and money <= 0 and Trim(form.subject) == "" and Trim(form.body) == "" then return nil, "nothing" end
if form.cod and #picks == 0 then return nil, "codItem" end
if form.cod and money <= 0 then return nil, "codMoney" end
local base = Trim(form.subject)
@@ -770,7 +771,13 @@ function Mail:BuildCompose(form)
local subject = base
if subject == "" then
local info = pick and Util.GetItem and Util.GetItem(pick.id)
subject = (info and info.name) or FW.L.MAIL_SUBJECT_DEFAULT
subject = (info and info.name) or ""
if subject == "" then
-- Textbrief ohne Betreff: erste Zeile des Textes
local first = Trim(tostring(form.body or ""):match("^[^\r\n]*") or "")
if #first > 40 then first = first:sub(1, 40) end
subject = first ~= "" and first or FW.L.MAIL_SUBJECT_DEFAULT
end
end
if n > 1 then subject = string.format(FW.L.MAIL_SUBJECT_ITEM_N, subject, i, n) end
local job = { to = to, subject = subject, body = form.body or "", item = pick }
+3
View File
@@ -623,6 +623,9 @@ local function BuildSend(parent)
itemScroll:SetHeight(104)
local itemsEmpty = UI.CreateLabel(itemScroll.child, T("MAIL_ITEMS_NONE"), { size = 12, color = "textDim" })
itemsEmpty:SetPoint("TOPLEFT", itemScroll.child, "TOPLEFT", 4, -6)
itemsEmpty:SetPoint("TOPRIGHT", itemScroll.child, "TOPRIGHT", -16, -6)
itemsEmpty:SetJustifyH("LEFT")
itemsEmpty:SetWordWrap(true)
-- Gold und Nachnahme
local goldBox = MakeEdit(f, 90, T("MAIL_GOLD"), 7, true)