grafic options menu [solved]

I want to implement an grafic-menue at startup where the user can choose grafical options (like antialiasing,shadows etc.). Atm i am writing the selected options into a config.prc file. The problem is, the changed options are only read when the game restarts (because the config is only read at restart). I want that option screen at startup and after that the real game should start, but i dont know how to close the optionsscreen and restart the whole engine, so the config is read. Or is there a way to force panda to read a new config-file?

Im sure this should be easy and im missing something…


You can read a new config file, either with an explicit call to loadConfigFile(), or with cpMgr.reloadImplicitPages() (if the file was automatically located by the $PANDA_PRC_DIR or $PANDA_PRC_PATH variables). However, certain config variables don’t take effect even when reloading, such as variables that are used to configure the initial window parameters (once the window is open, it’s too late).

There are different approaches to restarting the whole game. It would be possible to do it without restarting Python, but depending on your needs, it might be easier just to use something like os.system() to start the main part of the game as a separate Python process.


Thank you very very much for your help david, got to put ur name into the credits ;D

i tried the os.system approach but with no success, im doing:

import os

print "hello"
#show config menue and save config file here


but my game does not start, just a black dos-shell pops-up and closes immediately. Am i doing something wrong or should this work?

edit: i see the dos shell is not empty, there is something, but it closes to fast to read ;D

edit2: ok i got it, had to change it to:

import os

print "hello"
#show config menue and save config file here

os.system("start ppython")