Thread: [Gcblue-commits] gcb_wx/src/scriptinterface tcGroupInterface.cpp,1.1,1.2 tcSimPythonInterface.cpp,1.
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-01-10 00:31:04
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27845/src/scriptinterface Modified Files: tcGroupInterface.cpp tcSimPythonInterface.cpp Log Message: Fixed group commands Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcSimPythonInterface.cpp 11 Dec 2004 01:09:07 -0000 1.24 --- tcSimPythonInterface.cpp 10 Jan 2005 00:30:54 -0000 1.25 *************** *** 366,370 **** * */ ! void tcSimPythonInterface::ProcessCommand(std::string command, long id, int param, std::string textParam) { std::string s = "Menu."; --- 366,371 ---- * */ ! void tcSimPythonInterface::ProcessCommand(std::string command, const std::vector<long>& id, ! int param, std::string textParam) { std::string s = "Menu."; *************** *** 400,404 **** { pushedMode = meMenuMode; ! pushedPlatformID = menuPlatformID; isModePushed = true; } --- 401,407 ---- { pushedMode = meMenuMode; ! ! pushedPlatformIds = groupInterface->GetUnits(); ! isModePushed = true; } *************** *** 417,425 **** meMenuMode = pushedMode; - // for group menu don't do anything (can't change group menu currently) - if (meMenuMode == GROUP_MENU) return; - // reselect menu platform ! SetMenuPlatform(pushedPlatformID); isModePushed = false; --- 420,427 ---- meMenuMode = pushedMode; // reselect menu platform ! SetMenuGroup(pushedPlatformIds); ! ! pushedPlatformIds.clear(); isModePushed = false; *************** *** 432,439 **** * */ ! void tcSimPythonInterface::ProcessCallback(std::string command, long id, float afData, int param) { PushMode(); ! SetMenuPlatform(id); if (mpHookedObj == NULL) --- 434,442 ---- * */ ! void tcSimPythonInterface::ProcessCallback(std::string command, const std::vector<long>& id, ! float afData, int param) { PushMode(); ! SetMenuGroup(id); if (mpHookedObj == NULL) *************** *** 462,470 **** * version for sending lat/lon coordinates */ ! void tcSimPythonInterface::ProcessCallback(std::string command, long id, float afData1, float afData2, int param) { PushMode(); ! SetMenuPlatform(id); if (mpHookedObj == NULL) --- 465,473 ---- * version for sending lat/lon coordinates */ ! void tcSimPythonInterface::ProcessCallback(std::string command, const std::vector<long>& id, float afData1, float afData2, int param) { PushMode(); ! SetMenuGroup(id); if (mpHookedObj == NULL) *************** *** 492,499 **** * */ ! void tcSimPythonInterface::ProcessCallback(std::string command, long id, long anData, int param) { PushMode(); ! SetMenuPlatform(id); if (mpHookedObj == NULL) --- 495,503 ---- * */ ! void tcSimPythonInterface::ProcessCallback(std::string command, const std::vector<long>& id, ! long anData, int param) { PushMode(); ! SetMenuGroup(id); if (mpHookedObj == NULL) *************** *** 583,587 **** ! void tcSimPythonInterface::SetMenuGroup(std::vector<long>& unitIds) { // if any of the ids are invalid or not own-alliance, then return --- 587,591 ---- ! void tcSimPythonInterface::SetMenuGroup(const std::vector<long>& unitIds) { // if any of the ids are invalid or not own-alliance, then return *************** *** 598,604 **** } ! meMenuMode = GROUP_MENU; ! ! groupInterface->SetUnits(unitIds); } --- 602,618 ---- } ! if (unitIds.size() > 1) ! { ! meMenuMode = GROUP_MENU; ! groupInterface->SetUnits(unitIds); ! } ! else if (unitIds.size() > 0) ! { ! SetMenuPlatform(unitIds[0]); ! } ! else ! { ! fprintf(stderr, "tcSimPythonInterface::SetMenuGroup - empty unitIds\n"); ! } } *************** *** 612,616 **** if (mpHookedObj && (mpHookedObj->mnID == anID)) return; // already set ! menuPlatformID = anID; tcTrackInterface::SetTrack(anID); --- 626,630 ---- if (mpHookedObj && (mpHookedObj->mnID == anID)) return; // already set ! groupInterface->SetUnit(anID); tcTrackInterface::SetTrack(anID); *************** *** 659,667 **** director(0), mpHookedObj(0), ! isModePushed(false), ! pushedPlatformID(-1) ! { - mpSimState = tcSimState::Get(); --- 673,678 ---- director(0), mpHookedObj(0), ! isModePushed(false) { mpSimState = tcSimState::Get(); Index: tcGroupInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcGroupInterface.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcGroupInterface.cpp 16 Aug 2004 01:43:31 -0000 1.1 --- tcGroupInterface.cpp 10 Jan 2005 00:30:54 -0000 1.2 *************** *** 81,89 **** return groupUnits[idx]; } ! } /** * */ ! void tcGroupInterface::SetUnits(std::vector<long>& units) { groupUnits = units; --- 81,107 ---- return groupUnits[idx]; } ! } ! ! /** ! * ! */ ! std::vector<long>& tcGroupInterface::GetUnits() ! { ! return groupUnits; ! } ! ! /** ! * ! */ ! void tcGroupInterface::SetUnit(long unit) ! { ! groupUnits.clear(); ! groupUnits.push_back(unit); ! } ! /** * */ ! void tcGroupInterface::SetUnits(const std::vector<long>& units) { groupUnits = units; |