ff_u_con_help

Register the “help” console command.

On “help”, send a ON_CONSOLE_COMMAND_HELP event. This is different than what ON_CONSOLE_COMMAND__HELP would be if registering the keyword help was done in a standard script.

Variables

ENABLE__FF_U_CON_HELP: (string) (opt-out) Set to “N” on module disable unit.

Source code

// @code


#include "ff_i_core"


const string ENABLE__FF_U_CON_HELP = "ENABLE__FF_U_CON_HELP";


// -----------------------------------------------------------------------------

void main()
{
  if (!GetModuleFlag(ENABLE__FF_U_CON_HELP, TRUE))
    return;

  string sEvent = GetCurrentEvent();
  if (sEvent == ON_REGISTER)
    RegisterConsoleCommand("help", __FILE__);
  else if (sEvent == GetConsoleEventName("help"))
  {
    string sCommand = GetStringTrim(GetLocalString(GetModule(), CONSOLE_COMMAND));
    if (sCommand == "help")
      NWNX_Events_SignalEvent(ON_CONSOLE_COMMAND_HELP, GetModule());
  }
}