def __init__(self, parent): sz = int(config.options['window']['width']), int(config.options['window']['height']) wx.Frame.__init__(self, parent, -1, "dcLord (%s): Divide & Conquer client (www.the-game.ru)"%(version.getVersion(),), style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE, size=sz) if int(config.options['window']['is_maximized'])==1: self.Maximize() self.makeMenu() #import_raw.processAllUnpacked() #self.map.turn = db.db.max_turn self.log_dlg = wx.TextCtrl(self, 1, style=wx.TE_MULTILINE) self.log_dlg.Disable() self.log_dlg.SetBackgroundColour('WHITE') save_load.load_local_data() #serialization.load(ev_cb = self) #self.info_panel = planet_window.InfoPanel(self) self.planet_panel = planet_window.PlanetPanel(self) self.garrison_panel = planet_window.GarrisonPanel(self) self.object_filter = object_filter.FilterPanel(self) #self.planet_filter = object_filter.FilterFrame(self) #self.unit_list = unit_list.UnitPrototypeListWindow(self, 0) #self.history = history.HistoryPanel(self) #self.area_list = area_panel.AreaListWindow(self) self.sync_path = config.options['data']['sync_path'] #self.info_panel.turn = db.getTurn() self.jump_fleets = set() self.map = map.Map(self) self.map.turn = db.getTurn() if 1 == int(config.options['map']['show_good']): self.onShowGood(None) #self.map.set_planet_filter(self.planet_filter) print 'map turn is set to %s'%(self.map.turn,) self.map.update() self.started = False self.actions_queue = [] self.pf = None if self.map.turn != 0: self.log('loaded data for turn %d'%(self.map.turn,)) self.pending_actions = request.RequestMaker() self._mgr = wx.aui.AuiManager(self) self.command_selected_user = False info = wx.aui.AuiPaneInfo() info.CenterPane() info.Fixed() info.DefaultPane() info.Resizable(True) info.CaptionVisible(False) self.fleets = planet_window.FleetPanel(self) self.actions = action.ActionPanel(self) self._mgr.AddPane(self.map, info) #self._mgr.AddPane(self.history, wx.RIGHT, "Turn") self._mgr.AddPane(self.fleets, wx.RIGHT, "Fleets") #self._mgr.AddPane(self.info_panel, wx.RIGHT, "Info") self._mgr.AddPane(self.planet_panel, wx.RIGHT, "Planet") self._mgr.AddPane(self.garrison_panel, wx.RIGHT, "Garrison") #self._mgr.AddPane(self.planet_filter, wx.LEFT, "Planets") self._mgr.AddPane(self.actions, wx.LEFT, "Actions") self._mgr.AddPane(self.object_filter, wx.LEFT, "Filter") #self._mgr.AddPane(self.unit_list, wx.RIGHT, "Units") self._mgr.AddPane(self.log_dlg, wx.BOTTOM, "Log") #self._mgr.AddPane(self.area_list, wx.RIGHT, "Areas") #self.map.set_planet_fileter(self.planet_filter) self._mgr.Update() #TODO: load from data self.manual_control_units = set() #unit id self.manual_control_units.add( 7906 ) self.manual_control_units.add( 7291 ) # probes over Othes planets #TODO: load from file self.exclude_fleet_names = [] #busy, taken, etc... #p = config.options['window']['pane-info'] #if p: # print 'load p %s'%(p,) # self._mgr.LoadPerspective( p ) self.recv_data_callback = {} self.Bind(event.EVT_CANCEL_ACTION, self.on_cancel_action) self.Bind(event.EVT_STORE_ACTION, self.on_store_action) self.Bind(event.EVT_USER_ENABLE, self.on_user_enable) self.Bind(event.EVT_BUILD_UNIT, self.on_build_unit) self.Bind(event.EVT_BUILD_CANCEL, self.on_build_cancel) self.Bind(event.EVT_DATA_DOWNLOAD, self.onDownloadRawData) self.Bind(event.EVT_MAP_UPDATE, self.onMapUpdate) self.Bind(event.EVT_USER_SELECT, self.onSelectUser) self.Bind(event.EVT_ACTIONS_REPLY, self.onActionsReply) self.Bind(event.EVT_SELECT_OBJECT, self.onObjectSelect) #self.info_panel.selectObject) #self.Bind(event.EVT_SELECT_OBJECT, self.planet_panel.select_coord) #self.Bind(event.EVT_SELECT_OBJECT, self.garrison_panel.select_coord) self.Bind(event.EVT_LOG_APPEND, self.onLog)
def sync_data(self): save_load.load_local_data() save_load.save_local_data()