Jump to content

Gametsctrl command not working


Code_Man

Recommended Posts

Quick question quick, im trying to setup a gametsctrl with a custom command, the ui loads just fine but nothing happens.

Here is the code so you can see for yourself, im at the end of my wits here and have no idea how to go about this, any help would be appreciated.

[code]

function clientCmdOpenCommanderWindow(%obj)
{
   make_command(%obj);
   clientCmdOpenCommandBar(%obj, "x y z", 'LOL');
}

function make_command(%this)
{
   %w = 200;
   %extent = Canvas.getExtent();
   %cb = new GameTSCtrl(CommandWindow) {
      canSaveDynamicFields = "0";
      Enabled = "1";
      isContainer = "1";
      Profile = "GuiModelessDialogProfile";
      HorizSizing = "center";
      VertSizing = "center";
      Position = "0 0";
      Extent = %extent;
      MinExtent = %extent;
      canSave = "1";
      command = "on_click";
      cameraZRot = 0;
      forceFov = false;
      Visible = true;
      tooltipprofile = "GuiToolTipProfile";
      hovertime = "1000";
   };
   Canvas.setContent(%cb);
   return %cb;
}

function on_click(%this, %buttons, %callback, %buttonSize)
{
   echo("on_click");//project("0 0 0");getWorldToScreenScale();
}

function CommandWindow::onAction(%this, %e)
{
   echo("onAction");//project("0 0 0");getWorldToScreenScale();
}[/code]

Link to comment
Share on other sites

Posted (edited)

Thank you very much for your help, it took me some time till i figured it out now and i think it should work, i will see where this goes.

Edit: Changed whole post.

 

Edited by Code_Man
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...