comparison mainmenucontroller.py @ 8:708a6f651c31

Modifications to use the grease manager and modes
author KarstenBock@gmx.net
date Tue, 12 Jul 2011 12:31:53 +0200
parents 7a89ea5404b1
children 7b31de1dc964
comparison
equal deleted inserted replaced
7:710f299ed275 8:708a6f651c31
53 view = CharacterCreationView(self.engine, self.model, 53 view = CharacterCreationView(self.engine, self.model,
54 self.model.settings) 54 self.model.settings)
55 controller = CharacterCreationController(self.engine, view, self.model, 55 controller = CharacterCreationController(self.engine, view, self.model,
56 self.application) 56 self.application)
57 self.application.view = view 57 self.application.view = view
58 self.application.switchController(controller) 58 self.application.swap_modes(controller)
59 59
60 # def newGame(self): 60 # def newGame(self):
61 # """Starts a new game""" 61 # """Starts a new game"""
62 # view = GameSceneView(self.engine, 62 # view = GameSceneView(self.engine,
63 # self.model) 63 # self.model)
64 # controller = GameSceneController(self.engine, 64 # controller = GameSceneController(self.engine,
65 # view, 65 # view,
66 # self.model, 66 # self.model,
67 # self.application) 67 # self.application)
68 # self.application.view = view 68 # self.application.view = view
69 # self.application.switchController(controller) 69 # self.application.swap_modes(controller)
70 # start_map = self.model.settings.get("PARPG", "Map") 70 # start_map = self.model.settings.get("PARPG", "Map")
71 # self.model.changeMap(start_map) 71 # self.model.changeMap(start_map)
72 72
73 def loadGame(self, *args, **kwargs): 73 def loadGame(self, *args, **kwargs):
74 """Loads the game state 74 """Loads the game state
79 controller = GameSceneController(self.engine, 79 controller = GameSceneController(self.engine,
80 view, 80 view,
81 self.model, 81 self.model,
82 self.application) 82 self.application)
83 self.application.view = view 83 self.application.view = view
84 self.application.switchController(controller) 84 self.application.swap_modes(controller)
85 controller.loadGame(*args, **kwargs) 85 controller.loadGame(*args, **kwargs)
86 86
87 def onStop(self): 87 def on_deactivate(self):
88 """Called when the controller is removed from the list""" 88 """Called when the controller is removed from the list"""
89 self.view.hideMenu() 89 self.view.hideMenu()
90 90
91 91
92 def quitGame(self): 92 def quitGame(self):