From: Jarda B. <edh...@us...> - 2004-03-17 01:19:16
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv562/plugins/GUIScript Modified Files: GUIScript.cpp Log Message: Display beasts and quests in Journal Index: GUIScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** GUIScript.cpp 16 Mar 2004 19:33:28 -0000 1.137 --- GUIScript.cpp 17 Mar 2004 01:09:35 -0000 1.138 *************** *** 1839,1842 **** --- 1839,1860 ---- } + static PyObject* GemRB_GetGameVar(PyObject * /*self*/, PyObject* args) + { + char* Variable; + unsigned long value; + + if (!PyArg_ParseTuple( args, "s", &Variable )) { + printMessage( "GUIScript", "Syntax Error: GetGameVar(VariableName)\n", + LIGHT_RED ); + return NULL; + } + + if (!core->GetGame()->globals->Lookup( Variable, value )) { + return Py_BuildValue( "l", ( unsigned long ) 0 ); + } + + return Py_BuildValue( "l", value ); + } + static PyObject* GemRB_PlayMovie(PyObject * /*self*/, PyObject* args) { *************** *** 2143,2162 **** } ! static PyObject* GemRB_GetINIBeastsCount(PyObject * /*self*/, PyObject * /*args*/) { ! if (!core->GetBeastsINI()) { return NULL; } ! return Py_BuildValue( "i", core->GetBeastsINI()->GetTagsCount() ); } ! ! static PyObject* GemRB_GetINIPartyCount(PyObject * /*self*/, ! PyObject * /*args*/) { ! if (!core->GetPartyINI()) { return NULL; } ! return Py_BuildValue( "i", core->GetPartyINI()->GetTagsCount() ); } --- 2161,2186 ---- } ! static PyObject* GemRB_GetINIPartyCount(PyObject * /*self*/, ! PyObject * /*args*/) { ! if (!core->GetPartyINI()) { return NULL; } ! return Py_BuildValue( "i", core->GetPartyINI()->GetTagsCount() ); } ! static PyObject* GemRB_GetINIQuestsKey(PyObject * /*self*/, PyObject* args) { ! char* Tag, * Key, * Default; ! if (!PyArg_ParseTuple( args, "sss", &Tag, &Key, &Default )) { ! printMessage( "GUIScript", ! "Syntax Error: GetINIQuestsKey(Tag, Key, Default)\n", LIGHT_RED ); return NULL; } ! if (!core->GetQuestsINI()) { ! return NULL; ! } ! return Py_BuildValue( "s", ! core->GetQuestsINI()->GetKeyAsString( Tag, Key, Default ) ); } *************** *** 2175,2178 **** --- 2199,2203 ---- core->GetBeastsINI()->GetKeyAsString( Tag, Key, Default ) ); } + static PyObject* GemRB_GetINIPartyKey(PyObject * /*self*/, PyObject* args) { *************** *** 2674,2681 **** {"GameIsBeastKnown", GemRB_GameIsBeastKnown, METH_VARARGS, "Returns whether beast with given index is known to PCs (works only on PST)."}, - {"GetINIBeastsCount", GemRB_GetINIBeastsCount, METH_NOARGS, - "Returns the number of beasts defined in beast.ini (works only on PST)."}, {"GetINIPartyCount", GemRB_GetINIPartyCount, METH_NOARGS, "Returns the Number of Party defined in Party.ini (works only on IWD2)."}, {"GetINIBeastsKey", GemRB_GetINIBeastsKey, METH_VARARGS, "Returns a Value from the beasts.ini File (works only on PST)."}, --- 2699,2706 ---- {"GameIsBeastKnown", GemRB_GameIsBeastKnown, METH_VARARGS, "Returns whether beast with given index is known to PCs (works only on PST)."}, {"GetINIPartyCount", GemRB_GetINIPartyCount, METH_NOARGS, "Returns the Number of Party defined in Party.ini (works only on IWD2)."}, + {"GetINIQuestsKey", GemRB_GetINIQuestsKey, METH_VARARGS, + "Returns a Value from the quests.ini File (works only on PST)."}, {"GetINIBeastsKey", GemRB_GetINIBeastsKey, METH_VARARGS, "Returns a Value from the beasts.ini File (works only on PST)."}, *************** *** 2790,2793 **** --- 2815,2820 ---- {"SetToken", GemRB_SetToken, METH_VARARGS, "Set/Create a Variable in the Token Dictionary."}, + {"GetGameVar", GemRB_GetGameVar, METH_VARARGS, + "Get a Variable value from the Game Global Dictionary."}, {"PlayMovie", GemRB_PlayMovie, METH_VARARGS, "Starts the Movie Player."}, |