Update structure and release script

This commit is contained in:
Roman Jaroš 2024-08-07 11:26:42 +02:00
parent c38735528c
commit 13d41bfd1b
35 changed files with 142 additions and 110 deletions

54
Quests/Frames/OptionsFrame.lua Executable file
View file

@ -0,0 +1,54 @@
local defaultOptions = {
DEBUG_MODE = false,
SELECTED_INTERACTION = 'hover',
SELECTED_HOTKEY = nil
}
local addonName = ...
local optionsFrame = CreateFrame("Frame")
local function CreateCheckBox(parent, optionsPanel, text, onClick)
local checkbox = CreateFrame("CheckButton", nil, optionsPanel, "InterfaceOptionsCheckButtonTemplate")
checkbox.Text:SetText(text)
checkbox:SetScript("OnClick", onClick)
return checkbox
end
local function createOptionCheckbox(parent, optionsPanel, text, optionKey)
local checkbox = CreateCheckBox(parent, optionsPanel, text, function(self)
local checked = self:GetChecked()
CzechQuestsOptions[optionKey] = checked
end)
checkbox:SetPoint("TOPLEFT", parent, "BOTTOMLEFT", 0, -8)
checkbox:SetChecked(CzechQuestsOptions[optionKey])
return checkbox
end
local function InitializeOptions()
local optionsPanel = CreateFrame("Frame", "CzechQuestsOptionsPanel", UIParent)
optionsPanel.name = "CzechQuests"
local title = optionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
title:SetPoint("TOPLEFT", 16, -16)
title:SetText("CzechQuests")
local enableDebugModeCheckbox = createOptionCheckbox(title, optionsPanel,"Enable DEBUG mode", "DEBUG_MODE")
enableDebugModeCheckbox:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 16, -8)
InterfaceOptions_AddCategory(optionsPanel)
end
local function addonLoaded(self, event, addonLoadedName)
if addonLoadedName == addonName then
CzechQuestsOptions = CzechQuestsOptions or defaultOptions
for key, value in pairs(defaultOptions) do
if CzechQuestsOptions[key] == nil then
CzechQuestsOptions[key] = value
end
end
InitializeOptions()
end
end
optionsFrame:RegisterEvent("ADDON_LOADED")
optionsFrame:SetScript("OnEvent", addonLoaded)

View file

@ -0,0 +1,43 @@
local headerFontPath = "Interface\\AddOns\\CzechQuests\\morpheus_cz.ttf"
local textFontPath = "Interface\\AddOns\\CzechQuests\\frizquadratatt_cz.ttf"
local translationInfoFrame = CreateFrame("Frame", "TranslationInfoFrame", nil, BackdropTemplateMixin and "BackdropTemplate")
translationInfoFrame:SetWidth(QuestLogFrame:GetWidth())
translationInfoFrame:SetBackdrop({
bgFile = "Interface/Buttons/WHITE8x8",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 },
})
translationInfoFrame:Hide()
local TranslationInfoFramePrimaryHeader = translationInfoFrame:CreateFontString("TranslationInfoFramePrimaryHeader", "OVERLAY", "QuestTitleFont")
TranslationInfoFramePrimaryHeader:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFramePrimaryHeader:SetJustifyH("LEFT")
TranslationInfoFramePrimaryHeader:SetTextColor(0, 0, 0, 1)
TranslationInfoFramePrimaryHeader:SetFont(headerFontPath, 20, nil)
local TranslationInfoFrameSecondaryHeader = translationInfoFrame:CreateFontString("TranslationInfoFrameSecondaryHeader", "OVERLAY", "QuestTitleFont")
TranslationInfoFrameSecondaryHeader:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFrameSecondaryHeader:SetJustifyH("LEFT")
TranslationInfoFrameSecondaryHeader:SetTextColor(0, 0, 0, 1)
TranslationInfoFrameSecondaryHeader:SetFont(headerFontPath, 20, nil)
local TranslationInfoFramePrimaryText = translationInfoFrame:CreateFontString("TranslationInfoFramePrimaryText", "OVERLAY", "QuestFont")
TranslationInfoFramePrimaryText:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFramePrimaryText:SetJustifyH("LEFT")
TranslationInfoFramePrimaryText:SetTextColor(0, 0, 0, 1)
TranslationInfoFramePrimaryText:SetFont(textFontPath, 15, nil)
local TranslationInfoFrameSecondaryText = translationInfoFrame:CreateFontString("TranslationInfoFrameSecondaryText", "OVERLAY", "QuestFont")
TranslationInfoFrameSecondaryText:SetWidth(translationInfoFrame:GetWidth() - 20)
TranslationInfoFrameSecondaryText:SetJustifyH("LEFT")
TranslationInfoFrameSecondaryText:SetTextColor(0, 0, 0, 1)
TranslationInfoFrameSecondaryText:SetFont(textFontPath, 15, nil)
TranslationInfoFrame:RegisterEvent("QUEST_PROGRESS")
TranslationInfoFrame:RegisterEvent("QUEST_COMPLETE")
TranslationInfoFrame:RegisterEvent("QUEST_FINISHED")
TranslationInfoFrame:RegisterEvent("QUEST_DETAIL")
TranslationInfoFrame:RegisterEvent("ITEM_TEXT_READY")