local _, app = ...;
local L, settings = app.L, app.Settings;

-- Settings: Commands Page
local child = settings:CreateOptionsPage(L.COMMANDS_PAGE, L.FEATURES_PAGE)

-- CONTENT
local headerCommands = child:CreateHeaderLabel(L.COMMANDS_HEADER_LABEL)
if child.separator then
	headerCommands:SetPoint("TOPLEFT", child.separator, "BOTTOMLEFT", 8, -8);
else
	headerCommands:SetPoint("TOPLEFT", child, "TOPLEFT", 8, -8);
end

local textCommands1 = child:CreateTextLabel(L.COMMANDS_PART_1)
textCommands1:SetPoint("TOPLEFT", headerCommands, "BOTTOMLEFT", 0, -8)
textCommands1:SetWidth(textCommands1:GetUnboundedStringWidth())
local textCommands2 = child:CreateTextLabel(L.COMMANDS_PART_2)
textCommands2:SetPoint("TOPLEFT", headerCommands, "BOTTOMLEFT", 0, -28)
textCommands2:SetWidth(textCommands2:GetUnboundedStringWidth())

local textIndex1 = 7
local function CreateText1(description)
	local text = child:CreateFontString("ARTWORK", nil, "GameFontNormal")
	text:SetFont("Fonts\\FRIZQT__.TTF", 12, "")
	text:SetPoint("TOPLEFT", child, "TOPLEFT", 13, textIndex1 * -20)
	textIndex1 = textIndex1 + 1
	text:SetText("|cffFFFFFF" .. description)
end
local textIndex2 = 7
local function CreateText2(description)
	local text = child:CreateFontString("ARTWORK", nil, "GameFontNormal")
	text:SetFont("Fonts\\FRIZQT__.TTF", 12, "")
	text:SetPoint("TOPLEFT", child, "TOPLEFT", 313, textIndex2 * -20)
	textIndex2 = textIndex2 + 1
	text:SetText("|cffFFFFFF" .. description)
end
local textIndex3 = 7
local function CreateText3(description)
	local text = child:CreateFontString("ARTWORK", nil, "GameFontNormal")
	text:SetFont("Fonts\\FRIZQT__.TTF", 12, "")
	text:SetPoint("TOPLEFT", child, "TOPLEFT", 123, textIndex3 * -20)
	textIndex3 = textIndex3 + 1
	text:SetText("|cff00FF98" .. description)
end
local textIndex4 = 7
local function CreateText4(description)
	local text = child:CreateFontString("ARTWORK", nil, "GameFontNormal")
	text:SetFont("Fonts\\FRIZQT__.TTF", 12, "")
	text:SetPoint("TOPLEFT", child, "TOPLEFT", 433, textIndex4 * -20)
	textIndex4 = textIndex4 + 1
	text:SetText("|cff00FF98" .. description)
end

-- TODO: Localize this
CreateText1(L.ACHIEVEMENT)
CreateText1(L.ARTIFACT)
CreateText1(L.AZERITE_ESSENCE)
CreateText1(L.BATTLE_PET)
CreateText1(L.CATEGORY)
CreateText1(L.CLASSES)
CreateText1(L.CONDUIT)
CreateText1(L.CREATURE)
CreateText1(L.CRITERIA)
CreateText1(L.CURRENCY)
CreateText1(L.DECOR)
CreateText1(L.DIFFICULTY)
CreateText1(L.ENCOUNTER)
--CreateText1("Event")	-- TODO: Does not work currently
CreateText1(L.EXPANSION)
CreateText1(L.EXPLORATION)
CreateText1(L.FACTION)
CreateText1(L.FLIGHT_PATHS)

CreateText2(L.FOLLOWER)
CreateText2(L.HEADER)
CreateText2(L.HEIRLOOM)
CreateText2(L.ILLUSION)
--CreateText2("Instance")	-- TODO: Does not work currently
CreateText2(L.ITEM)
CreateText2(L.MAP)
CreateText2(L.MOUNT_SPELL)
CreateText2("Npc")
CreateText2(L.OBJECT)
CreateText2(L.PROFESSION)
CreateText2(L.QUEST)
CreateText2(L.RECIPE_SPELL)
CreateText2(L.RUNECARVING_POWER)
CreateText2(L.SOURCES)
CreateText2(L.SPELL)
CreateText2(L.TITLE_COMMANDS_UI)
CreateText2(L.TOY_ITEM)

CreateText3("/att achievement:ID")
CreateText3("/att artifact:ID")
CreateText3("/att azeriteessence:ID")
CreateText3("/att battlepet:ID")
CreateText3("/att category:ID")
CreateText3("/att class:ID")
CreateText3("/att conduit:ID")
CreateText3("/att creature:ID")
CreateText3("/att criteriaid:ID")	-- TODO: Change once the non-ID version works
CreateText3("/att currency:ID")
CreateText3("/att decor:ID")
CreateText3("/att difficulty:ID")
CreateText3("/att encounter:ID")
--CreateText3("/att event:ID")	-- TODO: Does not work currently
CreateText3("/att expansion:ID")
CreateText3("/att exploration:ID")
CreateText3("/att faction:ID")
CreateText3("/att flightpath:ID")

CreateText4("/att follower:ID")
CreateText4("/att header:ID")
CreateText4("/att heirloomid:ID")	-- TODO: Change once the non-ID version works
CreateText4("/att illusion:ID")
--CreateText4("/att instanceid:ID")	-- TODO: Change once the non-ID version works
CreateText4("/att item:ID")
CreateText4("/att map:ID")
CreateText4("/att mount:ID")
CreateText4("/att npc:ID")
CreateText4("/att object:ID")
CreateText4("/att profession:ID")
CreateText4("/att quest:ID")
CreateText4("/att recipe:ID")
CreateText4("/att runeforgepower:ID")
CreateText4("/att source:ID")
CreateText4("/att spell:ID")
CreateText4("/att title:ID")
CreateText4("/att toy:ID")
