Permalink
Browse files

Set GF_ALL_STRINGS_TAGGED for bg2demo

  * Add new GUIScript method GemRB.SetFeature()
  • Loading branch information...
1 parent e61d555 commit 22959744121296ca60051e6bc520556d3ddb31ac @edheldil edheldil committed Jan 15, 2014
@@ -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
@@ -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)
@@ -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
+
@@ -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),

0 comments on commit 2295974

Please sign in to comment.