예제 #1
0
 def SetLinkParent(self, parentID):
     self.eventManager.SetStateCreateLinkEnd()
     self.linkParams = planetCommon.GetUsageParametersForLinkType(const.typeTestPlanetaryLink)
     pin = self.pinsByID[parentID]
     self.planetUISvc.curveLineDrawer.ChangeLinePosition('rubberLink', self.rubberLink, pin.surfacePoint, pin.surfacePoint)
     self.planetUISvc.curveLineDrawer.ChangeLineSetWidth('rubberLink', 2.0)
     self.rubberLinkLabelContainer.state = uiconst.UI_DISABLED
     surfacePoint = planetCommon.GetPickIntersectionPoint()
     self.linkParentID = parentID
     self.UpdateRubberLink(surfacePoint)
예제 #2
0
 def OnClick(self, *args):
     typeID, ID = self.GetPick()
     if not self.planetWasRotated:
         if typeID == TYPE_PIN:
             self.eventManager.OnPlanetPinClicked(ID)
         elif typeID == TYPE_LINK:
             self.eventManager.OnPlanetLinkClicked(ID)
         elif typeID == TYPE_OTHERPLAYERSPIN:
             self.eventManager.OnOtherCharactersCommandPinClicked(ID)
         elif typeID == TYPE_DEPLETIONPIN:
             self.eventManager.OnDepletionPinClicked(ID)
         else:
             surfacePoint = planetCommon.GetPickIntersectionPoint()
             self.eventManager.OnPlanetNavClicked(surfacePoint, self.planetWasRotated)
     else:
         surfacePoint = planetCommon.GetPickIntersectionPoint()
         self.eventManager.OnPlanetNavClicked(surfacePoint, self.planetWasRotated)
     self.planetWasRotated = False
     self.cameraAuto = False
예제 #3
0
 def OnDblClick(self, *args):
     surfacePoint = planetCommon.GetPickIntersectionPoint()
     typeID, ID = self.GetPick()
     if typeID == TYPE_PIN:
         self.eventManager.OnPlanetPinDblClicked(ID)
     elif typeID == TYPE_LINK:
         self.eventManager.OnPlanetLinkDblClicked(ID)
     elif typeID == TYPE_OTHERPLAYERSPIN:
         pass
     elif surfacePoint is not None:
         self.eventManager.OnPlanetSurfaceDblClicked(surfacePoint)
예제 #4
0
 def DebugMenu(self):
     menu = []
     planetUISvc = sm.GetService('planetUI')
     planetID = sm.GetService('planetUI').planetID
     surfacePoint = planetCommon.GetPickIntersectionPoint()
     menuItems = [('ID: %d' % planetID, blue.pyos.SetClipboardData, [str(planetID)]),
      None,
      ('Verify Simulation', planetUISvc.VerifySimulation, []),
      ('Draw cartesian axis', planetUISvc.curveLineDrawer.DrawCartesianAxis, []),
      ('Flush Dust Pin Cache', sm.GetService('planetBaseSvc')._InvalidateCache, [long(planetID)])]
     if surfacePoint is not None:
         menuItems.append(('Get Local Resource Report', planetUISvc.GetLocalDistributionReport, [surfacePoint]))
         menuItems.append(('Add depletion point', planetUISvc.AddDepletionPoint, [surfacePoint]))
     menu.extend(menuItems)
     return menu
예제 #5
0
 def _ScatterMouseMoveEvent(self, typeID, ID):
     if typeID != TYPE_PIN:
         surfacePoint = planetCommon.GetPickIntersectionPoint()
         self.eventManager.OnPlanetSurfaceMouseMoved(surfacePoint)