PYTHON_GLOBAL_METHOD_DEFINITION(PtYesNoDialog,args,"Params: selfkey,dialogMessage\nThis will display a Yes/No dialog to the user with the text dialogMessage\n"
"This dialog _has_ to be answered by the user.\n"
"And their answer will be returned in a Notify message.")
PyErr_SetString(PyExc_TypeError,"PtYesNoDialog expects a ptKey and a string or unicode string");
PYTHON_RETURN_ERROR;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtRateIt,args,"Params: chronicleName,dialogPrompt,onceFlag\nShows a dialog with dialogPrompt and stores user input rating into chronicleName")
PYTHON_GLOBAL_METHOD_DEFINITION(PtExcludeRegionSetNow,args,"Params: senderKey,regionKey,state\nThis will set the state of an exclude region immediately on the server\n"
"- 'senderKey' is a ptKey of the PythonFile component\n"
"- 'regionKey' is a ptKey of the exclude region\n"
"- 'state' is either kExRegRelease or kExRegClear")
PyErr_SetString(PyExc_TypeError,"PtFogSetDefLinear expects three floats");
PYTHON_RETURN_ERROR;
}
cyMisc::FogSetDefLinear(start,end,density);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtFogSetDefExp,args,"Params: end,density\nSet exp fog values")
{
floatend,density;
if(!PyArg_ParseTuple(args,"ff",&end,&density))
{
PyErr_SetString(PyExc_TypeError,"PtFogSetDefExp expects three floats");
PYTHON_RETURN_ERROR;
}
cyMisc::FogSetDefExp(end,density);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtFogSetDefExp2,args,"Params: end,density\nSet exp2 fog values")
{
floatend,density;
if(!PyArg_ParseTuple(args,"ff",&end,&density))
{
PyErr_SetString(PyExc_TypeError,"PtFogSetDefExp2 expects three floats");
PYTHON_RETURN_ERROR;
}
cyMisc::FogSetDefExp2(end,density);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadDialog,args,"Params: dialogName,selfKey=None,ageName=\"\"\nLoads a GUI dialog by name and optionally set the Notify proc key\n"
"If the dialog is already loaded then it won't load it again")
PyErr_SetString(PyExc_TypeError,"PtLoadDialog expects a string, and optionally a ptKey and second string");
PYTHON_RETURN_ERROR;
}
if(keyObj)
{
if(!pyKey::Check(keyObj))
{
PyErr_SetString(PyExc_TypeError,"PtLoadDialog expects a string, and optionally a ptKey and second string");
PYTHON_RETURN_ERROR;
}
pyKey*key=pyKey::ConvertFrom(keyObj);
if(ageName)
cyMisc::LoadDialogKA(dialogName,*key,ageName);
else
cyMisc::LoadDialogK(dialogName,*key);
}
else
cyMisc::LoadDialog(dialogName);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtUnloadDialog,args,"Params: dialogName\nThis will unload the GUI dialog by name. If not loaded then nothing will happen")
{
char*dialogName;
if(!PyArg_ParseTuple(args,"s",&dialogName))
{
PyErr_SetString(PyExc_TypeError,"PtUnloadDialog expects a string");
PYTHON_RETURN_ERROR;
}
cyMisc::UnloadDialog(dialogName);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtIsDialogLoaded,args,"Params: dialogName\nTest to see if a GUI dialog is loaded, by name")
{
char*dialogName;
if(!PyArg_ParseTuple(args,"s",&dialogName))
{
PyErr_SetString(PyExc_TypeError,"PtIsDialogLoaded expects a string");
PYTHON_GLOBAL_METHOD_DEFINITION(PtShowDialog,args,"Params: dialogName\nShow a GUI dialog by name (does not load dialog)")
{
char*dialogName;
if(!PyArg_ParseTuple(args,"s",&dialogName))
{
PyErr_SetString(PyExc_TypeError,"PtShowDialog expects a string");
PYTHON_RETURN_ERROR;
}
cyMisc::ShowDialog(dialogName);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtHideDialog,args,"Params: dialogName\nHide a GUI dialog by name (does not unload dialog)")
{
char*dialogName;
if(!PyArg_ParseTuple(args,"s",&dialogName))
{
PyErr_SetString(PyExc_TypeError,"PtHideDialog expects a string");
PYTHON_RETURN_ERROR;
}
cyMisc::HideDialog(dialogName);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtGetDialogFromTagID,args,"Params: tagID\nReturns the dialog associated with the tagID")
{
unsignedlongtagID;
if(!PyArg_ParseTuple(args,"l",&tagID))
{
PyErr_SetString(PyExc_TypeError,"PtGetDialogFromTagID expects a long");
PYTHON_RETURN_ERROR;
}
returncyMisc::GetDialogFromTagID(tagID);
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtGetDialogFromString,args,"Params: dialogName\nGet a ptGUIDialog from its name")
{
char*dialogName;
if(!PyArg_ParseTuple(args,"s",&dialogName))
{
PyErr_SetString(PyExc_TypeError,"PtHideDialog expects a string");
PYTHON_RETURN_ERROR;
}
returncyMisc::GetDialogFromString(dialogName);
}
PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtIsGUIModal,"Returns true if the GUI is displaying a modal dialog and blocking input")
{
PYTHON_RETURN_BOOL(cyMisc::IsGUIModal());
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtSendPrivateChatList,args,"Params: chatList\nLock the local avatar into private vox messaging, and / or add new members to his chat list")
{
PyObject*chatListObj=NULL;
if(!PyArg_ParseTuple(args,"O",&chatListObj))
{
PyErr_SetString(PyExc_TypeError,"PtSendPrivateChatList expects a list of ptPlayers");
PYTHON_RETURN_ERROR;
}
std::vector<pyPlayer*>chatList;
if(PyList_Check(chatListObj))
{
intlistSize=PyList_Size(chatListObj);
for(inti=0;i<listSize;i++)
{
PyObject*listItem=PyList_GetItem(chatListObj,i);
if(!pyPlayer::Check(listItem))
{
PyErr_SetString(PyExc_TypeError,"PtSendPrivateChatList expects a list of ptPlayers");
PyErr_SetString(PyExc_TypeError,"PtSendPrivateChatList expects a list of ptPlayers");
PYTHON_RETURN_ERROR;
}
cyMisc::SetPrivateChatList(chatList);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtClearPrivateChatList,args,"Params: memberKey\nRemove the local avatar from private vox messaging, and / or clear members from his chat list")
{
PyObject*keyObj=NULL;
if(!PyArg_ParseTuple(args,"O",&keyObj))
{
PyErr_SetString(PyExc_TypeError,"PtClearPrivateChatList expects a ptKey");
PYTHON_RETURN_ERROR;
}
if(!pyKey::Check(keyObj))
{
PyErr_SetString(PyExc_TypeError,"PtClearPrivateChatList expects a ptKey");