local _, core = ...; -- Namespace

local AceGUI = LibStub("AceGUI-3.0")


function core.EnchantingLevellingLegion(container)


--[[
local ChaosCrystal = TSM_API.GetCustomPriceValue("dbmarket","i:124442")*210
local Arkhana = TSM_API.GetCustomPriceValue("dbmarket","i:124440")*1500
local LeylightShard = TSM_API.GetCustomPriceValue("dbmarket","i:124441")*50


Add1 = ChaosCrystal + Arkhana
Add2 = Add1 + LeylightShard



local Item = TSM_API.FormatMoneyString(Add2)

--]]


--[[ Scroll Frame ]]--
local scrollcontainer = AceGUI:Create("SimpleGroup") 
scrollcontainer:SetFullWidth(true)
scrollcontainer:SetFullHeight(true) 
scrollcontainer:SetLayout("Fill") 

container:AddChild(scrollcontainer)

local scroll = AceGUI:Create("ScrollFrame")
scroll:SetLayout("Flow") 
scrollcontainer:AddChild(scroll)
  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)  
  
  --[[ Material List ]]--
  local desc = AceGUI:Create("Label")  
  desc:SetText("|cff00C78CMaterial List:")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)
  
  
  

  local desc = AceGUI:Create("Label")
  desc:SetText("1. Chaos Crystal".." - ".."210")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)

  local desc = AceGUI:Create("Label")
  desc:SetText("2. Arkhana".." - ".."1500")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
    local desc = AceGUI:Create("Label")
  desc:SetText("3. Leylight Shard".." - ".."50")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  


--[[ Estimated Cost ]]--  

  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space) 

if (IsAddOnLoaded("TradeSkillMaster")) then 
local ChaosCrystal = TSM_API.GetCustomPriceValue("dbmarket","i:124442")*210
local Arkhana = TSM_API.GetCustomPriceValue("dbmarket","i:124440")*1500
local LeylightShard = TSM_API.GetCustomPriceValue("dbmarket","i:124441")*50


Add1 = ChaosCrystal + Arkhana
Add2 = Add1 + LeylightShard



local Item = TSM_API.FormatMoneyString(Add2)

  local desc = AceGUI:Create("Label")  
  desc:SetText("|cff00C78CEstimated Cost: ".."|cffffffff"..Item)
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)

  else
  
  		  local desc = AceGUI:Create("Label")
		  desc:SetText("|cffff6060Estimated Cost:".."|cffffffff TradeSkillMaster Not Installed For Estimated Cost")
		  desc:SetFullWidth(true)
		  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
		  scroll:AddChild(desc)
  
  
  
  
end   

  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)


--[[ Trainer ]]-- 


if (IsAddOnLoaded("TomTom")) then  
  local ShadowlandsWaypoint = AceGUI:Create("Button")
  ShadowlandsWaypoint:SetText("Trainer Waypoint - Dalaran")
  ShadowlandsWaypoint:SetWidth(350)
  scroll:AddChild(ShadowlandsWaypoint)
  ShadowlandsWaypoint:SetCallback("OnClick", function() 

DEFAULT_CHAT_FRAME.editBox:SetText("/way 39.6 41.2") ChatEdit_SendText(DEFAULT_CHAT_FRAME.editBox, 0)
  
  end)

		else
		
		  local desc = AceGUI:Create("Label")
		  desc:SetText("|cffff6060Waypoint:".."|cffffffff TomTom Not Installed For Waypoint")
		  desc:SetFullWidth(true)
		  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
		  scroll:AddChild(desc)
  
  
  
end


--[[ Levelling ]]--
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)

  local desc = AceGUI:Create("Label")
  desc:SetText("|cff00C78CStep 1:".."|cffffffff 1 - 25")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)

  local desc = AceGUI:Create("Label")
  desc:SetText("50x Ley Shatter")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)

  local desc = AceGUI:Create("Label")
  desc:SetText("|cff00C78CStep 2:".."|cffffffff 25 - 70")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)

  local desc = AceGUI:Create("Label")
  desc:SetText("60x Chaos Shatter")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
    local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)

  local desc = AceGUI:Create("Label")
  desc:SetText("|cff00C78CStep 3:".."|cffffffff 70 - 100")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)

  local desc = AceGUI:Create("Label")
  desc:SetText("30x Rank 3 - Binding of Mastery")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
  local Space = AceGUI:Create("Label")
  Space:SetText("  ")
  Space:SetFullWidth(true)
  scroll:AddChild(Space)

  local desc = AceGUI:Create("Label")
  desc:SetText("|cff00C78CNote:".."|cffffffff Legion Questline Required To Learn")
  desc:SetFullWidth(true)
  desc:SetFont("Fonts\\FRIZQT__.TTF", 13, '')
  scroll:AddChild(desc)
  
  
  
  
  
  
  
  
  
end