Author Topic: Gui syntax error  (Read 1760 times)

By the way, in order to make a custom MainMenuButtonsGui, you need to do this before the new GuiControl line:
MainMenuButtonsGui.delete();
I'm not 100% sure but you might need to move the GUI to a .cs file in order to do that.

No, don't do this. You should not be re-creating the entire Main Menu GUI. Here's everything that your MainMenuButtonsGui.gui file should have:

Code: [Select]
new GuiBitmapButtonCtrl(CreateAClass) {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "4 157";
extent = "102 41";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
text = "Modern Addons";
command = "canvas.pushDialog(ModernAddonsPack);";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button2";
lockAspectRatio = "0";
alignLeft = "0";
alignTop = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "255 255 255 255";
};

MainMenuButtonsGui.add(CreateAClass);

Note the name of the object: CreateAClass
Note the new command field that I added: This is what causes your GUI to open when you push the button.
Note the last line: This adds your button to the existing GUI.

Did you fix the syntax errors on these two lines already?

Code: [Select]
$remapDivison[$remapCount]="Category"
$remapName[$remapCount]="Action"



The .GUI generated by the GUI editor is just a self contained script file, for organization. You could write any code you wanted in that file and it would still compile with no errors.
You must also do $remapCount++;

You must also do $remapCount++;
When doing a remapCount, you probably want to do a check if it is already in the controls so you don't have 2 of them.

Please tell me why i cant set a button combo through options

Please tell me why i cant set a button combo through options

This code should work:
Code: [Select]
if(!$ModernAddonsPack_isKeybinds) // If the variable "$ModernAddonsPack_isKeybinds" hasn't been set to true then activate keybinds.
{
$ModernAddonsPack_isKeybinds = true;
$remapDivision[$remapCount] = "Modern Add-Ons Pack"; //The category
$remapName[$remapCount] = "Open"; //The description
$remapCmd[$remapCount] = "Open_ModernAddonsPack"; //The function when the keystroke is activated
$remapCount++;
}

If you want to add more keybinds, add this code to the same function:
Code: [Select]
$remapName[$remapCount] = "Open"; //The description
$remapCmd[$remapCount] = "Open_ModernAddonsPack"; //The function when the keystroke is activated
$remapCount++;

This code should work:
Code: [Select]
if(!$ModernAddonsPack_isKeybinds) // If the variable "$ModernAddonsPack_isKeybinds" hasn't been set to true then activate keybinds.
{
$ModernAddonsPack_isKeybinds = true;
$remapDivision[$remapCount] = "Modern Add-Ons Pack"; //The category
$remapName[$remapCount] = "Open"; //The description
$remapCmd[$remapCount] = "Open_ModernAddonsPack"; //The function when the keystroke is activated
$remapCount++;
}

If you want to add more keybinds, add this code to the same function:
Code: [Select]
$remapName[$remapCount] = "Open"; //The description
$remapCmd[$remapCount] = "Open_ModernAddonsPack"; //The function when the keystroke is activated
$remapCount++;
any specific place i put this


I'm not 100% sure but you might need to move the GUI to a .cs file in order to do that.
.cs, .gui and .mis is handled exactly the same by the engine.
« Last Edit: June 28, 2013, 11:51:59 AM by Zeblote »




console.log please?
all good but here

Client Add-Ons: Add-Ons. Client_ModernAddonsPack
Loading Addons:  Client_ModernAddonsPack
 And the execuiting addons