---@class GW2
local GW = select(2, ...)
local L = GW.L

local function LoadSkinsPanel(sWindow)
    local p = CreateFrame("Frame", nil, sWindow, "GwSettingsPanelTmpl")
    p.panelId = "skins_general"
    p.header:SetFont(DAMAGE_TEXT_FONT, 20)
    p.header:SetTextColor(GW.Colors.TextColors.LightHeader:GetRGB())
    p.header:SetText(L["Skins"])
    p.sub:SetFont(UNIT_NAME_FONT, 12)
    p.sub:SetTextColor(181 / 255, 160 / 255, 128 / 255)
    p.sub:SetText(L["Adjust Skin settings."])

    p:AddOption(COOLDOWN_VIEWER_LABEL, nil, {getterSetter = "CooldownManagerSkinEnabled", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Alert Frames"], nil, {getterSetter = "ALERTFRAME_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = GW.Classic or GW.TBC or GW.Wrath})
    p:AddOption(MAINMENU_BUTTON, nil, {getterSetter = "MAINMENU_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(L["Popup notifications"], nil, {getterSetter = "STATICPOPUP_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(SHOW_BATTLENET_TOASTS, nil, {getterSetter = "BNTOASTFRAME_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(DEATH_RECAP_TITLE, nil, {getterSetter = "DEATHRECAPFRAME_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption("Drop-Down", nil, {getterSetter = "DROPDOWN_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(L["Looking for Group notifications"], nil, {getterSetter = "LFG_FRAMES_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(READY_CHECK, nil, {getterSetter = "READYCHECK_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(L["Talking Head"], nil, {getterSetter = "TALKINGHEAD_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Misc Frames"], nil, {getterSetter = "MISC_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(QUEST_LOG, nil, {getterSetter = "QUESTLOG_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = GW.Retail})
    p:AddOption(FLIGHT_MAP, nil, {getterSetter = "FLIGHTMAP_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(ADDON_LIST, nil, {getterSetter = "ADDONLIST_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(MACRO, nil, {getterSetter = "MACRO_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(MINIMAP_TRACKING_MAILBOX, nil, {getterSetter = "MAIL_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = GW.Classic or GW.TBC or GW.Wrath})
    p:AddOption(BARBERSHOP, nil, {getterSetter = "BARBERSHOP_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(INSPECT, nil, {getterSetter = "INSPECTION_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = GW.Classic or GW.TBC or GW.Wrath})
    p:AddOption(DRESSUP_FRAME, nil, {getterSetter = "DRESSUP_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(HELP_FRAME_TITLE, nil, {getterSetter = "HELPFRAME_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(L["Socket Frame"], nil, {getterSetter = "SOCKET_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(WORLDMAP_BUTTON, nil, {getterSetter = "WORLDMAP_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(L["BG Map"], nil, {getterSetter = "BattlefieldMapSkinEnabled", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Gossip Frame"], nil, {getterSetter = "GOSSIP_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(ITEM_UPGRADE, nil, {getterSetter = "ITEMUPGRADE_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(TIMEMANAGER_TITLE, nil, {getterSetter = "TIMEMANAGER_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(MERCHANT, nil, {getterSetter = "MERCHANT_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(QUEST_TIMERS, nil, {getterSetter = "QUESTTIMERS_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = GW.Retail})
    p:AddOption(ADVENTURE_JOURNAL, nil, {getterSetter = "ENCOUNTER_JOURNAL_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(COVENANT_SANCTUM_TAB_UPGRADES, nil, {getterSetter = "CONCENANT_SANCTUM_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(COVENANT_PREVIEW_SOULBINDS, nil, {getterSetter = "SOULBINDS_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Chromie Time Frame"], nil, {getterSetter = "CHROMIE_TIME_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Allied Races"], nil, {getterSetter = "ALLIEND_RACES_UI_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(PVP_WEEKLY_REWARD, nil, {getterSetter = "WEEKLY_REWARDS_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(LFG_TITLE, nil, {getterSetter = "LFG_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Garrison"], nil, {getterSetter = "ORDERRHALL_TALENT_FRAME_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Loot Frame"], nil, {getterSetter = "LOOTFRAME_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end})
    p:AddOption(ACHIEVEMENTS, nil, {getterSetter = "ACHIEVEMENT_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, incompatibleAddons = "AchievementSkin", hidden = not GW.Retail})
    p:AddOption(L["Trading post"], nil, {getterSetter = "PERK_PROGRAM_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Expansion Landing Page"], nil, {getterSetter = "EXPANSION_LANDING_PAGE_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Generic Trait"], nil, {getterSetter = "GENERIC_TRAINT_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(ADVENTURE_MAP_TITLE, nil, {getterSetter = "ADVENTURE_MAP_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(TALENTS, nil, {getterSetter = "PLAYER_SPELLS_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(AUCTIONS, nil, {getterSetter = "AuctionHouseSkinEnabled", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(L["Major Factions"], nil, {getterSetter = "MajorFactionSkinEnabled", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(GW.NewSign .. (DAMAGE_METER_LABEL or ""), nil, {getterSetter = "DamageMeterSkinEnabled", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption(GW.NewSign .. L["Calendar"], nil, {getterSetter = "CalendarSkinEnabled", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})

    p:AddOption("|cffaaaaaa[AddOn]|r World Quest Tracker", nil, {getterSetter = "SKIN_WQT_ENABLED", callback = function() GW.ShowRlPopup = true end, dependence = {["QUESTTRACKER_ENABLED"] = true}, incompatibleAddons = "Objectives", hidden = not GW.Retail})
    p:AddOption("|cffaaaaaa[AddOn]|r Immersion", nil, {getterSetter = "IMMERSIONADDON_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})
    p:AddOption("|cffaaaaaa[AddOn]|r PetTracker", nil, {getterSetter = "SKIN_PETTRACKER_ENABLED", callback = function() GW.ShowRlPopup = true end, dependence = {["QUESTTRACKER_ENABLED"] = true}, incompatibleAddons = "Objectives", hidden = not GW.Retail})
    p:AddOption("|cffaaaaaa[AddOn]|r Auctionator", nil, {getterSetter = "AUCTIONATOR_SKIN_ENABLED", callback = function() GW.ShowRlPopup = true end, dependence = {["AuctionHouseSkinEnabled"] = true, hidden = not GW.Retail}})
    p:AddOption("|cffaaaaaa[AddOn]|r Todoloo", nil, {getterSetter = "SKIN_TODOLOO_ENABLED", callback = function() GW.ShowRlPopup = true end, hidden = not GW.Retail})

    sWindow:AddSettingsPanel(p, L["Skins"], L["Adjust Skin settings."])
end
GW.LoadSkinsPanel = LoadSkinsPanel
