Author Topic: Click on the brick for GUI bring up to your screen.  (Read 1525 times)

Read the Title.

Code: [Select]
registerOutputEvent(gameConnection,Namehere);

function fxDTSBrick::NameHereClient(%this,%type,%cl)
{
NameHere.GUI
}
I am not sure If this correct or not. I want know how NameHere.GUI bring to your sreen?

server-sided
Code: [Select]
registerOutputEvent(gameConnection,Namehere,"",1);

function fxDTSBrick::NameHere(%this, %cl)
{
commandtoclient(%cl, 'opendatgui');
}
client-sided
Code: [Select]
function clientcmdopendatgui()
{
//stuff that opens gui here
}
If I remember right.

server-sided
Code: [Select]
registerOutputEvent(gameConnection,Namehere,"",1);

function fxDTSBrick::NameHere(%this, %cl)
{
commandtoclient(%cl, 'opendatgui');
}
client-sided
Code: [Select]
function clientcmdopendatgui()
{
//stuff that opens gui here
}
If I remember right.
No, no. You made the event admin only and you made it a gameConnection event.
Code: [Select]
registerOutputEvent(fxDTSBrick, "NameHere", "", 0, 1);

function fxDTSBrick::NameHere(%this, %client)
{
commandToClient(%client, 'openThatGUI');
}
client-sided
Code: [Select]
function clientCmdOpenThatGUI()
{
canvas.pushDialog(SomeGUI);
}
« Last Edit: October 18, 2013, 09:11:56 AM by jes00 »

No, no. You made the event admin only and you made it a gameConnection event.

Wouldn't it make more sense as a GameConnection event? Also, stop putting so many unnecessary arguments.

Code: [Select]
registerOutputEvent("GameConnection", "openGUI");

function GameConnection::openGUI(%this) {
    commandToClient(%this, 'openGUI');
}

Wouldn't it make more sense as a GameConnection event? Also, stop putting so many unnecessary arguments.

Code: [Select]
registerOutputEvent("GameConnection", "openGUI");

function GameConnection::openGUI(%this) {
    commandToClient(%this, 'openGUI');
}
There are no unnecessary arguments if it's registered as an fxDTSBrick event (which I did). It goes registerOutputEvent(class, name, bool or string or list or whatever, adminOnly, appendToClient).
« Last Edit: October 18, 2013, 07:50:08 AM by jes00 »

There are no unnecessary arguments if it's registered as an fxDTSBrick event (which I did).

Oh yeah, appendToClient. I was a bit misleaded by how you specified a 0 on the previous argument instead of forcing default with "".

It goes registerOutputEvent(class, name, adminOnly, appendToClient).

Don't disrespect event parameters! :panda:


Code: [Select]
registerOutputEvent(fxDTSBrick, NameHere, "", 0, 1);

function fxDTSBrick::NameHere(%this, %client)
{
commandToClient(%client, 'openThatGUI');
}
client-sided
Code: [Select]
function clientCmdOpenThatGUI()
{
canvas.pushDialog(SomeGUI);
}
Okay, I will try this the code.

what exactly does 'appentToClient' do

No, no. You made the event admin only and you made it a gameConnection event.
Oops, lol.
The code I posted is total fail.

what exactly does 'appentToClient' do
It just puts the client as the last parameter. Not sure how it works with GameConnection, or any other event class than fxDTSbrick though.

Not work, Nothing.

Server_Group.zip
Sever.cs

Code: [Select]
registerOutputEvent(fxDTSBrick,"CreateGroup","", 0, 1);

function fxDTSBrick::Group(%this,%client)
{
commandToClient(%client, 'OpenGroupGUI');
}


Client_Group.zip
Client.cs
Code: [Select]
function clientCmdOpenGroupGUI()
{
canvas.pushDialog(GroupGUI);
}

GroupGUI.gui
(Create Group)
Code: [Select]
//--- OBJECT WRITE BEGIN ---
new GuiWindowCtrl(CreateGroup) {
   profile = "GuiWindowProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "250 150";
   minExtent = "8 2";
   enabled = "1";
   visible = "1";
   clipToParent = "1";
   text = "Create Group";
   maxLength = "255";
   resizeWidth = "0";
   resizeHeight = "0";
   canMove = "1";
   canClose = "1";
   canMinimize = "0";
   canMaximize = "0";
   minSize = "50 50";

   new GuiBitmapButtonCtrl(CreateButton) {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "top";
      position = "154 106";
      extent = "91 38";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      text = "Done";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button2";
      lockAspectRatio = "0";
      alignLeft = "0";
      alignTop = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
         hasUpdated = "1";
   };
   new GuiTextEditCtrl(TextBox) {
      profile = "GuiTextEditProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "11 52";
      extent = "227 23";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      maxLength = "255";
      historySize = "0";
      password = "0";
      tabComplete = "0";
      sinkAllKeyEvents = "0";
   };
   new GuiTextCtrl() {
      profile = "GuiTextProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "62 30";
      extent = "119 18";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      text = "Create your Group name";
      maxLength = "255";
   };
};
//--- OBJECT WRITE END ---

you use canvas.pushDialog(GroupGUI);
but your gui is called CreateGroup

you use canvas.pushDialog(GroupGUI);
but your gui is called CreateGroup
And the in the server sided part, the function name is different from the event name.

you use canvas.pushDialog(GroupGUI);
but your gui is called CreateGroup
And the in the server sided part, the function name is different from the event name.
I did fixed all of them, It still not work Bring the GUI at my screen.

Fixed the script
Sever.cs
Code: [Select]
registerOutputEvent(fxDTSBrick,"CreateGroup","", 0, 1);
function fxDTSBrick::Group(%this,%client)
{
commandToClient(%client,'OpenGroupNaGUI');
}

Client.cs
Code: [Select]
function clientCmdOpenGroupNaGUI()
{
canvas.pushDialog(CreateGroupName);
}

GroupGUI.gui
Code: [Select]
//--- OBJECT WRITE BEGIN ---
new GuiWindowCtrl(CreateGroupName) {
   profile = "GuiWindowProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "250 150";
   minExtent = "8 2";
   enabled = "1";
   visible = "1";
   clipToParent = "1";
   text = "Create Group";
   maxLength = "255";
   resizeWidth = "0";
   resizeHeight = "0";
   canMove = "1";
   canClose = "1";
   canMinimize = "0";
   canMaximize = "0";
   minSize = "50 50";

   new GuiBitmapButtonCtrl(CreateButton) {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "top";
      position = "154 106";
      extent = "91 38";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      text = "Done";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button2";
      lockAspectRatio = "0";
      alignLeft = "0";
      alignTop = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
         hasUpdated = "1";
   };
   new GuiTextEditCtrl(TextBox) {
      profile = "GuiTextEditProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "11 52";
      extent = "227 23";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      maxLength = "255";
      historySize = "0";
      password = "0";
      tabComplete = "0";
      sinkAllKeyEvents = "0";
   };
   new GuiTextCtrl() {
      profile = "GuiTextProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "62 30";
      extent = "119 18";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      text = "Create your Group name";
      maxLength = "255";
   };
};
//--- OBJECT WRITE END ---
jes00, I am going upload my mod to you will check your PM soon.
EDIT: Sent.
« Last Edit: October 19, 2013, 10:27:29 AM by Furling² »

registerOutputEvent(fxDTSBrick,"CreateGroup","", 0, 1);
function fxDTSBrick::Group(%this,%client)
{
   commandToClient(%client,'OpenGroupNaGUI');
}


it should be fxDTSBrick::CreateGroup