Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30838/src/scriptinterface
Modified Files:
tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp
tcScenarioInterface.cpp
Log Message:
0.7.0 release snapshot
Index: tcPlatformInterfaceExtensionB.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** tcPlatformInterfaceExtensionB.cpp 2 Mar 2005 22:28:44 -0000 1.21
--- tcPlatformInterfaceExtensionB.cpp 29 Mar 2005 00:12:27 -0000 1.22
***************
*** 147,150 ****
--- 147,152 ----
.def("LookupFriendlyName", &tcPlatformInterface::LookupFriendlyName)
.def("DisplayMessage",&tcPlatformInterface::DisplayMessage)
+ .def("DisplayPopupMessage", &tcPlatformInterface::DisplayPopupMessage)
+ .def("IsPlayerControlled", &tcPlatformInterface::IsPlayerControlled)
.def("IsValid",&tcPlatformInterface::IsValid)
.def("PlaySound",&tcPlatformInterface::PlaySound)
Index: tcScenarioInterface.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** tcScenarioInterface.cpp 2 Mar 2005 22:28:44 -0000 1.21
--- tcScenarioInterface.cpp 29 Mar 2005 00:12:27 -0000 1.22
***************
*** 194,198 ****
if (dbObj == NULL)
{
! fprintf(stderr,"Could not find class name %s in DB\n",unit.className.c_str());
return false;
}
--- 194,204 ----
if (dbObj == NULL)
{
! wxString errorMessage =
! wxString::Format("Could not find class name \"%s\" in database, "
! "check entry in scenario \"%s\"\n",
! unit.className.c_str(), simState->GetScenarioName());
!
! fprintf(stderr, errorMessage.c_str());
! wxMessageBox(errorMessage.c_str(), "Error", wxICON_ERROR);
return false;
}
Index: tcPlatformInterface.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** tcPlatformInterface.cpp 25 Mar 2005 03:48:07 -0000 1.40
--- tcPlatformInterface.cpp 29 Mar 2005 00:12:27 -0000 1.41
***************
*** 47,50 ****
--- 47,51 ----
#include "tcLauncherState.h"
#include "tcLauncher.h"
+ #include "tcMessageInterface.h"
#include "tcStores.h"
#include "ai/Brain.h"
***************
*** 516,520 ****
dynamic_cast<tcBallisticDBObject*>(pLauncher->mpChildDBObj))
{
! info.mfRange_km = 20;
}
else if (tcTorpedoDBObject* torpDBObj =
--- 517,521 ----
dynamic_cast<tcBallisticDBObject*>(pLauncher->mpChildDBObj))
{
! info.mfRange_km = ballisticDBObj->maxRange_km;
}
else if (tcTorpedoDBObject* torpDBObj =
***************
*** 1074,1077 ****
--- 1075,1084 ----
}
+
+ bool tcPlatformInterface::IsPlayerControlled() const
+ {
+ return mpSimState->mpUserInfo->IsOwnAlliance(mpPlatformObj->mnAlliance);
+ }
+
long tcPlatformInterface::LookupFriendlyId(const std::string& unitName)
{
***************
*** 1124,1128 ****
* print message to user console
*/
! void tcPlatformInterface::DisplayMessage(std::string text)
{
wxASSERT(mpConsole);
--- 1131,1135 ----
* print message to user console
*/
! void tcPlatformInterface::DisplayMessage(const std::string& text)
{
wxASSERT(mpConsole);
***************
*** 1141,1144 ****
--- 1148,1175 ----
}
+
+ /**
+ * print message to user console
+ */
+ void tcPlatformInterface::DisplayPopupMessage(const std::string& text)
+ {
+ wxASSERT(mpConsole);
+
+ if (isPlatformOwnAlliance)
+ {
+ wxString s = wxString::Format("%s: %s", mpPlatformObj->mzUnit.mz, text.c_str());
+ tcMessageInterface::Get()->PopupMessage(s.c_str());
+ #ifdef _DEBUG
+ fprintf(stdout, "* popup msg from platform:%d %s\n", mpPlatformObj->mnID, text.c_str());
+ #endif
+ }
+ #ifdef _DEBUG
+ else
+ {
+ fprintf(stdout, "* popup msg from OPFOR:%d %s\n", mpPlatformObj->mnID, text.c_str());
+ }
+ #endif
+ }
+
/**
* Modified to use string argument
|