当前位置: 首页>>代码示例>>C++>>正文


C++ AddCommand函数代码示例

本文整理汇总了C++中AddCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ AddCommand函数的具体用法?C++ AddCommand怎么用?C++ AddCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AddCommand函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ModuleBase

	ModuleInput::ModuleInput() : ModuleBase("Input")
	{
		VarInputRawInput = AddVariableInt("RawInput", "rawinput", "Enables raw mouse input with no acceleration applied", eCommandFlagsArchived, 1, VariableInputRawInputUpdate);
		VarInputRawInput->ValueIntMin = 0;
		VarInputRawInput->ValueIntMax = 1;

		AddCommand("Bind", "bind", "Binds a command to a key", eCommandFlagsNone, CommandBind, { "key", "[+]command", "arguments" });
		Patches::Input::RegisterDefaultInputHandler(KeyboardUpdated);

		AddCommand("UIButtonPress", "ui_btn_press", "Emulates a gamepad button press on UI menus", eCommandFlagsNone, CommandUIButtonPress, { "btnCode The code of the button to press" });

		CommandBindControllerAction = AddCommand("ControllerAction", "controller", "Binds an in-game action to a controller button", eCommandFlagsNone, ::CommandBindControllerAction, { "action The name of the action to bind", "button The button name" });
		CommandBindKeyboardAction = AddCommand("KeyboardAction", "keyboard", "Binds an in-game action to keyboard keys or mouse buttons", eCommandFlagsNone, ::CommandBindKeyboardAction, { "action The name of the action to bind", "[primary] The primary key name", "[secondary] The secondary key name" });

#ifdef _DEBUG
		AddCommand("DebugBindings", "debugbindings", "Dumps the input bindings table", eCommandFlagsNone, CommandDumpBindings);
#endif

		VarControllerSensitivityX = AddVariableFloat("ControllerSensitivityX", "xsens", "Horizontal controller look sensitivity", eCommandFlagsArchived, 120, VariableControllerSensitivityXUpdated);
		VarControllerSensitivityY = AddVariableFloat("ControllerSensitivityY", "ysens", "Vertical controller look sensitivity", eCommandFlagsArchived, 60, VariableControllerSensitivityYUpdated);

		LoadDefaultBindings();
		BuildSettingsMenu();

		// Default command bindings (TODO: port bind saving code from recode)
		commandBindings[eKeyCodeA].command = { "ui_btn_press", "0" };      // A
		commandBindings[eKeyCodeB].command = { "ui_btn_press", "1" };      // B
		commandBindings[eKeyCodeEnd].command = { "ui_btn_press", "1" };    // B
		commandBindings[eKeyCodeHome].command = { "ui_btn_press", "2" };   // X
	}
开发者ID:RabidSquabbit,项目名称:ElDorito,代码行数:30,代码来源:ModuleInput.cpp

示例2: InitializePlugin

// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
	bzsrchhandle = CreateMutex(NULL, FALSE, NULL);
    DebugSpewAlways("Initializing MQ2Bzsrch");

    LoadMQ2Plugin("MQ2ItemDisplay");
    HMODULE h = LoadLibrary("MQ2ItemDisplay.dll");
    if (!h) {
        pg_Item = NULL;
    }
    else {
        pg_Item = (ITEMINFO *)GetProcAddress(h, "g_Item");
    }
    FreeLibrary(h);

    // Add commands, macro parameters, hooks, etc.
    AddCommand("/bzsrch",BzSrchMe);
    AddCommand("/breset",BzSrchMe);
    AddCommand("/mq2bzsrch",MQ2BzSrch);
    //AddCommand("/pricecheck",bzpc);
    AddMQ2Data("Bazaar",dataBazaar);              // cc - added, but not using TLO yet

    EzDetour(CBazaarSearchWnd__HandleBazaarMsg,&BzSrchHook::BzDetour,&BzSrchHook::BzTrampoline);
    pBazaarType = new MQ2BazaarType;
    pBazaarItemType = new MQ2BazaarItemType;
}
开发者ID:TheTypoMaster,项目名称:macroquest2,代码行数:27,代码来源:MQ2Bzsrch.cpp

示例3: InitPlugin

int InitPlugin(void)
{
	if(Inited == TRUE)
		return FALSE;

	Inited = TRUE;

	AddCommand("info", Command_Info);
	AddCommand("tileinfo", Command_TileInfo);

	/* not quite sure if this is needed */
	/* InitCommonControls(); */
	LayersWnd = CreateDialog(DLLInst, MAKEINTRESOURCE(DIALOG_LAYERINFO), GetMainTabWindow(), (DLGPROC)LayersDlgProc);
	PlayersWnd = CreateDialog(DLLInst, MAKEINTRESOURCE(DIALOG_PLAYERINFO), GetMainTabWindow(), (DLGPROC)PlayersDlgProc);

	if(LayersWnd == NULL || PlayersWnd == NULL)
		MBOut("INFO PLUGIN", "Could not create the dialog"); 
	else
	{
		AddTab(LayersWnd, "Layers", FALSE);
		AddTab(PlayersWnd, "Players", FALSE);
	}

	return TRUE;
}
开发者ID:byterj,项目名称:IRW_1.4,代码行数:25,代码来源:Main.c

示例4: mbInCapturePlayer

//--------------------------------------------------------------------------
/// Default constructor for NextGenLayerManager.
//--------------------------------------------------------------------------
ModernAPILayerManager::ModernAPILayerManager() :
    mbInCapturePlayer(false),
    mbTraceTriggeredFromKeypress(false),
    m_captureType(CaptureType_LinkedTrace),
    m_captureCount(1)
{
    // Command that collects a CPU and GPU trace from the same frame.
    AddCommand(CONTENT_TEXT, "FrameCaptureWithSave", "FrameCaptureWithSave", "FrameCaptureWithSave", NO_DISPLAY, NO_INCLUDE, mCmdFrameCaptureWithSave);

    // Command to set the session name
    AddCommand(CONTENT_TEXT, "SetSessionName", "SetSessionName", "SetSessionName.txt", DISPLAY, INCLUDE, mCmdSetSessionName);
    mCmdSetSessionName.SetEditableContentAutoReply(false);

    // Command to set the project name
    AddCommand(CONTENT_TEXT, "SetProjectName", "SetProjectName", "SetProjectName.txt", DISPLAY, INCLUDE, mCmdSetProjectName);
    mCmdSetProjectName.SetEditableContentAutoReply(false);

#if ENABLE_TRACE_ON_KEYPRESS
    // Bind the keyboard's keypress callback to our virtual "OnKeyPressed" function. We can override if wherever we need to use it.
    std::function<void(int, WPARAM, LPARAM)> onKeyPressedHandler =
        std::bind(&ModernAPILayerManager::OnKeyPressed, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);

    osKeyboardListener::Instance().SetOnKbPressedCallback(onKeyPressedHandler);
#endif // ENABLE_TRACE_ON_KEYPRESS
}
开发者ID:imace,项目名称:CodeXL,代码行数:28,代码来源:ModernAPILayerManager.cpp

示例5: openDoors

	DllExclusive void FactoryCommandSupplier::AddCommandsToUnit(Unit* unit)
	{
		auto commands = unit->GetCommands();
		FactoryOpenDoorsCommand* openDoors(xNew1(FactoryOpenDoorsCommand, unit));
		FactoryCloseDoorsCommand* closeDoors(xNew1(FactoryCloseDoorsCommand, unit));
		commands->AddCommand(GetTypeId<FactoryOpenDoorsCommand>(), openDoors, 0);
		commands->AddCommand(GetTypeId<FactoryCloseDoorsCommand>(), closeDoors, 0);
	}
开发者ID:KFlaga,项目名称:FlagRTS,代码行数:8,代码来源:FactorySuppliers.cpp

示例6: InitApplication

// Init this application. Register your
// commands, reactors...
void InitApplication()
{
	// NOTE: DO NOT edit the following lines.
	//{{AFX_ARX_INIT
	AddCommand("ASDK", "BLOCKVIEW", "BVIEW", ACRX_CMD_MODAL, AsdkBlockView);
	AddCommand("ASDK", "CONFIGGS", "CONFIGGS", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, AsdkConfigGS);
	//}}AFX_ARX_INIT
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:10,代码来源:BlockView.cpp

示例7: AddCommand

void CCommandSystem::RegisterCommands()
{
	AddCommand("/q", Util::Quit);

	// Funkcje do zarz¹dzania zasobami. TODO! Dodanie sprawdzania czy zasób istnieje etc.
	AddCommand("/loadresource", LoadRes);
	AddCommand("/unloadresource", UnLoadRes);
	AddCommand("/restartresource", ReStartRes);
}
开发者ID:LeeHM,项目名称:etmp,代码行数:9,代码来源:CCommandSystem.cpp

示例8: m_bEscape

mmConsole::mmClient::mmClient(std::wstring const & p_sTitle)
    : m_bEscape(false),
      m_bNavigate(false),
      m_sPositionInHistory(m_sHistory.begin()),
      m_psCommand(NULL),
      m_sPrompt(L">> "),
      m_psImageStructure(new mmImages::mmImageStructure(NULL)),
      m_psMethodsContainer(mmInterfaceInitializers::CreateDefaultImagesCalculationMethodContainer(NULL)),
      m_psCalculationManager(new mmImages::mmImagesCalculationManagement(3, NULL))
{
    ::SetConsoleTitleW(p_sTitle.c_str());

    AddCommand(new mmCommands::mmQuit());
    AddCommand(new mmCommands::mmLoad(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmSave(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmPreview(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmStructureInfo(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmImageUtils::mmRename(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmImageUtils::mmResize(m_psImageStructure.get()));
    AddCommand(new mmCommands::mmImageUtils::mmClean(m_psImageStructure.get()));

    std::vector<mmImages::mmImagesCalculationMethodI::sCalculationMethodParams> v_sMethods = m_psMethodsContainer->GetAvailableImagesCalculationMethods();
    std::map<std::wstring, std::wstring> v_sMethodFileMapping = m_psMethodsContainer->GetMethodFileMapping();
    for(std::size_t v_iI = 0; v_iI < v_sMethods.size(); ++v_iI) {
        std::wstring v_sNamespace = v_sMethodFileMapping[v_sMethods[v_iI].sIDName];
        v_sNamespace = v_sNamespace.substr(v_sNamespace.find_last_of('\\') + 1);
        v_sNamespace = v_sNamespace.substr(0, v_sNamespace.find_last_of('.'));
        AddCommand(new mmCommands::mmExternalCommand(v_sMethods[v_iI].sIDName, v_sMethods[v_iI].sCommand, v_sMethods[v_iI].sAutoParams.sInParams, m_psMethodsContainer.get(), m_psCalculationManager.get(), m_psImageStructure.get()), v_sNamespace);
    }

    std::transform(m_sCommands.begin(), m_sCommands.end(), std::back_inserter(m_sCommandNames), CommandToName<mmCommands::mmCommand*>);

    std::sort(m_sCommandNames.begin(), m_sCommandNames.end(), SortCaseInsensitive);
}
开发者ID:ogx,项目名称:Calculation2D,代码行数:34,代码来源:mmClient.cpp

示例9: InitApplication

// Init this application. Register your
// commands, reactors...
void InitApplication()
{
	// NOTE: DO NOT edit the following lines.
	//{{AFX_ARX_INIT
	AddCommand("ASDK", "MYINPUT", "MYINPUT", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, asdkmyinput);
	AddCommand("ASDK", "MYSELECT", "MYSELECT", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, asdkmyselect);
	//}}AFX_ARX_INIT

	// TODO: add your initialization functions

}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:13,代码来源:Project.cpp

示例10: wxTextCtrl

CliCtrl::CliCtrl(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, int style)
	: wxTextCtrl(parent, id, value, pos, size, style/*, wxTextValidator(wxFILTER_ALPHA)*/)
	, m_CachedCmd(10)
{
	SetBackgroundColour(wxColor("#000000"));
	SetForegroundColour(wxColor("#ffffff"));

	SetInsertionPointEnd();
	AddCommand("ls", "list files");
	AddCommand("mkdir", "create dir");
	AddCommand("mkfs", "-t ext3");
}
开发者ID:huiliu,项目名称:Learn,代码行数:12,代码来源:CliCtrl.cpp

示例11: m_pParent

//=============================================================================
///              CommandProcessor class
//=============================================================================
//--------------------------------------------------------------------------
/// constructors
//--------------------------------------------------------------------------
CommandProcessor::CommandProcessor()
    :  m_pParent(NULL),
       m_eDisplayMode(DISPLAY)    // Default to show in UI.
{
    m_strTagName = "";
    m_strID = "";
    m_strDisplayName = "";

    AddCommand(CONTENT_XML,  "CommandTree",    "Command Tree",    "CommandTree.xml", NO_DISPLAY, NO_INCLUDE, m_commandTreeResponse);
    AddCommand(CONTENT_XML,  "Settings",       "Settings",        "settings.xml",    NO_DISPLAY, NO_INCLUDE, m_xmlResponse);
    AddCommand(CONTENT_TEXT, "CommandList",    "Command List",    "commands",        NO_DISPLAY, NO_INCLUDE, m_commandListResponse);
}
开发者ID:davidlee80,项目名称:amd-gpuperfstudio-dx12,代码行数:18,代码来源:CommandProcessor.cpp

示例12: getFacilities

// New functions
void InheritanceVectorPart::InitializeEx(CComPtr<IMgaProject>& pProject, CComPtr<IMgaMetaPart>& pPart, CComPtr<IMgaFCO>& pFCO,
									  HWND parentWnd, PreferenceMap& preferences)
{
	TriangleVectorPart::InitializeEx(pProject, pPart, pFCO, parentWnd, preferences);

	if (m_inheritanceType == ImplementationInheritance || m_inheritanceType == InterfaceInheritance) {
		getFacilities().getMetaFCO(pPart, m_spMetaFCO);
		bool bColor = false;
		COLORREF crColor = COLOR_BLACK;
		PreferenceMap::iterator it = preferences.find(PREF_COLOR);
		if (it != preferences.end()) {
			bColor = true;
			crColor = it->second.uValue.crValue;
		} else {
			bColor = getFacilities().getPreference(pFCO, m_spMetaFCO, PREF_COLOR, crColor);
		}
		AbsoluteCoordCommand* colorCmd = new AbsoluteCoordCommand(crColor);
		AbsoluteCoordCommand* grayedCmd = new AbsoluteCoordCommand(COLOR_GRAYED_OUT);
		m_coordCommands.push_back(colorCmd);
		m_coordCommands.push_back(grayedCmd);
		unsigned long size = m_coordCommands.size();
		AddCommand(VectorCommand(colorCmd, grayedCmd, VectorCommand::SelectBrush));

		// Add four coordinates for the inner circle boundaries
		ComplexCoordCommand* ellipseLeft = new ComplexCoordCommand(LeftMost, 0.5 - 0.25 * INHERITANCE_RATIO);
		ellipseLeft->AddCommand(RightMost, 0.5 + 0.25 * INHERITANCE_RATIO, CoordAdd);
		ellipseLeft->AddCommand(OneConstant, 1.0, CoordAdd);	// correction in case of small sizes
		ComplexCoordCommand* ellipseTop = new ComplexCoordCommand(TopMost, 1.0 / 3.0 - 0.25);
		ellipseTop->AddCommand(BottomMost, 2.0 / 3.0 + 0.25, CoordAdd);
		ComplexCoordCommand* ellipseRight = new ComplexCoordCommand(LeftMost, 0.5 + 0.25 * INHERITANCE_RATIO);
		ellipseRight->AddCommand(RightMost, 0.5 - 0.25 * INHERITANCE_RATIO, CoordAdd);
		ComplexCoordCommand* ellipseBottom = new ComplexCoordCommand(TopMost, 1.0 / 3.0 + 0.25);
		ellipseBottom->AddCommand(BottomMost, 2.0 / 3.0 - 0.25, CoordAdd);

		m_coordCommands.push_back(ellipseLeft);
		m_coordCommands.push_back(ellipseTop);
		m_coordCommands.push_back(ellipseRight);
		m_coordCommands.push_back(ellipseBottom);
		size = m_coordCommands.size();
		if (m_inheritanceType == InterfaceInheritance)
			AddCommand(VectorCommand(m_coordCommands[size - 4],
									 m_coordCommands[size - 3],
									 m_coordCommands[size - 2],
									 m_coordCommands[size - 1],
									 VectorCommand::DrawEllipse));
		if (m_inheritanceType == ImplementationInheritance)
			AddCommand(VectorCommand(m_coordCommands[size - 4],
									 m_coordCommands[size - 3],
									 m_coordCommands[size - 2],
									 m_coordCommands[size - 1],
									 VectorCommand::FillEllipse));
	}
}
开发者ID:dyao-vu,项目名称:meta-core,代码行数:54,代码来源:InheritanceVectorPart.cpp

示例13: InitApplication

// Init this application. Register your
// commands, reactors...
void InitApplication()
{
    if (FAILED(DllRegisterServer()))
        acutPrintf("\nFailed to register.");//dbx safe
    // NOTE: DO NOT edit the following lines.
    //{{AFX_ARX_INIT
    AddCommand("ASDKETRANSMIT", "ADDNOTIFIER", "ADDNOTIFIER", ACRX_CMD_SESSION, AsdkeTransmitAddNotifier);
    AddCommand("ASDKETRANSMIT", "REMOVENOTIFIER", "REMOVENOTIFIER", ACRX_CMD_SESSION, AsdkeTransmitRemoveNotifier);
    //}}AFX_ARX_INIT

    // TODO: add your initialization functions

}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:15,代码来源:eTransmitNotifier.cpp

示例14: ModuleBase

	ElModules::ElModules() : ModuleBase("")
	{
		ModuleGame::Instance();
		ModulePlayer::Instance();
		ModuleServer::Instance();
		ModuleCamera::Instance();
		ModuleInput::Instance();
		ModuleIRC::Instance();

		AddCommand("Help", "help", "Displays this help text", eCommandFlagsNone, CommandHelp);
		AddCommand("Execute", "exec", "Executes a list of commands", eCommandFlagsNone, CommandExecute, { "filename(string) The list of commands to execute" });
		AddCommand("WriteConfig", "config_write", "Writes the ElDewrito config file", eCommandFlagsNone, CommandWriteConfig, { "filename(string) Optional, the filename to write the config to" });

		CommandMap::Instance().FinishAddCommands(); // call this so that the default values can be applied to the game
	}
开发者ID:dark-c0de,项目名称:ElDorito,代码行数:15,代码来源:ElModules.cpp

示例15: BuildCommandTable

void BuildCommandTable(void)
{
  AddCommand("help",	HelpCom);
  AddCommand("q",	QuitCom);
  AddCommand("reghand",	RegHandlerCom);
  AddCommand("remhand", RemHandlerCom);
  AddCommand("reset",	ResetCom);
  AddCommand("setrx",	SetUpRxCom);
  AddCommand("tx",	TxCom);
  AddCommand("txmany",	TxManyCom);
  AddCommand("waitrx",	WaitRxCom);
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:12,代码来源:mltest.c


注:本文中的AddCommand函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。