Mercurial > fife-parpg
annotate demos/rpg/scripts/guicontroller.py @ 524:6037f79b0dcf
Multiple quests now work.
Added the item layer.
Made movement more like diablo by allowing you to hold and drag the left mouse button.
All objects are now loaded from a separate "allobjects" file. Specific item attributes are loaded from the map objects file (like position). This allows for the possibility of multiple instances using the same FIFE model.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 27 May 2010 21:11:37 +0000 |
parents | 494c60cf61cf |
children | 1afe46247ab1 |
rev | line source |
---|---|
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
1 #!/usr/bin/env python |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
2 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
3 # -*- coding: utf-8 -*- |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
4 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
5 # #################################################################### |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
6 # Copyright (C) 2005-2010 by the FIFE team |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
7 # http://www.fifengine.net |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
8 # This file is part of FIFE. |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
9 # |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
10 # FIFE is free software; you can redistribute it and/or |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
11 # modify it under the terms of the GNU Lesser General Public |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
12 # License as published by the Free Software Foundation; either |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
13 # version 2.1 of the License, or (at your option) any later version. |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
14 # |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
15 # This library is distributed in the hope that it will be useful, |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
18 # Lesser General Public License for more details. |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
19 # |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
20 # You should have received a copy of the GNU Lesser General Public |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
21 # License along with this library; if not, write to the |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
22 # Free Software Foundation, Inc., |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
24 # #################################################################### |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
25 # This is the rio de hola client for FIFE. |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
26 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
27 import sys, os, re, math, random, shutil |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
28 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
29 from fife import fife |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
30 from fife.extensions import pychan |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
31 from fife.extensions.pychan import widgets |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
32 |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
33 class Window(object): |
512
6ddb1eb9dfa6
Added the Scene which loads the town map. It is no longer a black screen demo.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
511
diff
changeset
|
34 def __init__(self, gamecontroller): |
6ddb1eb9dfa6
Added the Scene which loads the town map. It is no longer a black screen demo.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
511
diff
changeset
|
35 self._guicontroller = gamecontroller.guicontroller |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
36 self._gamecontroller = gamecontroller |
512
6ddb1eb9dfa6
Added the Scene which loads the town map. It is no longer a black screen demo.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
511
diff
changeset
|
37 self._settings = gamecontroller.settings |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
38 |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
39 self._widget = None |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
40 |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
41 def _getWidget(self): |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
42 return self._widget |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
43 |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
44 widget = property(_getWidget) |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
45 |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
46 class MainMenu(Window): |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
47 def __init__(self, gamecontroller): |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
48 super(MainMenu, self).__init__(gamecontroller) |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
49 self._widget = pychan.loadXML('gui/mainmenu.xml') |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
50 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
51 self._newgame = self._widget.findChild(name="new_game") |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
52 self._credits = self._widget.findChild(name="credits") |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
53 self._quit = self._widget.findChild(name="quit") |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
54 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
55 self._widget.position = (0,0) |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
56 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
57 eventMap = { |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
58 'new_game': self._gamecontroller.newGame, |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
59 'settings': self._settings.onOptionsPress, |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
60 'credits': self._guicontroller.showCredits, |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
61 'quit': self._gamecontroller.quit, |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
62 } |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
63 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
64 self._widget.mapEvents(eventMap) |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
65 |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
66 class Credits(Window): |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
67 def __init__(self, guicontroller): |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
68 super(Credits, self).__init__(gamecontroller) |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
69 self._widget = pychan.loadXML('gui/credits.xml') |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
70 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
71 eventMap = { |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
72 'close': self._guicontroller.hideCredits, |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
73 } |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
74 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
75 self._widget.mapEvents(eventMap) |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
76 |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
77 class QuestDialog(Window): |
521
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
78 def __init__(self, guicontroller, questgiver): |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
79 super(QuestDialog, self).__init__(guicontroller) |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
80 self._widget = pychan.loadXML('gui/quest.xml') |
521
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
81 self._questgiver = questgiver |
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
82 self._quest = questgiver.getNextQuest() |
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
83 |
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
84 self._questname = self._widget.findChild(name="questname") |
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
85 self._questname.text = unicode(self._quest.name) |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
86 |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
87 self._questtext = self._widget.findChild(name="questtext") |
521
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
88 self._questtext.text = unicode(self._quest.text) |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
89 |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
90 eventMap = { |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
91 'accept': self.questAccepted, |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
92 'decline': self._widget.hide, |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
93 } |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
94 |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
95 self._widget.mapEvents(eventMap) |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
96 |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
97 def questAccepted(self): |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
98 print "quest has been accepted" |
521
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
99 self._questgiver.activateQuest(self._quest) |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
100 self._widget.hide() |
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
101 |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
102 class GUIController(object): |
512
6ddb1eb9dfa6
Added the Scene which loads the town map. It is no longer a black screen demo.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
511
diff
changeset
|
103 def __init__(self, gamecontroller): |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
104 self._gamecontroller = gamecontroller |
512
6ddb1eb9dfa6
Added the Scene which loads the town map. It is no longer a black screen demo.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
511
diff
changeset
|
105 self._engine = gamecontroller.engine |
6ddb1eb9dfa6
Added the Scene which loads the town map. It is no longer a black screen demo.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
511
diff
changeset
|
106 self._settings = gamecontroller.settings |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
107 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
108 self._mainmenu = None |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
109 self._credits = None |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
110 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
111 def showMainMenu(self): |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
112 if self._mainmenu: |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
113 self._mainmenu.widget.show() |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
114 else: |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
115 #load and show the main menu |
512
6ddb1eb9dfa6
Added the Scene which loads the town map. It is no longer a black screen demo.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
511
diff
changeset
|
116 self._mainmenu = MainMenu(self._gamecontroller) |
511
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
117 self._mainmenu.widget.show() |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
118 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
119 def hideMainMenu(self): |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
120 if self._mainmenu: |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
121 self._mainmenu.widget.hide() |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
122 self._mainmenu = None |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
123 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
124 def showCredits(self): |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
125 if self._credits: |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
126 self._credits.widget.show() |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
127 else: |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
128 self._credits = Credits(self) |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
129 self._credits.widget.show() |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
130 |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
131 def hideCredits(self): |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
132 if self._credits: |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
133 self._credits.widget.hide() |
773dc1dbe69d
Forgot to add guicontroller.py in my last commit.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
134 self._credits = None |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
135 |
521
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
136 def showQuestDialog(self, questgiver): |
494c60cf61cf
Player can now receive a quest, accept it, and complete it. Quests do not have any requirements (i.e. bring me back an item.. etc etc) to be completed at this time.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
520
diff
changeset
|
137 questdlg = QuestDialog(self._gamecontroller, questgiver) |
520
b6bd314df28a
Added a quest dialog.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
512
diff
changeset
|
138 questdlg.widget.show() |