[Gcblue-commits] gcb_wx/src/scriptinterface tcSimPythonInterface.cpp,1.30,1.31
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-05-06 23:58:02
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11225/src/scriptinterface Modified Files: tcSimPythonInterface.cpp Log Message: added player name to connection status, update rates are slower for non-controlled objects, non-controlled objects now display as green, added chat text popup Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcSimPythonInterface.cpp 5 May 2005 02:14:53 -0000 1.30 --- tcSimPythonInterface.cpp 6 May 2005 23:57:50 -0000 1.31 *************** *** 102,107 **** * Adds a menu item that gets a coordinate or target from the user via a mouse click * @param caption caption for menu item ! * @param callback script to call after user data is obtained ! * @param input type of user data: "Heading", "Target", or "Datum" * @param param integer callback parameter for additional information */ --- 102,107 ---- * Adds a menu item that gets a coordinate or target from the user via a mouse click * @param caption caption for menu item ! * @param callback script to call after user data is obtained ! * @param input type of user data: "Null", "Heading", "Target", or "Datum" ("Null" is a way to treat as callback for multiplayer purposes) * @param param integer callback parameter for additional information */ *************** *** 112,116 **** char zBuff[64]; strcpy(zBuff,input.c_str()); ! if ((strcmp(zBuff,"Heading")!=0)&&(strcmp(zBuff,"Target")!=0)&&(strcmp(zBuff,"Datum")!=0)) { return; --- 112,117 ---- char zBuff[64]; strcpy(zBuff,input.c_str()); ! if ((strcmp(zBuff,"Null")!=0) && (strcmp(zBuff,"Heading")!=0) && ! (strcmp(zBuff,"Target")!=0) && (strcmp(zBuff,"Datum")!=0)) { return; *************** *** 606,609 **** --- 607,646 ---- + /** + * Version without any data (added for multiplayer client "Null" callback support) + */ + void tcSimPythonInterface::ProcessCallback(std::string command, const std::vector<long>& id) + { + PushMode(); + SetMenuGroup(id); + + if (mpHookedObj == NULL) + { + PopMode(); + return; + } + char zBuff[128]; + char zObject[64]; + + GetObjectStringByMode(zObject); + + sprintf(zBuff, "Menu.%s(%s)\n", command.c_str(), zObject); + + + if (!mpSimState->IsMultiplayerClient()) + { + CallPython(zBuff, "Exception occured in ProcessCallback\n"); + } + else + { + ClientCommand cmd; + cmd.idList = id; + cmd.commandText = std::string(zBuff); + + clientCommands.push_back(cmd); + } + + PopMode(); + } |