parse settings file
Posted: Sun Oct 03, 2010 11:41 am
My game uses a settings file that looks like this:
I would like to improve that. Does anybody here already have a routine to handle (parse) setting files?
Means like ignoring whitespace before and after the values.
Another option would be to transform the settings to an xml file.
What would you guys recommend?
Code: Select all
# Lost Labyrinth Settings File
# This in only a prototype!!!
# After saving in the game the actual settings file will be here:
# Users Homedirectory + '/.lostlaby'
language = english # english, german, spanish
mydelay = 200 # Messages (5 Digits!)
mydelay2 = 0 # Scrolling (5 Digits!)
mydelay3 = 30 # Mouserefesh (5 Digits!)
mydelay4 = 0 # Animationen (5 Digits!)
joystick = no # yes, no
no_mouse = no # yes, no
windowed = no # yes, no
sound = yes # yes, no
music = yes # yes, no
klicking = yes # yes, no
auto-toggle = no # yes, no
button5 = no # yes, no
jars = yes # yes, noMeans like ignoring whitespace before and after the values.
Another option would be to transform the settings to an xml file.
What would you guys recommend?