addon/CzechQuests.lua

87 lines
3.9 KiB
Lua
Raw Normal View History

2024-08-25 11:50:46 +02:00
-- Namespace
CzechQuestsAddon = {};
CzechQuestsAddon.fontPath = "Interface\\AddOns\\CzechQuests\\Assets\\Fonts\\"
2024-08-25 11:50:46 +02:00
-- Define data
CzechQuestsAddon.data = {};
CzechQuestsAddon.data.quest = {};
CzechQuestsAddon.data.item = {};
CzechQuestsAddon.data.speech = {}
2024-08-25 11:50:46 +02:00
-- Event handler frame
local frame = CreateFrame("Frame")
-- OnEvent function for event processing
local function OnEvent(self, event, addonName, ...)
if event == "ADDON_LOADED" and addonName == 'CzechQuests' then
-- Initialize the SavedVariables if it doesn't exist
if not CzechQuestsAddon_Store then
CzechQuestsAddon_Store = {}
end
if not CzechQuestsAddon_Store.config then
CzechQuestsAddon_Store.config = {}
end
if not CzechQuestsAddon_Store.config.DEBUG_MODE then
CzechQuestsAddon_Store.config.DEBUG_MODE = false;
end
-- Quests
if CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_ENABLED == nil then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_ENABLED = true;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_DARK_MODE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_DARK_MODE = false;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE = 18;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE = 16;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE = 14;
2024-08-25 11:50:46 +02:00
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY = 'morpheus_cz.ttf';
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY = 'frizquadratatt_cz.ttf';
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA = 80;
end
if CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING == nil then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING = true;
end
-- Speech
if CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ENABLED == nil then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ENABLED = true;
2024-08-25 11:50:46 +02:00
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE = 15;
2024-08-25 11:50:46 +02:00
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY = 'frizquadratatt_cz.ttf';
2024-08-25 11:50:46 +02:00
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH = 320;
2024-08-25 11:50:46 +02:00
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION = { x = 0, y = 0}
end
2024-08-25 11:50:46 +02:00
-- Initialize settings
CzechQuestsAddon:InitializeSettings()
2024-08-25 11:50:46 +02:00
-- Initialize Quests
CzechQuestsAddon:InitializeTranslations()
-- Unregister the ADDON_LOADED event after handling it
self:UnregisterEvent("ADDON_LOADED")
end
end
-- Register the event
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", OnEvent)