# HG changeset patch
# User prock@33b003aa-7bff-0310-803a-e67f0ece8222
# Date 1274389943 0
# Node ID cd959b05a262d7e8763a4865b05131b90657ddcc
# Parent 3951042a701e89290517553a89ffaafb136d0383
There is now a main menu. You can also view the credits. Taking a screenshot and opening the console should also work.
diff -r 3951042a701e -r cd959b05a262 demos/rpg/gui/credits.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/rpg/gui/credits.txt Thu May 20 21:12:23 2010 +0000
@@ -0,0 +1,11 @@
+--== FIFE RPG Demo ==-
+
+This demo was created by the FIFE team to show the
+versatility of the FIFEngine. We hope that it
+will attract some new projects to use FIFE so we
+can grow our community!
+
+Thanks for checking this demo out,
+
+The FIFE team!
+
diff -r 3951042a701e -r cd959b05a262 demos/rpg/gui/credits.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/rpg/gui/credits.xml Thu May 20 21:12:23 2010 +0000
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 3951042a701e -r cd959b05a262 demos/rpg/gui/mainmenu.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demos/rpg/gui/mainmenu.xml Thu May 20 21:12:23 2010 +0000
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 3951042a701e -r cd959b05a262 demos/rpg/scripts/gamecontroller.py
--- a/demos/rpg/scripts/gamecontroller.py Thu May 20 19:55:19 2010 +0000
+++ b/demos/rpg/scripts/gamecontroller.py Thu May 20 21:12:23 2010 +0000
@@ -28,11 +28,30 @@
from fife import fife
+from scripts.guicontroller import GUIController
+
class GameController(object):
def __init__(self, application, engine, settings):
self._application = application
self._engine = engine
self._settings = settings
+ self._guicontroller = GUIController(self, self._engine, self._settings)
+
+ self._guicontroller.showMainMenu()
+
+ def onConsoleCommand(self, command):
+ """
+ Might be useful if you want to have the game parse a command
+ """
+ result = ""
+ return result
+
+ def newGame(self):
+ pass
+
+ def quit(self):
+ self._application.requestQuit()
+
def pump(self):
pass
diff -r 3951042a701e -r cd959b05a262 demos/rpg/scripts/rpg.py
--- a/demos/rpg/scripts/rpg.py Thu May 20 19:55:19 2010 +0000
+++ b/demos/rpg/scripts/rpg.py Thu May 20 21:12:23 2010 +0000
@@ -64,10 +64,10 @@
self.quit = True
evt.consume()
elif keyval == fife.Key.F10:
- self.engine.getGuiManager().getConsole().toggleShowHide()
+ self._engine.getGuiManager().getConsole().toggleShowHide()
evt.consume()
elif keystr == 'p':
- self.engine.getRenderBackend().captureScreen('screenshot.png')
+ self._engine.getRenderBackend().captureScreen('screenshot.png')
evt.consume()
def onCommand(self, command):
@@ -81,11 +81,11 @@
self.quit = True
result = 'quitting'
elif command.lower() in ( 'help', 'help()' ):
- self.engine.getGuiManager().getConsole().println( open( 'misc/infotext.txt', 'r' ).read() )
+ self._engine.getGuiManager().getConsole().println( open( 'misc/infotext.txt', 'r' ).read() )
result = "-- End of help --"
else:
pass
- #result = self.world.onConsoleCommand(command)
+ result = self._gamecontroller.onConsoleCommand(command)
if not result:
try:
result = str(eval(command))