本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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));
}
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}
}
示例9: initDatabase
void Lua::initDatabase()
{
if (!runScript(LUA_INIT_DB_PATH))
{
//throw
}
}
示例10: runScript
Task::ReportResult ScriptTask::report() {
if (isMainThreadScript()) {
QScriptEngine engine;
result = runScript(&engine, conf.inputParametersMap, scriptText, stateInfo);
}
return ReportResult_Finished;
}
示例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;
}
示例12: activate
static void activate(int val)
{
if (self->active == TRUE)
{
runScript(self->requires);
}
}
示例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;
}
}
示例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);
}
示例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);
}
}
}