Update of /cvsroot/gcblue/gcb_wx/scripts
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25403/scripts
Modified Files:
Menu.py UnitCommands.py
Log Message:
Index: UnitCommands.py
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** UnitCommands.py 15 Dec 2006 03:38:49 -0000 1.33
--- UnitCommands.py 20 Dec 2006 00:45:46 -0000 1.34
***************
*** 493,495 ****
--- 493,551 ----
FP.AddAttackMission(targetId)
+ # Group menu functions from Ben "Mnfe" 20061217 post
+ def RelGroupSpeed100(GI):
+ unit_count = GI.GetUnitCount()
+ max_speed=9999
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ this_speed=UI.GetMaxSpeed()
+ if(this_speed<max_speed):
+ max_speed=this_speed
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ UI.SetSpeed(max_speed)
+
+ def RelGroupSpeed80(GI):
+ unit_count = GI.GetUnitCount()
+ max_speed=9999
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ this_speed=UI.GetMaxSpeed()
+ if(this_speed<max_speed):
+ max_speed=this_speed
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ UI.SetSpeed(0.8*max_speed)
+
+ def RelGroupSpeed50(GI):
+ unit_count = GI.GetUnitCount()
+ max_speed=9999
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ this_speed=UI.GetMaxSpeed()
+ if(this_speed<max_speed):
+ max_speed=this_speed
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ UI.SetSpeed(0.5*max_speed)
+
+ def RelGroupSpeed30(GI):
+ unit_count = GI.GetUnitCount()
+ max_speed=9999
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ this_speed=UI.GetMaxSpeed()
+ if(this_speed<max_speed):
+ max_speed=this_speed
+ for n in range(0,unit_count):
+ UI = GI.GetPlatformInterface(n)
+ UI.SetSpeed(0.3*max_speed)
+
+ def AddEngageAllOrderGroup(GI):
+ unit_count=GI.GetUnitCount()
+ for n in range(0,unit_count):
+ UnitInfo=GI.GetPlatformInterface(n)
+ if(not UnitInfo.TaskExists('EngageAll')):
+ AddEngageAllOrder(UnitInfo)
+
Index: Menu.py
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** Menu.py 15 Dec 2006 03:38:49 -0000 1.31
--- Menu.py 20 Dec 2006 00:45:46 -0000 1.32
***************
*** 34,37 ****
--- 34,39 ----
TrackInfo.UpdateAmbiguityList()
+
+ # Updated with Ben "Mnfe" 20061217 post
def BuildGroupMenu(GroupMenu, GroupInfo):
GroupMenu.Clear()
***************
*** 48,58 ****
GroupMenu.EndSubMenu()
! # Group orders
GroupMenu.AddItem('Tasks','')
! GroupMenu.BeginSubMenu()
GroupMenu.AddItem('Zig-zag patrol','AddPatrolOrderGroup')
GroupMenu.AddItemUI('Add waypoint', 'AddWaypointOrderGroup', 'Datum')
GroupMenu.AddItem('Clear all tasks','ClearTasksGroup')
! GroupMenu.EndSubMenu()
--- 50,70 ----
GroupMenu.EndSubMenu()
! # Group Speed relative to fastest unit
! GroupMenu.AddItem('GroupSpeed','')
! GroupMenu.BeginSubMenu()
! GroupMenu.AddItem('Group 30%','RelGroupSpeed30')
! GroupMenu.AddItem('Group 50%','RelGroupSpeed50')
! GroupMenu.AddItem('Group 80%','RelGroupSpeed80')
! GroupMenu.AddItem('Group 100%','RelGroupSpeed100')
! GroupMenu.EndSubMenu()
!
! # Group orders
GroupMenu.AddItem('Tasks','')
! GroupMenu.BeginSubMenu()
! GroupMenu.AddItem('Engage all','AddEngageAllOrderGroup')
GroupMenu.AddItem('Zig-zag patrol','AddPatrolOrderGroup')
GroupMenu.AddItemUI('Add waypoint', 'AddWaypointOrderGroup', 'Datum')
GroupMenu.AddItem('Clear all tasks','ClearTasksGroup')
! GroupMenu.EndSubMenu()
|