[Gcblue-commits] gcb_wx/scripts Menu.py,1.7,1.8 UnitCommands.py,1.10,1.11
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-23 23:32:04
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/scripts Modified Files: Menu.py UnitCommands.py Log Message: Text message "message center" GUI screen Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** UnitCommands.py 14 Sep 2004 02:01:45 -0000 1.10 --- UnitCommands.py 23 Nov 2004 23:30:53 -0000 1.11 *************** *** 137,140 **** --- 137,185 ---- def AltitudeVeryLow(UI): UI.SetAlt(50) + + + def DepthSurface(UI): + if (not UI.IsSub()): + return + UI.SetAlt(0) + + def DepthPeriscope(UI): + if (not UI.IsSub()): + return + UI.SetAlt(0) + + SubInterface = UI.GetSubInterface() + SubInterface.GoToPeriscopeDepth() + + def DepthMedium(UI): + if (not UI.IsSub()): + return + UI.SetAlt(-100) + + def DepthDeep(UI): + if (not UI.IsSub()): + return + SubInterface = UI.GetSubInterface() + max_depth = SubInterface.GetMaxDepth() + UI.SetAlt(-max_depth + 50) + + def SetPeriscope(UI, state): + if (not UI.IsSub()): + return + SubInterface = UI.GetSubInterface() + if (state == 0): + SubInterface.LowerPeriscope() + else: + SubInterface.RaisePeriscope() + + def SetRadarMast(UI, state): + if (not UI.IsSub()): + return + SubInterface = UI.GetSubInterface() + if (state == 0): + SubInterface.LowerRadarMast() + else: + SubInterface.RaiseRadarMast() + def SetFractionalSpeed(UI, k, dispMessage=0): Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Menu.py 6 Nov 2004 15:13:40 -0000 1.7 --- Menu.py 23 Nov 2004 23:30:51 -0000 1.8 *************** *** 95,98 **** --- 95,102 ---- UnitMenu.AddItemUI('Land at','AddLandingOrder', 'Target') + # Submarine menu + if (UnitInfo.IsSub()): + BuildSubmarineMenu(UnitMenu, UnitInfo) + # Flight port panel if available if (UnitInfo.HasFlightPort()): *************** *** 100,103 **** --- 104,134 ---- + + def BuildSubmarineMenu(UnitMenu, UnitInfo): + UnitMenu.AddItem('Set depth','') + UnitMenu.BeginSubMenu() + UnitMenu.AddItem('Surface','DepthSurface') + UnitMenu.AddItem('Periscope','DepthPeriscope') + UnitMenu.AddItem('Medium','DepthMedium') + UnitMenu.AddItem('Deep','DepthDeep') + UnitMenu.EndSubMenu() + + SubMenu = UnitInfo.GetSubInterface() + if (SubMenu.IsAtPeriscopeDepth()): + UnitMenu.AddItem('Scope-Mast','') + UnitMenu.BeginSubMenu() + if (SubMenu.IsPeriscopeRaised()): + UnitMenu.AddItemWithParam('Lower scope', 'SetPeriscope', 0) + else: + UnitMenu.AddItemWithParam('Raise scope', 'SetPeriscope', 1) + + if (SubMenu.IsRadarMastRaised()): + UnitMenu.AddItemWithParam('Lower mast', 'SetRadarMast', 0) + else: + UnitMenu.AddItemWithParam('Raise mast', 'SetRadarMast', 1) + + UnitMenu.EndSubMenu() + + def BuildLaunchMenu(UnitMenu, UnitInfo): UnitMenu.AddItem('Engage datum with','') |