--- deliantra/Deliantra-Client/DC.pm 2010/04/24 06:27:40 1.211 +++ deliantra/Deliantra-Client/DC.pm 2012/01/18 00:51:22 1.214 @@ -19,7 +19,7 @@ our $VERSION; BEGIN { - $VERSION = '2.11'; + $VERSION = '3.0'; use XSLoader; XSLoader::load "Deliantra::Client", $VERSION; @@ -38,6 +38,14 @@ use JSON::XS qw(encode_json decode_json); use Guard qw(guard); +# modules to support other DC::* packages +use List::Util (); +use IO::AIO (); +use Coro::AIO (); +use AnyEvent::AIO (); + +use Deliantra::Protocol::Constants (); + =item shorten $string[, $maxlength] =cut @@ -202,6 +210,57 @@ rename "$file~", $file; } +sub upgrade_cfg() { + my %DEF_CFG = ( + config_autosave => 1, + sdl_mode => undef, + fullscreen => 1, + fast => 0, + force_opengl11 => undef, + disable_alpha => 0, + smooth_movement => 1, + smooth_transitions => 1, + texture_compression => 1, + map_scale => 1, + fow_enable => 1, + fow_intensity => 0, + fow_texture => 0, + map_smoothing => 1, + gui_fontsize => 1, + log_fontsize => 0.7, + gauge_fontsize => 1, + gauge_size => 0.35, + stat_fontsize => 0.7, + mapsize => 100, + audio_enable => 1, + audio_hw_channels => 0, + audio_hw_frequency => 0, + audio_hw_chunksize => 0, + audio_mix_channels => 8, + effects_enable => 1, + effects_volume => 1, + bgm_enable => 1, + bgm_volume => 0.5, + output_rate => "", + pickup => Deliantra::Protocol::Constants::PICKUP_SPELLBOOK + | Deliantra::Protocol::Constants::PICKUP_SKILLSCROLL + | Deliantra::Protocol::Constants::PICKUP_VALUABLES, + inv_sort => "mtime", + default => "profile", # default profile + show_tips => 1, + logview_max_par => 1000, + shift_fire_stop => 0, + uitheme => "wood", + map_shift_x => -24, # arbitrary + map_shift_y => +24, # arbitrary + #db_schema => 0, + ); + + while (my ($k, $v) = each %DEF_CFG) { + $::CFG->{$k} = $v unless exists $::CFG->{$k}; + } +} + sub http_proxy { my @proxy = win32_proxy_info;