Need help with simple function, it wont work.
Because Controls cant removed, i want to reuse them and if need more add them.
This is my function, it dont work, what ever I try. Code:
function RMM.CreateControl(iY,iX) RMM.c.map is a CT_CONTROLk, wrong type? I have also tryed: if not RMM.maps[iY][iX] then <--- everytime false And a lot other with: ==nil, ~=nil then return ........ :( |
Have you tried:
Code:
if not WINDOW_MANAGER:GetControlByName("RMM_MAPS_"..iX..iY) then |
Quote:
...... if not WINDOW_MANAGER:GetControlByName("RMM_MAPS_"..iX..iY) then <--- function expected instead of nil |
Hey, there is a mechanism for this kind of situations. It's called control pool. You take a control from the pool and when it's no longer needed you just put it back to the pool. Here is an example:
Lua Code:
Here an example XML to define you control template: Code:
<GuiXml> |
Quote:
But thanks, if no one knows how I can check the exist of my texture, I will try. I think it must be possible, to check whether the texture exist. |
Quote:
It's weird that this wouldn't work for you-- I use this all the time: Lua Code:
|
Quote:
Code:
function RMM.CreateUI() Code:
WINDOW_MANAGER:CreateControl("MODUI_TLW", GuiRoot, CT_TOPLEVEL) |
All times are GMT -6. The time now is 09:32 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI