--- deliantra/Deliantra-Client/bin/pclient 2006/04/12 21:20:42 1.89 +++ deliantra/Deliantra-Client/bin/pclient 2006/04/12 21:35:11 1.90 @@ -21,7 +21,7 @@ our $VERSION = '0.1'; my $MAX_FPS = 60; -my $MIN_FPS = 5; # unused +my $MIN_FPS = 5; # unused as of yet our $FACECACHE; @@ -115,7 +115,13 @@ $CFG->{fast} = $value; }); - $table->add (1, 3, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { + $table->add (0, 2, new CFClient::UI::Label align => 1, text => "Fog of War"); + $table->add (1, 2, new CFClient::UI::Slider range => [$CFG->{fow_intensity}, 0, 1 + 0.001, 0.001], connect_changed => sub { + my ($self, $value) = @_; + $CFG->{fow_intensity} = $value; + }); + + $table->add (1, 4, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { destroy_screen (); init_screen (); }); @@ -256,6 +262,7 @@ glMatrixMode GL_MODELVIEW; glLoadIdentity; + glClearColor +($CFG->{fow_intensity}) x 3, 1; glClear GL_COLOR_BUFFER_BIT; $CFClient::UI::TOPLEVEL->draw; @@ -384,16 +391,21 @@ CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; -$CFG ||= { - width => 640, - height => 480, - fast => 0, - fullscreen => 0, - sdl_mode => 0, - mapsize => 100, - host => "crossfire.schmorp.de", - port => 13327, -}; +my %DEF_CFG = ( + width => 640, + height => 480, + fast => 0, + fow_intensity => 0.45, + fullscreen => 0, + sdl_mode => 0, + mapsize => 100, + host => "crossfire.schmorp.de", + port => 13327, +); + +while (my ($k, $v) = each %DEF_CFG) { + $CFG->{$k} = $v unless exists $CFG->{$k}; +} sdl_init;