if(isObject(Button_FillCan)) Button_FillCan.position = "205 232";if(isObject(Button_Duplicator)) Button_Duplicator.position = "205 192";%fetchAllButton = new GuiBitmapButtonCtrl(Button_FetchAll){ profile = "BlockButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "205 172"; extent = "99 19"; minExtent = "8 2"; visible = "1"; command = "adminGui::FetchAll();"; text = "Fetch All"; groupNum = "-1"; buttonType = "PushButton"; bitmap = "base/client/ui/button1"; lockAspectRatio = "0"; alignLeft = "0"; overflowImage = "0"; mKeepCached = "0"; mColor = "255 255 255 255";};adminGui.add(%fetchAllButton);
adminGui.FetchAll();
What?
So, the button doesn't appear on the admin GUI? In any case, you shouldn't use local variables outside function scope. If you do that and then execute the add-on through the console window (not in-game), the game will crash.
$FetchAllButton = new GuiBitmapButtonCtrl(Button_FetchAll){ profile = "BlockButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "205 172"; extent = "99 19"; minExtent = "8 2"; visible = "1"; command = "adminGui::FetchAll();"; text = "Fetch All"; groupNum = "-1"; buttonType = "PushButton"; bitmap = "base/client/ui/button1"; lockAspectRatio = "0"; alignLeft = "0"; overflowImage = "0"; mKeepCached = "0"; mColor = "255 255 255 255";};adminGui.add($FetchAllButton);
You don't need to set a variable for it (just use adminGui.add( Button_FetchAll );). Why it isn't appearing in the first case I currently can't see.
The name of the window is not "GuiWindowControl". Just look in the GUI to find the name of the window.If it doesn't have a name, adminGUI.getObject( 0 ).add( button_fetchAll ); should work.
adminGUI.getObject(9).position = "209 134";Set::getObject index out of range on adminGui. Index = 9, Size = 1