From: Laszlo T. <ave...@us...> - 2011-02-06 22:05:04
|
gemrb: Infinity Engine emulator The branch master has been updated via df2d8496560585971a2abde91b0a1eec7c773fce (commit) Summary of changes: gemrb/GUIScripts/pst/Maze.py | 3 ++- gemrb/plugins/GUIScript/GUIScript.cpp | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) from ddefcba697444358dad909c00d31952766f88f5e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=df2d8496560585971a2abde91b0a1eec7c773fce commit df2d8496560585971a2abde91b0a1eec7c773fce Author: Avenger <ave...@so...> Date: Sun Feb 6 23:04:21 2011 +0100 maze: adding trap script to the enabled traps too diff --git a/gemrb/GUIScripts/pst/Maze.py b/gemrb/GUIScripts/pst/Maze.py index 9e680fd..c121df1 100644 --- a/gemrb/GUIScripts/pst/Maze.py +++ b/gemrb/GUIScripts/pst/Maze.py @@ -362,7 +362,8 @@ def CustomizeMaze(AreaName): trapped = entry['Trapped'] if trapped>=0: - GemRB.EnableRegion('Trap'+chr(trapped+65), 1 ) + type = GemRB.Roll(1,4,0) + GemRB.SetMapRegion('Trap'+chr(trapped+65), '1300trp'+str(type) ) GemRB.SetMazeEntry(pos, ME_VISITED, 1) walls = entry['Walls'] diff --git a/gemrb/plugins/GUIScript/GUIScript.cpp b/gemrb/plugins/GUIScript/GUIScript.cpp index 69328ac..5bc1498 100644 --- a/gemrb/plugins/GUIScript/GUIScript.cpp +++ b/gemrb/plugins/GUIScript/GUIScript.cpp @@ -7598,17 +7598,17 @@ static PyObject* GemRB_SetMapExit(PyObject * /*self*/, PyObject* args) return Py_None; } -PyDoc_STRVAR( GemRB_EnableRegion__doc, -"EnableRegion(TrapName, flag)\n\n" +PyDoc_STRVAR( GemRB_SetMapRegion__doc, +"SetMapRegion(TrapName[, trapscript])\n\n" "Enables or disables an infopoint in the current area."); -static PyObject* GemRB_EnableRegion(PyObject * /*self*/, PyObject* args) +static PyObject* GemRB_SetMapRegion(PyObject * /*self*/, PyObject* args) { const char *Name; - int Flag=1; + const char *TrapScript = NULL; - if (!PyArg_ParseTuple( args, "s|i", &Name, &Flag)) { - return AttributeError( GemRB_EnableRegion__doc ); + if (!PyArg_ParseTuple( args, "s|s", &Name, &TrapScript)) { + return AttributeError( GemRB_SetMapRegion__doc ); } GET_GAME(); @@ -7620,8 +7620,9 @@ static PyObject* GemRB_EnableRegion(PyObject * /*self*/, PyObject* args) InfoPoint *ip = map->TMap->GetInfoPoint(Name); if (ip) { - if (Flag) { + if (TrapScript && TrapScript[0]) { ip->Flags&=~TRAP_DEACTIVATED; + ip->SetScript(TrapScript,0); } else { ip->Flags|=TRAP_DEACTIVATED; } @@ -9908,7 +9909,6 @@ static PyMethodDef GemRBMethods[] = { METHOD(DrawWindows, METH_NOARGS), METHOD(DropDraggedItem, METH_VARARGS), METHOD(EnableCheatKeys, METH_VARARGS), - METHOD(EnableRegion, METH_VARARGS), METHOD(EndCutSceneMode, METH_NOARGS), METHOD(EnterGame, METH_NOARGS), METHOD(EnterStore, METH_VARARGS), @@ -10028,8 +10028,6 @@ static PyMethodDef GemRBMethods[] = { METHOD(Roll, METH_VARARGS), METHOD(SaveCharacter, METH_VARARGS), METHOD(SaveGame, METH_VARARGS), - METHOD(SetMapDoor, METH_VARARGS), - METHOD(SetMapExit, METH_VARARGS), METHOD(SetDefaultActions, METH_VARARGS), METHOD(SetEquippedQuickSlot, METH_VARARGS), METHOD(SetFullScreen, METH_VARARGS), @@ -10037,7 +10035,10 @@ static PyMethodDef GemRBMethods[] = { METHOD(SetGlobal, METH_VARARGS), METHOD(SetInfoTextColor, METH_VARARGS), METHOD(SetJournalEntry, METH_VARARGS), + METHOD(SetMapDoor, METH_VARARGS), + METHOD(SetMapExit, METH_VARARGS), METHOD(SetMapnote, METH_VARARGS), + METHOD(SetMapRegion, METH_VARARGS), METHOD(SetMasterScript, METH_VARARGS), METHOD(SetMazeEntry, METH_VARARGS), METHOD(SetMazeData, METH_VARARGS), ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |