From 72a1107e594b1745026241d323f9fc44813bd91d Mon Sep 17 00:00:00 2001 From: Alexander Baldeck Date: Sun, 26 Dec 2004 11:39:53 +0000 Subject: - replaced default ini creation routine with new system - testing version of write support for config system --- src/main.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 120fb881..68f5cb2a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -173,25 +173,32 @@ void init_engine() { if ( tmwFile == NULL ) { printf("Can't create %s file. Using Defaults.\n", dir); } else { + fclose(tmwFile); // tmw.ini creation - fprintf(tmwFile, "system=\nkeyboard=en\nlanguage=\ncore_version=" CORE_VERSION "\n\n"); - fprintf(tmwFile, "host=animesites.de\nport=6901\n\n"); - fprintf(tmwFile, "#=Screen mode:\n# = 1 Fullscreen\n# = 2 Windowed\nscreen=2\n"); - fprintf(tmwFile, "# = Sound:\n#=1 enabled\n# = 0 disabled\nsound=0\n"); + config.setValue("system", ""); + config.setValue("keyboard", "en"); + config.setValue("language", ""); + config.setValue("core_version", CORE_VERSION); + + + config.setValue("host", "animesites.de"); + config.setValue("port", 6901); + config.setValue("screen", 1); + config.setValue("sound", 1); + - char * chatlogFilename = new char [400]; #ifdef __USE_UNIX98 + char * chatlogFilename = new char [400]; sprintf(chatlogFilename, "%s/.manaworld/chatlog.txt", userHome); + config.setValue("chatlog", chatlogFilename); + delete chatlogFilename; #else - strcpy(chatlogFilename, "chatlog.txt"); + config.setValue("chatlog", "chatlog.txt"); #endif - fprintf(tmwFile, "# = Chat logfile location:\nchatlog=%s\n", chatlogFilename); - delete chatlogFilename; chatlogFilename = 0; - fprintf(tmwFile, "#= Display strecth mode:\n# = 0 Disabled (Test only)\n# = 1 Normal\n# = 2 SuperEagle\n"); - fprintf(tmwFile, "stretch=1\n\n"); - fprintf(tmwFile, "[login]\nremember=1\nusername=Player\n"); - fclose(tmwFile); + config.setValue("stretch", 1); + config.setValue("remember", 1); + config.setValue("username", "Player"); } } -- cgit v1.2.3-70-g09d2