Fortunis
06-28-2011, 04:36 AM
Would it be possible for all Authors to make their main command toggle show/hide please. I feel its unnessesary to have to type more text on the command line than is necessary.
Take my plugin as an example. '/mcha' toggles mcha's option window on/off. No need for /mcha show or /mcha hide. I use '/mcha toggle' for something different (turns the functioning of the plugin on/off), but for other plugins /command toggle is used exactly as my normal '/mcha'.
Im aware that you all probably know how to change this but i thought i'd insert some code to inspire thoughs that are new to making plugins.
yourCommand = class(Turbine.ShellCommand);
Turbine.Shell.AddCommand("<Command you type, excluding slash>", yourCommand);
function yourCommand:Execute(command, arg)
if arg == "" then
if yourWindow:IsVisible(true) then
yourWindow:SetVisible( false );
yourWindow:Activate( false );
else
yourWindow:SetVisible( true );
yourWindow:Activate( true );
end
end
endThanks in advance
-Fortunis
:o
Take my plugin as an example. '/mcha' toggles mcha's option window on/off. No need for /mcha show or /mcha hide. I use '/mcha toggle' for something different (turns the functioning of the plugin on/off), but for other plugins /command toggle is used exactly as my normal '/mcha'.
Im aware that you all probably know how to change this but i thought i'd insert some code to inspire thoughs that are new to making plugins.
yourCommand = class(Turbine.ShellCommand);
Turbine.Shell.AddCommand("<Command you type, excluding slash>", yourCommand);
function yourCommand:Execute(command, arg)
if arg == "" then
if yourWindow:IsVisible(true) then
yourWindow:SetVisible( false );
yourWindow:Activate( false );
else
yourWindow:SetVisible( true );
yourWindow:Activate( true );
end
end
endThanks in advance
-Fortunis
:o