Code_Man Posted August 12 Share Posted August 12 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] Quote Link to comment Share on other sites More sharing options...
Azaezel Posted August 14 Share Posted August 14 https://github.com/TorqueGameEngines/Torque3D/blob/2bbd5db7672103d049312b4ef4d7dbbde296f23f/Templates/BaseGame/game/data/UI/scripts/profiles.tscript#L19 that particular guiprofile sets an element to skip receiving clicks Quote Link to comment Share on other sites More sharing options...
Code_Man Posted August 15 Author Share Posted August 15 (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 August 15 by Code_Man Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.