Originally Posted by Letho
Virtual controls DO NOT call <OnInitialized> though, each child control of a virtual has to call the <OnInitialized> functions seperately. That is very strange...
|
Here is an example of adding a new control to the pool and hiding the existing one.
<OnInitialized> is called once when an object is created, any global function or Lua code can be placed here.
Xml Code:
<GuiXml>
<Controls>
<Control name="IG_PlayerInventorySlot" inherits="ZO_PlayerInventorySlot" virtual="true">
<Controls>
<Label name="$(parent)Name" hidden="true" override="true" />
<Backdrop name="$(parent)Backdrop" inherits="ZO_CenterlessBackdrop" tier="LOW" layer="BACKGROUND" hidden="false" override="true">
<Edge file="InventoryGrid/Textures/border3.dds" edgeFileWidth="128" edgeFileHeight="16" />
<Center file="InventoryGrid/Textures/bg3.dds" />
<OnInitialized>
self:SetCenterColor(1, 1, 1, 1)
self:SetEdgeColor(1, 1, 1, 1)
</OnInitialized>
</Backdrop>
</Controls>
</Control>
</Controls>
</GuiXml>