GUI key binding.

Author Topic: GUI key binding.  (Read 681 times)

I am trying to find a way to bind  a GUI to a key to pop it up. The GUI is compleate but unable to be used because I can not get the script I am using to work. Here is what I have so far. It is barrowed from Eph's Macro saver.

Code: [Select]
if (!$addedtoolkeys)
{
$remapDivision[$remapCount] = "Tool Prompt";
$remapName[$remapCount] = "Toggle Tool Prompt";
$remapCmd[$remapCount] = "toggleToolWindow";
$remapCount++;
$addedtoolkeys = true;
}

function toggleToolWindow(%val)
{
if(%val)
if(macroGui.isAwake())
canvas.popdialog(Tool_prompt);
else
canvas.pushdialog(Tool_prompt);
}
I am not sure if it is compleat or even correct.

if (!$addedtoolkeys)
{
   $remapDivision[$remapCount] = "Tool Prompt";
   $remapName[$remapCount] = "Toggle Tool Prompt";
   $remapCmd[$remapCount] = "toggleToolWindow";
   $remapCount++;
   $addedtoolkeys = true;
}

function toggleToolWindow(%val)
{
   if(%val)
      if(macroGui.isAwake())
         canvas.popdialog(Tool_prompt);
      else
         canvas.pushdialog(Tool_prompt);
}

I fixed that but the problem persist.

Code: [Select]
if (!$addedtoolkeys)
{
$remapDivision[$remapCount] = "Tool Prompt";
$remapName[$remapCount] = "Toggle Tool Prompt";
$remapCmd[$remapCount] = "toggleToolWindow";
$remapCount++;
$addedtoolkeys = true;
}

function toggleToolWindow(%val)
{
if(%val)
if(toolpromptGUI.isAwake())
canvas.popdialog(toolpromptGUI);
else
canvas.pushdialog(toolpromptGUI);
}

Does ToolPromptGUI exist in-game? (Are you executing the .gui file or including the script there in toolpromptgui.cs?)

Code: [Select]
Add-Ons/Client/toolpromptGUI.cs (13): Unable to find object: 'toolpromptGUI' attempting to call function 'isAwake'
popDialog(): Invalid control: toolpromptGUI

]if (!$addedtoolkeys)
{
   $remapDivision[$remapCount] = "Tool Prompt";
   $remapName[$remapCount] = "Toggle Tool Prompt";
   $remapCmd[$remapCount] = "toggleToolWindow";
   $remapCount++;
   $addedtoolkeys = true;
}

function toggleToolWindow(%val)
{
   if(%val)
     {
      if(macroGui.isAwake())
         canvas.popdialog(Tool_prompt);
      else
         canvas.pushdialog(Tool_prompt);
     }
}
There's a small problem, but I'd still have to say that one of your GUI's isn't existant.

Those brackets aren't actually needed here, but they can make it more readable.