本文整理汇总了C++中runScript函数的典型用法代码示例。如果您正苦于以下问题:C++ runScript函数的具体用法?C++ runScript怎么用?C++ runScript使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了runScript函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: activate
static void activate(int val)
{
if (self->active == TRUE)
{
runScript("hidden_passage");
}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:7,代码来源:hidden_passage_wall.c
示例17: lua_getglobal
void LuaSystem::processEntity(Entity &entity)
{
LuaComponent *luaComp = entity.getComponent<LuaComponent>();
// Call lua script as usual
if(luaComp->runningStatus == LuaComponent::Running)
{
lua_State *state = m_luaEnv.getRaw();
// Call update function
lua_getglobal(state, "update");
// Push self
LuaEnvironment::pushObjectToLua<Entity>(state, &entity, "jl.Entity");
// Push delta time as argument TODO
lua_pushnumber(state, game->getWindow().getDelta());
if(!lua_isnil(state, -2))
{
if(lua_pcall(state, 2, 0, 0))
m_luaEnv.reportError();
}
}
// Only run Lua file if it's not loaded and has no errors, otherwise a reload is needed
else if(!luaComp->runningStatus == LuaComponent::NotLoaded && !luaComp->runningStatus == LuaComponent::Errors)
runScript(entity);
}
开发者ID:TrentSterling,项目名称:jlEngine,代码行数:31,代码来源:LuaSystem.cpp
示例18: TEST_F
TEST_F(JSDeviceTest, getEndpoints) {
EndpointID endpointId1{20};
EndpointID endpointId2{21};
ZEndpoint endpoint1{NwkAddr {1}, endpointId1, 30, 31, 32, {ClusterID {50}}, {ClusterID {51}}};
ZEndpoint endpoint2{NwkAddr {1}, endpointId2, 30, 31, 32, {ClusterID {60}}, {ClusterID {61}}};
ZDevice zDevice{extAddress, NwkAddr(1), 0, {endpoint1, endpoint2}};
V8_SETUP
Local<Object> objectEndpoint1 = Object::New(isolate);
Local<Object> objectEndpoint2 = Object::New(isolate);
EXPECT_CALL(*zDevices, exists(extAddress)).WillOnce(Return(true));
EXPECT_CALL(*zDevices, getDevice(extAddress)).WillOnce(Return(&zDevice));
EXPECT_CALL(*jsEndpoint, createInstance(isolate, extAddress, endpointId1)).WillOnce(
Return(objectEndpoint1));
EXPECT_CALL(*jsEndpoint, createInstance(isolate, extAddress, endpointId2)).WillOnce(
Return(objectEndpoint2));
v8::Local<v8::Value> result = runScript(creatingZDeviceScript + "a.getEndpoints();");
ASSERT_THAT(result.IsEmpty(), false);
ASSERT_THAT(result->IsArray(), true);
Local<Array> array = result.As<Array>();
ASSERT_THAT(array->Length(), 2);
ASSERT_THAT(array->Get(0)->IsObject(), true);
ASSERT_THAT(array->Get(1)->IsObject(), true);
Local<Object> jszEndpoint0 = array->Get(0).As<Object>();
Local<Object> jszEndpoint1 = array->Get(1).As<Object>();
ASSERT_THAT(jszEndpoint0->GetIdentityHash(), Eq(objectEndpoint1->GetIdentityHash()));
ASSERT_THAT(jszEndpoint1->GetIdentityHash(), Eq(objectEndpoint2->GetIdentityHash()));
}
开发者ID:paoloach,项目名称:zdomus,代码行数:32,代码来源:JSDeviceTest.cpp
示例19: LuaThread
DWORD WINAPI LuaThread(LPVOID pParam)
{
runScript((char*) pParam, 0);
unloadMikmod();
exit(0);
return 0;
}
开发者ID:Klozz,项目名称:LuaPlayer,代码行数:7,代码来源:windows.cpp
示例20: ASSERT
v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* node)
{
ASSERT(v8::Context::InContext());
v8::Local<v8::Value> result;
{
// Isolate exceptions that occur when compiling and executing
// the code. These exceptions should not interfere with
// javascript code we might evaluate from C++ when returning
// from here.
v8::TryCatch tryCatch;
tryCatch.SetVerbose(true);
// Compile the script.
v8::Local<v8::String> code = v8ExternalString(source.source());
ChromiumBridge::traceEventBegin("v8.compile", node, "");
// NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at
// 1, whereas v8 starts at 0.
v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1);
ChromiumBridge::traceEventEnd("v8.compile", node, "");
ChromiumBridge::traceEventBegin("v8.run", node, "");
// Set inlineCode to true for <a href="javascript:doSomething()">
// and false for <script>doSomething</script>. We make a rough guess at
// this based on whether the script source has a URL.
result = runScript(script, source.url().string().isNull());
}
ChromiumBridge::traceEventEnd("v8.run", node, "");
return result;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:31,代码来源:V8Proxy.cpp
注:本文中的runScript函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论