Originally Posted by Roupine
Have you redefined WINDOW_MANAGER somewhere? If WINDOW_MANAGER:GetControlByName() doesn't work, neither should WINDOW_MANAGER:CreateControl()
It's weird that this wouldn't work for you-- I use this all the time:
Lua Code:
tlw = WINDOW_MANAGER:GetControlByName("MODUI_TLW") if(not tlw) then -- GetControlByName() returns nil if Control does not exist tlw = WINDOW_MANAGER:CreateControl("MODUI_TLW", GuiRoot, CT_TOPLEVEL) end
|
Dont think so.
Code:
function RMM.CreateUI()
--main
RMM.c = WINDOW_MANAGER:CreateTopLevelWindow("RMM_root")
RMM.c:SetDimensions(256,256)
RMM.c:SetAnchor(TOPLEFT,GuiRoot,TOPLEFT,100,100)
RMM.c:SetHidden(false)
RMM.c:SetMovable(true)
RMM.c:SetMouseEnabled(true)
RMM.c:SetClampedToScreen(true)
--overlay
RMM.c.overlay = WINDOW_MANAGER:CreateControl("RMM_overlay", RMM.c, CT_TEXTURE)
RMM.c.overlay:SetTexture("RadarMiniMap/textures/rad.dds")
RMM.c.overlay:SetAnchorFill(RMM.c)
RMM.c.overlay:SetDrawLayer(3)
--nord
RMM.c.nord = WINDOW_MANAGER:CreateControl("RMM_nord", RMM.c, CT_TEXTURE)
RMM.c.nord:SetTexture("RadarMiniMap/textures/nor.dds")
RMM.c.nord:SetAnchorFill(RMM.c)
RMM.c.nord:SetDrawLayer(4)
--scroll
RMM.c.sc = WINDOW_MANAGER:CreateControl("RMM_scroll", RMM.c, CT_SCROLL)
RMM.c.sc:SetAnchorFill(RMM.c)
--map
RMM.c.map = WINDOW_MANAGER:CreateControl("RMM_map", RMM.c, CT_CONTROL)
RMM.c.map:SetAnchor(TOPLEFT, RMM.c, TOPLEFT, 0,0)
end
There is a opposit between our code:
Code:
WINDOW_MANAGER:CreateControl("MODUI_TLW", GuiRoot, CT_TOPLEVEL)
WINDOW_MANAGER:CreateTopLevelWindow("RMM_root")
Is that the problem?