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)
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
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)
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
def _ScatterMouseMoveEvent(self, typeID, ID): if typeID != TYPE_PIN: surfacePoint = planetCommon.GetPickIntersectionPoint() self.eventManager.OnPlanetSurfaceMouseMoved(surfacePoint)