im looking for a way to remove the xml file and make it work in lua only any ideals?
Lua Code:
local function CreateIndexButton(indexPool)
local button = ZO_ObjectPool_CreateControl("NotebookIndex", indexPool, notebook.toc.scrollChild)
local anchorBtn = buttonCount == 1 and notebook.toc.scrollChild or indexPool:AcquireObject(buttonCount-1)
button:SetAnchor(TOPLEFT, anchorBtn, buttonCount == 1 and TOPLEFT or BOTTOMLEFT)
button:SetHorizontalAlignment(TEXT_ALIGN_LEFT)
button:SetFont("ZoFontBookPaper")
button:SetWidth(400)
button:SetNormalFontColor(0, 0, 0, 0.7)
button:SetPressedFontColor(0, 0, 0, 0.9)
button:SetMouseOverFontColor(0, 0, 0, 0.4)
button:SetClickSound()
button:SetHandler("OnClicked", function(self)
currentlyViewing = self.id
notebook.titleEdit:SetText(UnprotectText(self.data.title))
notebook.edit:SetText(UnprotectText(self.data.text))
notebook.selectedpage:ClearAnchors()
notebook.selectedpage:SetAnchorFill(self)
PlaySound(SOUNDS.BOOK_PAGE_TURN)
end)
buttonCount = buttonCount + 1
return button
end
PopulateScrollList()
if self.new then
notebook.selectedpage:SetAnchorFill(_G["NotebookIndex"..currentlyViewing])
end
Code:
<GuiXml>
<Controls>
<Button name="NotebookIndex" virtual="true" inherits="ZO_DefaultTextButton">
</Button>
</Controls>
</GuiXml>