當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。