コード例 #1
0
void run_unhandled_event (int evnt) {

    if (play.check_interaction_only)
        return;

    int evtype=0;
    if (strnicmp(evblockbasename,"hotspot",7)==0) evtype=1;
    else if (strnicmp(evblockbasename,"object",6)==0) evtype=2;
    else if (strnicmp(evblockbasename,"character",9)==0) evtype=3;
    else if (strnicmp(evblockbasename,"inventory",9)==0) evtype=5;
    else if (strnicmp(evblockbasename,"region",6)==0)
        return;  // no unhandled_events for regions

    // clicked Hotspot 0, so change the type code
    if ((evtype == 1) & (evblocknum == 0) & (evnt != 0) & (evnt != 5) & (evnt != 6))
        evtype = 4;
    if ((evtype==1) & ((evnt==0) | (evnt==5) | (evnt==6)))
        ;  // character stands on hotspot, mouse moves over hotspot, any click
    else if ((evtype==2) & (evnt==4)) ;  // any click on object
    else if ((evtype==3) & (evnt==4)) ;  // any click on character
    else if (evtype > 0) {
        can_run_delayed_command();

        QueueScriptFunction(kScInstGame, "unhandled_event", 2, RuntimeScriptValue().SetInt32(evtype), RuntimeScriptValue().SetInt32(evnt));
    }
}
コード例 #2
0
ファイル: global_room.cpp プロジェクト: CalinLeafshade/ags
void CallRoomScript (int value) {
    can_run_delayed_command();

    if (!inside_script)
        quit("!CallRoomScript: not inside a script???");

    play.roomscript_finished = 0;
    RuntimeScriptValue rval_null;
    curscript->run_another("$on_call", RuntimeScriptValue().SetInt32(value), rval_null /*0*/);
}
コード例 #3
0
int run_dialog_request (int parmtr) {
    play.stop_dialog_at_end = DIALOG_RUNNING;
    gameinst->RunTextScriptIParam("dialog_request", RuntimeScriptValue().SetInt32(parmtr));

    if (play.stop_dialog_at_end == DIALOG_STOP) {
        play.stop_dialog_at_end = DIALOG_NONE;
        return -2;
    }
    if (play.stop_dialog_at_end >= DIALOG_NEWTOPIC) {
        int tval = play.stop_dialog_at_end - DIALOG_NEWTOPIC;
        play.stop_dialog_at_end = DIALOG_NONE;
        return tval;
    }
    if (play.stop_dialog_at_end >= DIALOG_NEWROOM) {
        int roomnum = play.stop_dialog_at_end - DIALOG_NEWROOM;
        play.stop_dialog_at_end = DIALOG_NONE;
        NewRoom(roomnum);
        return -2;
    }
    play.stop_dialog_at_end = DIALOG_NONE;
    return -1;
}
コード例 #4
0
ファイル: global_plugin.cpp プロジェクト: Aquilon96/ags
RuntimeScriptValue Sc_PluginStub_IntNeg1(const RuntimeScriptValue *params, int32_t param_count)
{
    return RuntimeScriptValue().SetInt32(-1);
}
コード例 #5
0
ファイル: global_plugin.cpp プロジェクト: Aquilon96/ags
RuntimeScriptValue Sc_PluginStub_Void(const RuntimeScriptValue *params, int32_t param_count)
{
    return RuntimeScriptValue();
}
コード例 #6
0
ファイル: script_runtime.cpp プロジェクト: Aquilon96/ags
bool ccAddExternalObjectFunction(const char *name, ScriptAPIObjectFunction *pfn)
{
    return simp.add(name, RuntimeScriptValue().SetObjectFunction(pfn), NULL) == 0;
}
コード例 #7
0
ファイル: script_runtime.cpp プロジェクト: Aquilon96/ags
bool ccAddExternalDynamicObject(const char *name, void *ptr, ICCDynamicObject *manager)
{
    return simp.add(name, RuntimeScriptValue().SetDynamicObject(ptr, manager), NULL) == 0;
}
コード例 #8
0
ファイル: script_runtime.cpp プロジェクト: Aquilon96/ags
bool ccAddExternalStaticArray(const char *name, void *ptr, StaticArray *array_mgr)
{
    return simp.add(name, RuntimeScriptValue().SetStaticArray(ptr, array_mgr), NULL) == 0;
}
コード例 #9
0
ファイル: script_runtime.cpp プロジェクト: Aquilon96/ags
bool ccAddExternalPluginFunction(const char *name, void *pfn)
{
    return simp.add(name, RuntimeScriptValue().SetPluginFunction(pfn), NULL) == 0;
}
コード例 #10
0
ファイル: string.cpp プロジェクト: bitope/ags
// const char* (const char *texx, ...)
RuntimeScriptValue Sc_String_Format(const RuntimeScriptValue *params, int32_t param_count)
{
    API_SCALL_SCRIPT_SPRINTF(String_Format, 1);
    return RuntimeScriptValue().SetDynamicObject((void*)String_Format("%s", scsf_buffer), &myScriptStringImpl);
}