예제 #1
0
 def __init__(self, parent, **kwargs):
     Widget.__init__(self, parent)
     # data
     self.action = None
     # map
     self.pressedObjID = OID_NONE
     self._actAreas = {}
     self._starImg = None
     self._planetImgs = []
     self.selectedObjID = OID_NONE
     self.systemID = OID_NONE
     self.unknown_mines = 0
     self.my_mines = 0
     self.buoytext = None
     # flags
     self.processKWArguments(kwargs)
     parent.registerWidget(self)
 def __init__(self, parent, **kwargs):
     Widget.__init__(self, parent)
     # data
     self.action = None
     # map
     self.pressedObjID = OID_NONE
     self._actAreas = {}
     self._starImg = None
     self._planetImgs = []
     self.selectedObjID = OID_NONE
     self.systemID = OID_NONE
     self.unknown_mines = 0
     self.my_mines = 0
     self.buoytext = None
     # flags
     self.processKWArguments(kwargs)
     parent.registerWidget(self)
예제 #3
0
 def onMouseOut(self):
     # this is used when cursor moves directly from sun field out of widget
     if self.selectedObjID:
         self.processAction(self.action, self.selectedObjID)
     return Widget.onMouseOut(self)
예제 #4
0
    def __init__(self, parent, **kwargs):
        Widget.__init__(self, parent)
        self.searchDlg = SearchDlg(self.app)
        self.searchDlg.mapWidget = self
        # data
        self.control_modes = {
        }  # mutable, thus updating here will update StarMap
        self.updateConfigModes()
        self.control_modes['systems'] = 1
        self.control_modes['planets'] = 1
        self.control_modes['fleets'] = 1
        self.control_modes['civilian_fleets'] = 1
        self.control_modes['pirate_areas'] = 1
        self.control_modes['hotbuttons'] = 1
        self.control_modes['minimap'] = 1
        self.control_modes['redirects'] = 1
        self.control_modes['map_grid_coords'] = 1
        self.control_modes['map_grid'] = 1
        self.control_modes['scanners'] = 1
        self.control_modes['fleet_lines'] = 1
        self.control_modes['gate_systems'] = 1
        self.control_modes['alternative_view'] = 1
        self.control_modes['control_areas'] = 0
        self.control_modes['pirate_dialogs'] = 0  # only for pirate, obv.
        # more data
        self.highlightPos = None
        self.alwaysShowRangeFor = None
        self.activeObjID = Const.OID_NONE
        self.activeObjIDs = []
        self.pressedObjIDs = []
        self._newCurrXY = 0
        self.activePos = (0, 0)

        # the map itself!
        self.star_map = StarMap(self.control_modes)
        self.action = None
        self.callEventHandler = None
        self.showBuoyDlg = ShowBuoyDlg(self.app)
        self.KeyModHelp = KeyModHelp(self.app)
        self._miniMapRect = pygame.Rect(0, 20, 175, 175)
        self._hotbuttonsZone = pygame.Rect(0, 0, 0, 0)
        self.initHotbuttons()
        self.miniMap = MiniMap(self._miniMapRect.width,
                               self._miniMapRect.height)
        # flags
        self.processKWArguments(kwargs)
        parent.registerWidget(self)
        # popup menu
        self.popup = ui.Menu(self.app, title=_("Select object"))
        self.popup.subscribeAction("*", self)
        # overlay system
        self._overlayZone = False
        # key setting system
        self.selectobject = False
        self.setKey = False
        # commands
        self.keyPress = False
        # map - produced by StarMap draw method
        self._mapSurf = None
        self._actAreas = {}
        self._actBuoyAreas = {}
        # dirty flag
        self.repaint_map = True
예제 #5
0
    def __init__(self, parent, **kwargs):
        Widget.__init__(self, parent)
        self.searchDlg = SearchDlg(self.app)
        self.searchDlg.mapWidget = self
        # data
        self.control_modes = {}  # mutable, thus updating here will update StarMap
        self.updateConfigModes()
        self.control_modes['systems'] = 1
        self.control_modes['planets'] = 1
        self.control_modes['fleets'] = 1
        self.control_modes['civilian_fleets'] = 1
        self.control_modes['pirate_areas'] = 1
        self.control_modes['hotbuttons'] = 1
        self.control_modes['minimap'] = 1
        self.control_modes['redirects'] = 1
        self.control_modes['map_grid_coords'] = 1
        self.control_modes['map_grid'] = 1
        self.control_modes['scanners'] = 1
        self.control_modes['fleet_lines'] = 1
        self.control_modes['gate_systems'] = 1
        self.control_modes['alternative_view'] = 1
        self.control_modes['control_areas'] = 0
        self.control_modes['pirate_dialogs'] = 0  # only for pirate, obv.
        # more data
        self.highlightPos = None
        self.alwaysShowRangeFor = None
        self.activeObjID = Const.OID_NONE
        self.activeObjIDs = []
        self.pressedObjIDs = []
        self._newCurrXY = 0
        self.activePos = (0, 0)

        # the map itself!
        self.star_map = StarMap(self.control_modes)
        self.action = None
        self.callEventHandler = None
        self.showBuoyDlg = ShowBuoyDlg(self.app)
        self.KeyModHelp = KeyModHelp(self.app)
        self._miniMapRect = pygame.Rect(0, 20, 175, 175)
        self._hotbuttonsZone = pygame.Rect(0,0,0,0)
        self.initHotbuttons()
        self.miniMap = MiniMap(self._miniMapRect.width, self._miniMapRect.height)
        # flags
        self.processKWArguments(kwargs)
        parent.registerWidget(self)
        # popup menu
        self.popup = ui.Menu(self.app, title = _("Select object"))
        self.popup.subscribeAction("*", self)
        # overlay system
        self._overlayZone = False
        # key setting system
        self.selectobject = False
        self.setKey = False
        # commands
        self.keyPress = False
        # map - produced by StarMap draw method
        self._mapSurf = None
        self._actAreas = {}
        self._actBuoyAreas = {}
        # dirty flag
        self.repaint_map = True
예제 #6
0
 def onMouseOut(self):
     # this is used when cursor moves directly from sun field out of widget
     if self.selectedObjID:
         self.processAction(self.action, self.selectedObjID)
     return Widget.onMouseOut(self)