… | |
… | |
2014 | $table->add_at (2, $row++, new DC::UI::Button |
2014 | $table->add_at (2, $row++, new DC::UI::Button |
2015 | text => "Save Now", |
2015 | text => "Save Now", |
2016 | tooltip => "Use this to manually save configuration and UI layout when " |
2016 | tooltip => "Use this to manually save configuration and UI layout when " |
2017 | . "autosave is disabled.", |
2017 | . "autosave is disabled.", |
2018 | on_activate => sub { |
2018 | on_activate => sub { |
2019 | DC::write_cfg; |
2019 | DC::save_cfg; |
2020 | 0 |
2020 | 0 |
2021 | } |
2021 | } |
2022 | ); |
2022 | ); |
2023 | } |
2023 | } |
2024 | |
2024 | |
… | |
… | |
2956 | # due to mac os x + sdl combined braindamage, we need this contortion |
2956 | # due to mac os x + sdl combined braindamage, we need this contortion |
2957 | sub DC::Main::main { |
2957 | sub DC::Main::main { |
2958 | { |
2958 | { |
2959 | DC::Pod::load_docwiki DC::find_rcfile "docwiki.pst"; |
2959 | DC::Pod::load_docwiki DC::find_rcfile "docwiki.pst"; |
2960 | |
2960 | |
2961 | if (-e "$Deliantra::VARDIR/client.cf") { |
2961 | DC::load_cfg; |
2962 | DC::read_cfg "$Deliantra::VARDIR/client.cf"; |
|
|
2963 | } else { |
|
|
2964 | #TODO: compatibility cruft |
|
|
2965 | DC::read_cfg "$Deliantra::OLDDIR/cfplusrc"; |
|
|
2966 | print STDERR "INFO: used old configuration file\n"; |
|
|
2967 | } |
|
|
2968 | |
2962 | |
2969 | DC::DB::Server::run; |
2963 | DC::DB::Server::run; |
2970 | |
2964 | |
2971 | if ($CFG->{db_schema} < 1) { |
2965 | if ($CFG->{db_schema} < 1) { |
2972 | warn "INFO: upgrading database schema from 0 to 1, mapcache and tilecache will be lost\n"; |
2966 | warn "INFO: upgrading database schema from 0 to 1, mapcache and tilecache will be lost\n"; |
2973 | DC::DB::nuke_db; |
2967 | DC::DB::nuke_db; |
2974 | $CFG->{db_schema} = 1; |
2968 | $CFG->{db_schema} = 1; |
2975 | DC::write_cfg; |
2969 | DC::save_cfg; |
2976 | } |
2970 | } |
2977 | |
2971 | |
2978 | DC::upgrade_cfg; |
2972 | DC::upgrade_cfg; |
2979 | |
2973 | |
2980 | DC::DB::open_db; |
2974 | DC::DB::open_db; |
… | |
… | |
3078 | debug_toggle 0; |
3072 | debug_toggle 0; |
3079 | |
3073 | |
3080 | delete $SIG{__DIE__}; |
3074 | delete $SIG{__DIE__}; |
3081 | EV::loop; |
3075 | EV::loop; |
3082 | |
3076 | |
3083 | DC::write_cfg if $CFG->{config_autosave}; |
3077 | DC::save_cfg if $CFG->{config_autosave}; |
3084 | |
3078 | |
3085 | #video_shutdown; |
3079 | #video_shutdown; |
3086 | #audio_shutdown; |
3080 | #audio_shutdown; |
3087 | |
3081 | |
3088 | DC::OpenGL::quit; |
3082 | DC::OpenGL::quit; |