Improve tactic data handling and update UI logic.
All checks were successful
forgejo/Czech Quests/addon/pipeline/head This commit looks good

This commit is contained in:
Roman Jaroš 2025-03-30 17:56:47 +02:00
parent 9fe284c18e
commit 3cb2ed503f
9 changed files with 1116 additions and 1019 deletions

View file

@ -32,24 +32,26 @@ end
local function RenderBossTactics(frame, bossName)
HideOtherContent()
local bossData = addon.data.tactic[bossName]
local difficulty = 'lfr' -- 17
local difficulty = 'lfg_raid' -- 17
if DIFFICULTY == 14 then
difficulty = 'normal'
difficulty = 'normal_raid'
elseif DIFFICULTY == 15 then
difficulty = 'heroic'
difficulty = 'heroic_raid'
elseif DIFFICULTY == 16 then
difficulty = 'mythic'
difficulty = 'mythic_raid'
elseif DIFFICULTY == 1 then
difficulty = 'normal'
difficulty = 'normal_dungeon'
elseif DIFFICULTY == 2 then
difficulty = 'heroic'
difficulty = 'heroic_dungeon'
elseif DIFFICULTY == 23 then
difficulty = 'mythic'
difficulty = 'mythic_dungeon'
elseif DIFFICULTY == 8 then
difficulty = 'mythicplus_dungeon'
end
local tactic = bossData and bossData[1][difficulty] or nil
local bossData = CzechQuestsAddon:GetData('tactic', bossName)
local tactic = bossData and bossData[difficulty] or nil
if not tactic then
frame.summary:SetText("Boss " .. bossName .. " nemá pro tuto obtížnost přeloženou taktiku.")
@ -71,6 +73,7 @@ local function RenderBossTactics(frame, bossName)
end
frame.summary:SetText(tactic.summary)
frame.inform:SetText("|cffffffffVždy dodržuj pokyny raid leadera.|r")
local tankHeader = frame:CreateHeader()
tankHeader.button.title:SetText("Tank")

View file

@ -39,6 +39,15 @@ function TacticFrame:Init()
frame.summary:SetPoint("TOPLEFT", frame, "TOPLEFT", 2, 0)
frame.summary:SetWidth(scrollFrame:GetWidth() - 10)
frame.inform = addon.API.CreateCzechFont(
frame,
CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_NAME,
CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_SIZE
)
frame.inform:SetTextColor(0.251, 0.145, 0.012)
frame.inform:SetPoint("BOTTOMLEFT", frame.summary, "BOTTOMLEFT", 2, -20)
frame.inform:SetWidth(scrollFrame:GetWidth() - 10)
local dropdown = CreateFrame("DropdownButton", nil, EncounterJournal.encounter.info, "WowStyle1DropdownTemplate")
dropdown:SetPoint("BOTTOMRIGHT", EncounterJournal.encounter.info.encounterTitle, "BOTTOMRIGHT", 2, -2)
dropdown:SetWidth(200)
@ -59,6 +68,12 @@ function TacticFrame:UpdateSettings()
CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_SIZE
)
addon.API.UpdateCzechFont(
frame.inform,
CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_NAME,
CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_SIZE
)
for _, header in ipairs(self.headers) do
addon.API.UpdateCzechFont(
header.description,
@ -182,7 +197,7 @@ end
function TacticFrame:UpdateHeaderPositions()
local yOffset = -40
for _, header in ipairs(self.headers) do
header:SetPoint("BOTTOMLEFT", self.summary, "BOTTOMLEFT", 0, yOffset)
header:SetPoint("BOTTOMLEFT", self.inform, "BOTTOMLEFT", 0, yOffset)
if header.expanded then
yOffset = yOffset - header.description:GetHeight() - 50
else