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


C++ runScript函数代码示例

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


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

示例1: runScript

bool Creature::click(Object *triggerer) {
	// Try the onDialog script first
	if (hasScript(kScriptDialogue))
		return runScript(kScriptDialogue, this, triggerer);

	// Next, look we have a generic onClick script
	if (hasScript(kScriptClick))
		return runScript(kScriptClick, this, triggerer);

	return false;
}
开发者ID:clone2727,项目名称:xoreos,代码行数:11,代码来源:creature.cpp

示例2: runScript

bool Creature::click(Object *triggerer) {
	// Try the onDialog script first
	if (hasScript(kScriptDialogue))
		return runScript(kScriptDialogue, this, triggerer);

	// Next, look we have a generic onClick script
	if (hasScript(kScriptClick))
		return runScript(kScriptClick, this, triggerer);

	// Lastly, try to start a conversation directly
	return beginConversation(triggerer);
}
开发者ID:clone2727,项目名称:xoreos,代码行数:12,代码来源:creature.cpp

示例3: initVideo

void initVideo(void) {
	videoInit();
	runScript(PATH_SCRIPTS, "video.lua");

	initVideoData();

	consoleInit();
	initArtpacks();
	runScript(PATH_SCRIPTS, "menu.lua");
	runScript(PATH_SCRIPTS, "menu_functions.lua");
  setupDisplay(gScreen);
}
开发者ID:Zoxc,项目名称:gltron,代码行数:12,代码来源:init.c

示例4: runScript

void HTMLWidget::mouseModeChanged(const MouseModes mouseMode)
{
    const bool inSelectionMode = (mouseMode == MouseModeRegionSelection);

    if (inSelectionMode)
    {
        d->firstSelectionPoint.clear();
        d->intermediateSelectionPoint.clear();
        runScript(QString::fromLatin1("kgeomapSelectionModeStatus(%1);").arg(inSelectionMode));
    }
    else
    {
        runScript(QString::fromLatin1("kgeomapSelectionModeStatus(%1);").arg(inSelectionMode));
    }
}
开发者ID:KDE,项目名称:libkgeomap,代码行数:15,代码来源:htmlwidget.cpp

示例5: connect

void ScriptConsole::createDialogContent()
{
	ui->setupUi(dialog);
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));

	highlighter = new StelScriptSyntaxHighlighter(ui->scriptEdit->document());
	ui->includeEdit->setText(StelFileMgr::getInstallationDir() + "/scripts");

	ui->quickrunCombo->addItem(q_("quickrun..."));
	ui->quickrunCombo->addItem(q_("selected text"));
	ui->quickrunCombo->addItem(q_("clear text"));
	ui->quickrunCombo->addItem(q_("clear images"));
	ui->quickrunCombo->addItem(q_("natural"));
	ui->quickrunCombo->addItem(q_("starchart"));

	connect(ui->scriptEdit, SIGNAL(cursorPositionChanged()), this, SLOT(rowColumnChanged()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
	connect(ui->loadButton, SIGNAL(clicked()), this, SLOT(loadScript()));
	connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(saveScript()));
	connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearButtonPressed()));
	connect(ui->preprocessSSCButton, SIGNAL(clicked()), this, SLOT(preprocessScript()));
	connect(ui->runButton, SIGNAL(clicked()), this, SLOT(runScript()));
	connect(ui->stopButton, SIGNAL(clicked()), &StelApp::getInstance().getScriptMgr(), SLOT(stopScript()));
	connect(ui->includeBrowseButton, SIGNAL(clicked()), this, SLOT(includeBrowse()));
	connect(ui->quickrunCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(quickRun(int)));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptRunning()), this, SLOT(scriptStarted()));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptStopped()), this, SLOT(scriptEnded()));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptDebug(const QString&)), this, SLOT(appendLogLine(const QString&)));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptOutput(const QString&)), this, SLOT(appendOutputLine(const QString&)));
	ui->tabs->setCurrentIndex(0);
	ui->scriptEdit->setFocus();
}
开发者ID:PhiTheta,项目名称:stellarium,代码行数:33,代码来源:ScriptConsole.cpp

示例6: runScript

void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator last) {
	if (g_engineFlags & kEnginePauseJobs) {
		return;
	}

	for (ProgramList::iterator it = first; it != last; ++it) {

		AnimationPtr a = (*it)->_anim;

		if (a->_flags & kFlagsCharacter)
			a->resetZ();

		if ((a->_flags & kFlagsActing) == 0)
			continue;

		runScript(*it, a);

		if (a->_flags & kFlagsCharacter)
			a->resetZ();
	}

	_modCounter++;

	return;
}
开发者ID:AlbanBedel,项目名称:scummvm,代码行数:25,代码来源:exec.cpp

示例7: EditWindow

ScriptEditor::ScriptEditor(QWidget *parent)
    : EditWindow(parent)
{
    runAct = new QAction(QIcon(":/images/media-play-3x.png"), tr("&Run"), this);
//    runAct->setShortcuts(QKeySequence::New);
    runAct->setStatusTip(tr("Run script"));
    connect(runAct, SIGNAL(triggered()), this, SLOT(runScript()));

    runSelectionAct = new QAction(QIcon(":/images/reload-2x.png"),tr("Run se&lection"), this);
    runSelectionAct->setStatusTip(tr("Run selected text"));
    connect(runSelectionAct,SIGNAL(triggered()),this, SLOT(runSelection()));

    stopScriptAct = new QAction("STOP",this);
//    connect(stopScriptAct,SIGNAL(triggered()),SessionManager::instance(),SLOT(stop()));
    pauseAct = new QAction("PAUSE",this);
//    connect(pauseAct,SIGNAL(triggered()),SessionManager::instance(),SLOT(pause()));
//    connect(SessionManager::instance(),SIGNAL(isPaused(bool)),this,SLOT(showPauseState(bool)));

    runToolBar = addToolBar(tr("Run"));
    runToolBar->addAction(runAct);
    runToolBar->addAction(runSelectionAct);
//    runToolBar->addAction(pasteAct);


}
开发者ID:uasolo,项目名称:lazyNutGUI,代码行数:25,代码来源:scripteditor.cpp

示例8: clampCameraPos

void ScummEngine_v7::setCameraAt(int pos_x, int pos_y) {
	Common::Point old;

	old = camera._cur;

	camera._cur.x = pos_x;
	camera._cur.y = pos_y;

	clampCameraPos(&camera._cur);

	camera._dest = camera._cur;
	VAR(VAR_CAMERA_DEST_X) = camera._dest.x;
	VAR(VAR_CAMERA_DEST_Y) = camera._dest.y;

	assert(camera._cur.x >= (_screenWidth / 2) && camera._cur.y >= (_screenHeight / 2));

	if (camera._cur.x != old.x || camera._cur.y != old.y) {
		if (VAR(VAR_SCROLL_SCRIPT)) {
			VAR(VAR_CAMERA_POS_X) = camera._cur.x;
			VAR(VAR_CAMERA_POS_Y) = camera._cur.y;
			runScript(VAR(VAR_SCROLL_SCRIPT), 0, 0, 0);
		}

		// Even though cameraMoved() is called automatically, we may
		// need to know at once that the camera has moved, or text may
		// be printed at the wrong coordinates. See bugs #795938 and
		// #929242
		cameraMoved();
	}
}
开发者ID:iPodLinux-Community,项目名称:iScummVM,代码行数:30,代码来源:camera.cpp

示例9: initDatabase

void Lua::initDatabase()
{
    if (!runScript(LUA_INIT_DB_PATH))
    {
        //throw
    }
}
开发者ID:Xackery,项目名称:ZEQ,代码行数:7,代码来源:lua.cpp

示例10: runScript

Task::ReportResult ScriptTask::report() {
    if (isMainThreadScript()) {
        QScriptEngine engine;
        result = runScript(&engine, conf.inputParametersMap, scriptText, stateInfo);
    }
    return ReportResult_Finished;
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:7,代码来源:ScriptTask.cpp

示例11: installConfig

MHWD::STATUS Mhwd::installConfig(std::shared_ptr<Config> config)
{
    std::string databaseDir;
    if ("USB" == config->type_)
    {
        databaseDir = MHWD_USB_DATABASE_DIR;
    }
    else
    {
        databaseDir = MHWD_PCI_DATABASE_DIR;
    }

    if (!runScript(config, MHWD::TRANSACTIONTYPE::INSTALL))
    {
        return MHWD::STATUS::ERROR_SCRIPT_FAILED;
    }

    if (!copyDirectory(config->basePath_, databaseDir + "/" + config->name_))
    {
        return MHWD::STATUS::ERROR_SET_DATABASE;
    }

    // Installed config vectors have to be updated manual with updateInstalledConfigData(Data*)

    return MHWD::STATUS::SUCCESS;
}
开发者ID:fatman2021,项目名称:mhwd,代码行数:26,代码来源:Mhwd.cpp

示例12: activate

static void activate(int val)
{
	if (self->active == TRUE)
	{
		runScript(self->requires);
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:7,代码来源:drawbridge_pulley.c

示例13: activate

static void activate(int val)
{
	if (self->head->active == FALSE)
	{
		runScript("rusted");
	}

	else
	{
		self->head->action = &fire;

		setEntityAnimation(self->head, "WALK");

		self->head->frameSpeed = 1;

		setCustomAction(&player, &invulnerableNoFlash, 60, 0, 0);

		setPlayerStunned(60);

		player.dirX = 12;
		player.dirY = -22;

		self->head->thinkTime = 120;
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:25,代码来源:catapult.c

示例14: initContextIfNeeded

ScriptValue WorkerContextExecutionProxy::evaluate(const String& script, const String& fileName, int baseLine, WorkerContextExecutionState* state)
{
    v8::HandleScope hs;

    initContextIfNeeded();
    v8::Context::Scope scope(m_context);

    v8::TryCatch exceptionCatcher;

    v8::Local<v8::String> scriptString = v8ExternalString(script);
    v8::Handle<v8::Script> compiledScript = V8Proxy::compileScript(scriptString, fileName, baseLine);
    v8::Local<v8::Value> result = runScript(compiledScript);

    if (exceptionCatcher.HasCaught()) {
        v8::Local<v8::Message> message = exceptionCatcher.Message();
        state->hadException = true;
        state->exception = ScriptValue(exceptionCatcher.Exception());
        state->errorMessage = toWebCoreString(message->Get());
        state->lineNumber = message->GetLineNumber();
        state->sourceURL = toWebCoreString(message->GetScriptResourceName());
        exceptionCatcher.Reset();
    } else
        state->hadException = false;

    if (result.IsEmpty() || result->IsUndefined())
        return ScriptValue();

    return ScriptValue(result);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:29,代码来源:WorkerContextExecutionProxy.cpp

示例15: activate

static void activate(int val)
{
	if (self->active == TRUE)
	{
		if (self->health == 0)
		{
			runScript("puzzle_pieces");
		}

		if (self->health == 1)
		{
			if (self->target->mental == 0)
			{
				self->target->mental = -2;
			}

			self->mental = 0;

			setInfoBoxMessage(300, 255, 255, 255, _("Solve the jigsaw puzzle"));

			self->target->requires[0] = '\0';

			self->action = &readInputCode;

			self->touch = NULL;

			self->activate = NULL;

			setPlayerLocked(TRUE);
		}
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:32,代码来源:jigsaw_puzzle.c


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