Blockland Forums > Modification Help
GUI Modifying Help [Solved by Port!]
Nexus:
I never do this kind of stuff, but I am pretty sure it is because :: are for class functions, and admin gui is an object and not a class. Therefore admingui.fetchall(); would be better.
I personally would do admingui_fetchall(); and not bother with what object the function is being called on or what class it is. I have always seemed to screw that stuff up.
Port:
The following is fully valid code:
wandImage::onFire( magicWandImage );
If you call something using the '::' namespace, the only difference is that you have to specify the object itself (allows you to utilize one object type's functions on something else). You have to be careful though, the original function may depend on the object existing in a specific way.
jes00:
Ok I changed the command name to adminGui_FetchAll() (I changed the command called with the fetch all button to this too) but it still does not work. When I look at the GUI the buttons are still in the same position and the fetch all button does not exist.
Port:
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.
jes00:
--- Quote from: Port on January 20, 2012, 07:53:01 AM ---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.
--- End quote ---
No it does not. Should I do this?
--- Code: ---$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);
--- End code ---