diff --git a/gemrb/GUIScripts/GUIDefines.py b/gemrb/GUIScripts/GUIDefines.py index 23d4bd88da..ca42fc73d5 100644 --- a/gemrb/GUIScripts/GUIDefines.py +++ b/gemrb/GUIScripts/GUIDefines.py @@ -193,6 +193,10 @@ GA_NO_NEUTRAL = 1024 GA_NO_SELF = 2048 +# Game features, for Interface::SetFeatures() +# Defined in globals.h +GF_ALL_STRINGS_TAGGED = 1 + # Shadow color for ShowModal() # !!! Keep these synchronized with Interface.h !!! MODAL_SHADOW_NONE = 0 diff --git a/gemrb/GUIScripts/bg2/Start2.py b/gemrb/GUIScripts/bg2/Start2.py index 6c808b3dcb..43101911e8 100644 --- a/gemrb/GUIScripts/bg2/Start2.py +++ b/gemrb/GUIScripts/bg2/Start2.py @@ -51,6 +51,9 @@ def OnLoad(): CancelButton.SetEvent (IE_GUI_BUTTON_ON_PRESS, CancelTut) PlayButton.SetFlags (IE_GUI_BUTTON_DEFAULT, OP_OR) CancelButton.SetFlags (IE_GUI_BUTTON_CANCEL, OP_OR) + else: + GemRB.SetFeature (GF_ALL_STRINGS_TAGGED, True) + #quit subwindow QuitWindow = GemRB.LoadWindow (3) QuitTextArea = QuitWindow.GetControl (0) diff --git a/gemrb/docs/en/GUIScript/SetFeature.txt b/gemrb/docs/en/GUIScript/SetFeature.txt new file mode 100644 index 0000000000..7b182bc3e8 --- /dev/null +++ b/gemrb/docs/en/GUIScript/SetFeature.txt @@ -0,0 +1,16 @@ +Prototype: GemRB.SetFeature(feature, value) + +Description: Set GameType flag FEATURE to VALUE, either True or False. + +Parameters: +FEATURE - GF_xxx constant defined in GUIDefines.py and globals.h +VALUE - Value to set the feature to. Either True or False + +Return value: N/A + +Examples: + GemRB.SetFeature(GF_ALL_STRINGS_TAGGED, True) + + +MD5: 87139f1b1e0413d1e373c73af198217e + diff --git a/gemrb/plugins/GUIScript/GUIScript.cpp b/gemrb/plugins/GUIScript/GUIScript.cpp index 07aae4b3cf..6eff5641c9 100644 --- a/gemrb/plugins/GUIScript/GUIScript.cpp +++ b/gemrb/plugins/GUIScript/GUIScript.cpp @@ -10608,6 +10608,29 @@ static PyObject* GemRB_Log(PyObject* /*self*/, PyObject* args) return Py_None; } + +PyDoc_STRVAR( GemRB_SetFeature__doc, +"GemRB.SetFeature(feature, value)\n\n" +"Set GameType flag FEATURE to VALUE, either True or False. \n" +"FEATURE is defined by GF_xxx defines.\n" +"Example:\n" +"GemRB.SetFeature(GF_ALL_STRINGS_TAGGED, True)\n"); + +static PyObject* GemRB_SetFeature(PyObject* /*self*/, PyObject* args) +{ + unsigned int feature; + bool value; + + if (!PyArg_ParseTuple(args, "ib", &feature, &value)) { + return NULL; + } + + core->SetFeature(value, feature); + Py_INCREF(Py_None); + return Py_None; +} + + static PyMethodDef GemRBMethods[] = { METHOD(ActOnPC, METH_VARARGS), METHOD(AddGameTypeHint, METH_VARARGS), @@ -10775,6 +10798,7 @@ static PyMethodDef GemRBMethods[] = { METHOD(SetDefaultActions, METH_VARARGS), METHOD(SetEquippedQuickSlot, METH_VARARGS), METHOD(SetFeat, METH_VARARGS), + METHOD(SetFeature, METH_VARARGS), METHOD(SetFullScreen, METH_VARARGS), METHOD(SetGamma, METH_VARARGS), METHOD(SetGlobal, METH_VARARGS),