Update of /cvsroot/gcblue/gcb_wx/src/graphics
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/src/graphics
Modified Files:
tcFlightPortGui.cpp tcPlatformGui.cpp
Log Message:
Initial airbase automation work
Index: tcPlatformGui.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** tcPlatformGui.cpp 6 Sep 2006 01:28:20 -0000 1.12
--- tcPlatformGui.cpp 28 Sep 2006 02:01:53 -0000 1.13
***************
*** 110,114 ****
tcPlatformObject* platform = GetPlatform();
! tcStores* mag = GetLoadoutStores();
if (mag != 0)
{
--- 110,117 ----
tcPlatformObject* platform = GetPlatform();
!
! if (platform != 0) platform->EquipForTargetType(loadoutType);
!
! /*tcStores* mag = GetLoadoutStores();
if (mag != 0)
{
***************
*** 118,122 ****
{
fprintf(stderr, "tcPlatformGui::OnLoadoutCommand -- No compatible magazine found\n");
! }
}
--- 121,125 ----
{
fprintf(stderr, "tcPlatformGui::OnLoadoutCommand -- No compatible magazine found\n");
! }*/
}
***************
*** 750,753 ****
--- 753,759 ----
const osg::Vec4 on_avail(1.0, 1.0, 1.0, 0.8);
+ const osg::Vec4 off_equipped(0.2, 0.5, 0.2, 0.8);
+ const osg::Vec4 over_equipped(0.4, 1.0, 0.4, 0.8);
+ const osg::Vec4 on_equipped(1.0, 1.0, 1.0, 0.8);
***************
*** 763,767 ****
button->SetInteractive(available);
! if (available)
{
button->SetFillColors(off_avail, over_avail, on_avail);
--- 769,779 ----
button->SetInteractive(available);
! bool equipped = platform->IsEquippedForTargetType(tgt_flags[n]);
!
! if (equipped)
! {
! button->SetFillColors(off_equipped, over_equipped, on_equipped);
! }
! else if (available)
{
button->SetFillColors(off_avail, over_avail, on_avail);
Index: tcFlightPortGui.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcFlightPortGui.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** tcFlightPortGui.cpp 5 Sep 2006 01:04:25 -0000 1.9
--- tcFlightPortGui.cpp 28 Sep 2006 02:01:53 -0000 1.10
***************
*** 62,65 ****
--- 62,70 ----
}
+ long tcEntityContainerItem::GetPlatformId() const
+ {
+ return platformId;
+ }
+
void tcEntityContainerItem::SetDescription(const std::string& s)
{
***************
*** 72,78 ****
}
! void tcEntityContainerItem::SetEntity(long id, long host)
{
! platformId = id;
hostId = host;
}
--- 77,83 ----
}
! void tcEntityContainerItem::SetEntity(long platformId_, long host)
{
! platformId = platformId_;
hostId = host;
}
***************
*** 114,118 ****
item->SetQuantity(0);
! if (airState->current_location == TRANSIT)
{
item->SetDrawState(tcContainerItem::BLINK);
--- 119,123 ----
item->SetQuantity(0);
! if (airState->inTransit)
{
item->SetDrawState(tcContainerItem::BLINK);
***************
*** 237,241 ****
{
tcContainerSlot& slot = slots[slotIdx];
! if (!slot.IsEmpty()) return; // slot must be empty for flightport move
tcEntityContainerItem* entityItem = dynamic_cast<tcEntityContainerItem*>(item);
--- 242,246 ----
{
tcContainerSlot& slot = slots[slotIdx];
! //if (!slot.IsEmpty()) return; // slot must be empty for flightport move, move will queue until slot is empty
tcEntityContainerItem* entityItem = dynamic_cast<tcEntityContainerItem*>(item);
***************
*** 349,352 ****
--- 354,371 ----
}
+ // search all slots and schedule launch (will be queued if necessary)
+ for (size_t n=0; n<nSlots; n++)
+ {
+ if (slots[n].loc.ContainsPoint(x, y))
+ {
+ tcEntityContainerItem* entityItem = dynamic_cast<tcEntityContainerItem*>(slots[n].GetItem());
+ if (entityItem != 0)
+ {
+ flightPort->LaunchID(entityItem->GetPlatformId());
+ }
+ return;
+ }
+ }
+
}
***************
*** 504,511 ****
int loc;
unsigned spotPos;
! if (airState->current_location == TRANSIT)
{
! loc = airState->goal_location;
! spotPos = (unsigned)airState->goal_spot;
}
else
--- 523,530 ----
int loc;
unsigned spotPos;
! if (airState->inTransit)
{
! loc = airState->current_location;
! spotPos = (unsigned)airState->current_spot;
}
else
|