changeset 6:0897c89da4fe

Using fife settings module again instead of our own.
author Beliar <KarstenBock@gmx.net>
date Mon, 20 Feb 2012 16:50:10 +0100
parents 8da675d9f525
children 211859c249b1
files .hgsubstate parpg.cfg.default parpg.py settings-dist.xml
diffstat 4 files changed, 47 insertions(+), 156 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Thu Jan 12 19:57:38 2012 +0100
+++ b/.hgsubstate	Mon Feb 20 16:50:10 2012 +0100
@@ -1,2 +1,2 @@
 23 data
-a6bbb732b27b902baed40c395c0e494135327869 parpg
+b3b82c2aebee375df6f119b474a22efdf1561483 parpg
--- a/parpg.cfg.default	Thu Jan 12 19:57:38 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-[fife]
-# Options marked with ? are untested/unknown
-
-# Game window's title (string) DO NOT EDIT!
-WindowTitle = PARPG Techdemo 2
-
-# Icon to use for the game window's border (filename) DO NOT EDIT!
-WindowIcon = window_icon.png
-
-# Video driver to use. (?)
-VideoDriver = ""
-
-# Backend to use for graphics (OpenGL|SDL)
-RenderBackend = OpenGL 
-
-# Run the game in fullscreen mode or not. (True|False)
-FullScreen = False
-
-# Screen Resolution's width. Not used if FullScreen is set to False (800|1024|etc)
-ScreenWidth = 800
-
-# Screen Resolution's height. Not used if FullScreen is set to False (600|768|etc)
-ScreenHeight = 600
-
-# Screen DPI? (?)
-BitsPerPixel = 0
-
-# ? (?)
-SDLRemoveFakeAlpha = 1
-
-GLUseFramebuffer = True
-
-GLUseNPOT = True
-
-# The Sensitivity of the mouse. (-0.99 to 10.0)
-MouseSensitivity = 0.0
-
-# Sets whether the mouse should be accelerated. (True|False)
-MouseAcceleration = False
-
-# Subdirectory to load icons from (path)
-IconsPath = icons
-
-# ? ([R, G, B])
-ColorKey = [250, 0, 250]
-
-# ? (True|False)
-ColorKeyEnabled = False
-
-# Turn on sound effects and music (True|False)
-EnableSound = True
-
-# Initial volume of sound effects and music (0.0-100.0?)
-InitialVolume = 5.0
-
-# Characters to use to render fonts. DO NOT EDIT!
-FontGlyphs = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]""
-
-# Subdirectory to load fronts from (path)
-FontsPath = fonts
-
-# Font to load when game starts
-#TODO: make it so that the font name is supplied instead of the filename
-Font = oldtypewriter.ttf
-
-# Size of in-game fonts
-DefaultFontSize = 12
-
-# ? (?)
-LogModules = [controller]
-
-# ? (?)
-PychanDebug = False
-
-# use Psyco Acceperation (True|False)
-UsePsyco = False
-
-# ? (?)
-ProfilingOn = False
-
-# Lighting Model to use (0-2)
-Lighting = 0
-
-[parpg]
-# System directory where all data files are located (path)
-DataPath = "./data"
-
-# System subdirectory to load maps from (path)
-MapsPath = maps
-
-# YAML file that contains the available maps (filename)
-MapsFile = maps.yaml
-
-# Map to load when game starts (filename)
-Map = Mall
-
-# ? (filename)
-AllAgentsFile = all_agents.yaml
-
-# System subdirectory to load objects from (path)
-ObjectsPath = objects
-
-# YAML file that contains the database of availabel objects (filename)
-ObjectDatabaseFile = object_database.yaml
-
-# System subdirectory to load dialogues from (path)
-DialoguesPath = dialogue
-
-# System subdirectory to load quests from (path)
-QuestsPath = quests
-
-# System subdirectory where gui files are loaded from (path)
-GuiPath = gui
-
-# System subdirectory where cursors are loaded from (path)
-CursorPath = cursors
-
-# File to use for default cursor (filename)
-CursorDefault = cursor_plain.png
-
-# File to use for up cursor (filename)
-CursorUp = cursor_up.png
-
-# File to use for right cursor (filename)
-CursorRight = cursor_right.png
-
-# File to use for down cursor (filename)
-CursorDown = cursor_down.png
-
-# File to use for left cursor (filename)
-CursorLeft = cursor_left.png
-
-# how many pixles to move the camera per time frame (digit)
-ScrollSpeed = 1.0
-
-# Player walk speed (digit)
-PCSpeed = 3
--- a/parpg.py	Thu Jan 12 19:57:38 2012 +0100
+++ b/parpg.py	Mon Feb 20 16:50:10 2012 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2 
+#!/usr/bin/env python 
 #   This program is free software: you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation, either version 3 of the License, or
@@ -19,11 +19,7 @@
 
 from parpg.main import main
 
-usage = ('usage: %prog [options] settings_path [system_path user_path]\n\n'
-         'The settings_path argument is mandatory and is the directory in \n'
-         'which your parpg.cfg file is located. Optionally, you may \n'
-         'specify where data files are located (system_path), and where \n'
-         'the user settings and data files should be saved to (user_path)\n\n'
+usage = ('usage: %prog [options]'
          'Example: python %prog .')
 
 parser = OptionParser(description='PARPG Launcher Script', usage=usage)
@@ -33,15 +29,4 @@
                   help='desired output level for log file')
 opts, args = parser.parse_args()
 
-if not args:
-    if path.isfile("./parpg.cfg"):
-        args =(".")
-    elif path.isfile("./parpg.cfg.default"):
-        import shutil
-        shutil.copyfile("./parpg.cfg.default", "./parpg.cfg")
-        args =(".")
-    else:
-        parser.print_help()
-        sys.exit(1)
-
-main(args, opts)
\ No newline at end of file
+main(args, opts)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/settings-dist.xml	Mon Feb 20 16:50:10 2012 +0100
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<Settings>
+  <Module name="FIFE">
+    <Setting name="FullScreen" type="bool"> False </Setting>
+    <Setting name="PlaySounds" type="bool"> True </Setting>
+    <Setting name="RenderBackend" type="str"> OpenGL </Setting>
+    <Setting name="ScreenResolution" type="str">800x600</Setting>
+    <Setting name="BitsPerPixel" type="int"> 0 </Setting>
+    <Setting name="InitialVolume" type="float"> 5.0 </Setting>
+    <Setting name="SDLRemoveFakeAlpha" type="int"> 1 </Setting>
+    <Setting name="GLUseFramebuffer" type="bool"> True </Setting>
+    <Setting name="GLUseNPOT" type="bool"> True </Setting>
+    <Setting name="WindowTitle" type="str"> PARPG </Setting>
+    <Setting name="WindowIcon" type="str">data/gui/icons/window_icon.png</Setting>
+    <Setting name="Font" type="str"> data/fonts/oldtypewriter.ttf </Setting>
+    <Setting name="FontGlyphs" strip="0" type="str"> abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&amp;`'*#=[]" </Setting>
+    <Setting name="DefaultFontSize" type="int"> 12 </Setting>
+    <Setting name="LogModules" type="list"> controller </Setting>
+    <Setting name="PychanDebug" type="bool"> True </Setting>
+    <Setting name="LogToPrompt" type="int"> 1 </Setting>
+    <Setting name="LogToFile" type="int"> 0 </Setting>
+  </Module>
+  <Module name="parpg">
+    <Setting name="DataPath" type="str">data</Setting>
+    <Setting name="MapsPath" type="str">maps</Setting>
+    <Setting name="MapsFile" type="str">maps.yaml</Setting>
+    <Setting name="Map" type="str">Mall</Setting>
+    <Setting name="AllAgentsFile" type="str">all_agents.yaml</Setting>
+    <Setting name="ObjectsPath" type="str">objects</Setting>
+    <Setting name="ObjectDatabaseFile" type="str">object_database.yaml</Setting>
+    <Setting name="DialoguesPath" type="str">dialogue</Setting>
+    <Setting name="QuestsPath" type="str">quests</Setting>
+    <Setting name="GuiPath" type="str">gui</Setting>
+    <Setting name="CursorPath" type="str">cursors</Setting>
+    <Setting name="CursorDefault" type="str">cursor_plain.png</Setting>
+    <Setting name="CursorUp" type="str">cursor_up.png</Setting>
+    <Setting name="CursorRight" type="str">cursor_right.png</Setting>
+    <Setting name="CursorDown" type="str">cursor_down.png</Setting>
+    <Setting name="CursorLeft" type="str">cursor_left.png</Setting>
+    <Setting name="ScrollSpeed" type="float">1.0</Setting>
+    <Setting name="PCSpeed" type="float">1.0</Setting>
+  </Module>
+</Settings>