Exemple #1
0
    def __createNoteBook(self):
        """!Creates notebook widgets"""

        #create main notebook widget
        nbStyle = FN.FNB_FANCY_TABS | \
            FN.FNB_BOTTOM | \
            FN.FNB_NO_NAV_BUTTONS | \
            FN.FNB_NO_X_BUTTON
        

        self.disp_idx = -1
  

        # create displays notebook widget and add it to main notebook page
        cbStyle = globalvar.FNPageStyle
        self.notebook = FN.FlatNotebook(parent=self, id=wx.ID_ANY, style=cbStyle)
        
        self.notebook.SetTabAreaColour(globalvar.FNPageColor)

        self.pg_panel = MapFrame(parent=self.notebook, id=wx.ID_ANY, Map=render.Map(), size=globalvar.MAP_WINDOW_SIZE,flag=False,frame=self)
        
        self.disp_idx = self.disp_idx + 1
        self.notebook.AddPage(self.pg_panel, text="Display "+ str(self.disp_idx), select = True)

        self.goutput = goutput.GMConsole(self, pageid=1)
        self.outpage = self.notebook.AddPage(self.goutput, text=_("Command console"))

        self.notebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnCBPageChanged)
        self.notebook.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CLOSING, self.OnCBPageClosed)


        return self.notebook
Exemple #2
0
 def __init__(self):
     self.mapobj = render.Map()
     self.level = Level(self.mapobj, [])
     self.filename = None
     self.player = None
     self.inventory = None
     globs.gEventHandler.bind("object_destroy", self.destroy_object)
     globs.gEventHandler.bind("add_object", self.add_object)
     globs.gEventHandler.bind("add_object_append", self.add_object_append)
Exemple #3
0
 def load_save(self, save_file):
     with open(save_file, "r") as f:
         d = json.load(f)
         self.mapobj = render.Map()
         self.level = Level(self.mapobj, [])
         self.filename = d["level"]
         self.mapobj.set_map(d["map"])
         self.process_objects(d["objects"], True)
         self.inventory.items = []
         self.inventory.load_json(d["inventory"])
Exemple #4
0
    def OnInit(self):
        if __name__ == "__main__":
            Map = render.Map()
        else:
            Map = None

        self.frame = NetworkPath(parent=None,
                                 id=wx.ID_ANY,
                                 Map=Map,
                                 size=globalvar.MAP_WINDOW_SIZE)

        self.frame.Show()
        return 1
Exemple #5
0
    def NewDisplay(self, show=True):
        """!Create new layer tree, which will
        create an associated map display frame

        @param show show map display window if True

        @return reference to mapdisplay intance
        """
        Debug.msg(1, "GMFrame.NewDisplay(): idx=%d" % self.disp_idx)
        
        self.disp_idx = self.disp_idx + 1
        
        self.page = MapFrame(parent=self.notebook, id=wx.ID_ANY, Map=render.Map(),  size=globalvar.MAP_WINDOW_SIZE,frame=self)
        self.notebook.InsertPage(self.disp_idx,self.page, text="Display "+ str(self.disp_idx), select = True)