diff --git a/CodexNameUI.lua b/CodexNameUI.lua index b66b717..8789830 100644 --- a/CodexNameUI.lua +++ b/CodexNameUI.lua @@ -738,7 +738,7 @@ function NameUI.Attach(f, getSel, onChanged, origin) if staged ~= nil then return staged end return Codex:IsBad(kind, id) end - local badButton = UI.CreateButton(f, L.CODEX_BAD_MARK, 170, 26, function() + local badButton = UI.CreateButton(f, L.CODEX_BAD_MARK, 150, 26, function() local kind, id = getSel() if kind and id and kind ~= "items" then Codex:SetBad(kind, id, not BadNow(kind, id)) @@ -747,15 +747,20 @@ function NameUI.Attach(f, getSel, onChanged, origin) end end, "default") badButton:Hide() + UI.AttachTooltip(badButton, function() return L.CODEX_BAD_MARK end, function() return L.CODEX_BAD_TIP end) -- Die Knoepfe stehen in einer eigenen Reihe unter "Zurueck/Favorit", von links nach rechts; -- ist der Platz zu knapp, laufen sie in die naechste Reihe. ctl.height ist die belegte Hoehe. local strip = { propsButton, badButton, importButton, editButton } - function ctl.Layout() + ctl.lead = {} -- Knoepfe vor der Reihe (Zurueck, Favorit), von Codex-UI gesetzt + function ctl.Layout(silent) local avail = (f:GetWidth() or 0) - origin.x if avail < 240 then avail = 640 end local x, y, any = 0, 0, false - for _, b in ipairs(strip) do + local all = {} + for _, b in ipairs(ctl.lead) do all[#all + 1] = b end + for _, b in ipairs(strip) do all[#all + 1] = b end + for _, b in ipairs(all) do if b:IsShown() then local w = b:GetWidth() or 150 if x > 0 and x + w > avail then @@ -771,7 +776,7 @@ function NameUI.Attach(f, getSel, onChanged, origin) local h = any and (y + 32) or 0 if h ~= ctl.height then ctl.height = h - if origin.relayout then origin.relayout() end + if origin.relayout and not silent then origin.relayout() end end end ctl.strip = strip diff --git a/CodexUI.lua b/CodexUI.lua index 31dbedf..ce1c2a5 100644 --- a/CodexUI.lua +++ b/CodexUI.lua @@ -1912,11 +1912,11 @@ local function Build(content) nameCtl = Codex.NameUI.Attach(f, function() return kind, selected end, function() dataVersion = dataVersion + 1 Refresh() - end, { x = LIST_W + 22, y = 34, relayout = function() if UpdateFavUIRef then UpdateFavUIRef() end end }) + end, { x = LIST_W + 22, y = 0, relayout = function() if UpdateFavUIRef then UpdateFavUIRef() end end }) end ---------------- Favorit und Notiz ---------------- - local favButton = UI.CreateButton(f, L.CODEX_FAV_ADD, 140, 26, function() + local favButton = UI.CreateButton(f, L.CODEX_FAV_ADD, 150, 26, function() if selected ~= nil and Codex.FavSupported(kind) then Codex.SetFav(kind, selected, not Codex.IsFav(kind, selected)) dataVersion = dataVersion + 1 @@ -1925,6 +1925,7 @@ local function Build(content) end, "default") favButton:SetPoint("TOPLEFT", f, "TOPLEFT", LIST_W + 22 + 108, 0) favButton:Hide() + if nameCtl then nameCtl.lead = { backButton, favButton } end local noteBox = UI.CreatePanel(f, "bgDeep", "bronze") noteBox:SetHeight(24) noteBox:SetPoint("TOPLEFT", f, "TOPLEFT", LIST_W + 22, -34) @@ -1987,8 +1988,15 @@ local function Build(content) noteEdit:ClearFocus() end noteTarget = nil - local devH = nameCtl and nameCtl.height or 0 -- Reihe mit den Bearbeiten-Knoepfen (nur fuer Berechtigte) - local top = 34 + devH + -- Favorit-Knopf zuerst ein-/ausblenden, dann die gemeinsame Knopfreihe (Zurueck, Favorit, Bearbeiten ...) legen + if ok then + favButton:Show() + else + favButton:Hide() + end + if nameCtl then nameCtl.Layout(true) end + local devH = nameCtl and nameCtl.height or 32 -- eine gemeinsame Reihe von links nach rechts + local top = devH + 2 noteBox:ClearAllPoints() noteBox:SetPoint("TOPLEFT", f, "TOPLEFT", LIST_W + 22, -top) noteBox:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, -top) diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index cf19db0..397aa95 100644 --- a/Freewood-OctoWoW-Codex.toc +++ b/Freewood-OctoWoW-Codex.toc @@ -3,7 +3,7 @@ ## Notes: Learns quests, creatures and drops while you play: who gives and takes a quest, rewards, objectives, drop chances. ## Notes-deDE: Lernt beim Spielen Quests, Kreaturen und Beute: wer eine Quest vergibt und annimmt, Belohnungen, Ziele, Drop-Chancen. ## Author: Lacustat -## Version: 0.1.156 +## Version: 0.1.157 ## Dependencies: Freewood-OctoWoW-Core ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData diff --git a/Locales.lua b/Locales.lua index 9d31679..27a2800 100644 --- a/Locales.lua +++ b/Locales.lua @@ -182,8 +182,9 @@ FW:AddLocale("enUS", { CODEX_SORTBY_ahkill = "Value per kill (auction)", CODEX_SORTBY_gpmah = "Gold per minute (auction)", CODEX_FILTER_AH = "Auction (g)", - CODEX_BAD_MARK = "Mark as faulty", + CODEX_BAD_MARK = "Mark faulty", CODEX_BAD_UNMARK = "Unmark faulty", + CODEX_BAD_TIP = "Hides this entry for all players (permitted characters only). Click again to remove the mark.", CODEX_SORTBY_flip = "Vendor profit (auction)", CODEX_AH_AGE = "Last scan", CODEX_AH_TODAY = "today", @@ -530,7 +531,7 @@ FW:AddLocale("enUS", { CODEX_TEST_SHARE = "Sharing: %s, %d own records, %d players with %d records stored", CODEX_ON = "on", CODEX_OFF = "off", - CODEX_NAME_EDIT = "Edit name", + CODEX_NAME_EDIT = "Change name", CODEX_NAME_IMPORT = "Paste names", CODEX_NAME_DE = "German", CODEX_NAME_EN = "English", @@ -725,8 +726,9 @@ FW:AddLocale("deDE", { CODEX_SORTBY_ahkill = "Wert pro Kill (Auktion)", CODEX_SORTBY_gpmah = "Gold pro Minute (Auktion)", CODEX_FILTER_AH = "Auktion (g)", - CODEX_BAD_MARK = "Fehlerhaft markieren", - CODEX_BAD_UNMARK = "Markierung aufheben", + CODEX_BAD_MARK = "Fehlerhaft", + CODEX_BAD_UNMARK = "Fehlerhaft aufheben", + CODEX_BAD_TIP = "Blendet diesen Eintrag bei allen Spielern aus (nur berechtigte Charaktere). Erneut klicken hebt die Markierung auf.", CODEX_SORTBY_flip = "Händlergewinn (Auktion)", CODEX_AH_AGE = "Letzter Scan", CODEX_AH_TODAY = "heute", @@ -1073,7 +1075,7 @@ FW:AddLocale("deDE", { CODEX_TEST_SHARE = "Teilen: %s, %d eigene Datensätze, %d Spieler mit %d gespeicherten Datensätzen", CODEX_ON = "an", CODEX_OFF = "aus", - CODEX_NAME_EDIT = "Name bearbeiten", + CODEX_NAME_EDIT = "Name ändern", CODEX_NAME_IMPORT = "Namen einfügen", CODEX_NAME_DE = "Deutsch", CODEX_NAME_EN = "Englisch",