--- deliantra/Deliantra-Client/bin/deliantra 2007/12/26 21:03:21 1.18
+++ deliantra/Deliantra-Client/bin/deliantra 2008/01/06 17:40:45 1.25
@@ -80,7 +80,7 @@
# prepend private library directory
BEGIN {
for (grep !ref, @INC) {
- my $path = "$_/Deliantra/Client/private/dc";
+ my $path = "$_/Deliantra/Client/private";
if (-d $path) {
unshift @INC, $path;
last;
@@ -110,8 +110,10 @@
use DC::UI::Inventory;
use DC::UI::SpellList;
use DC::UI::Dockable;
+use DC::UI::Dockbar;
use DC::UI::MessageWindow;
use DC::UI::ChatView;
+use DC::MessageDistributor;
use DC::Pod;
use DC::MapWidget;
use DC::Macro;
@@ -124,7 +126,6 @@
};
my $MAX_FPS = 60;
-my $MIN_FPS = 5; # unused as of yet
our $META_SERVER = "http://metaserver.schmorp.de/current.json";
@@ -181,6 +182,7 @@
our $HELP_WINDOW;
our $MESSAGE_WINDOW;
+our $MESSAGE_DIST;
our $FLOORBOX;
our $GAUGES;
our $STATWIDS;
@@ -207,7 +209,7 @@
}
sub message {
- $MESSAGE_WINDOW->message (@_);
+ $MESSAGE_DIST->message (@_);
}
#############################################################################
@@ -656,7 +658,6 @@
my ($name, $id) = @$_;
$hbox->add (new DC::UI::Label
markup => "$conn->{stat}{$id} $name",
- align => 0,
expand => 1,
can_events => 1,
can_hover => 1,
@@ -772,8 +773,8 @@
my $row = 0;
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "OpenGL Info");
- $table->add_at (1, $row++, new DC::UI::Label valign => 0, fontsize => 0.8, text => DC::OpenGL::gl_vendor . ", " . DC::OpenGL::gl_version,
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "OpenGL Info");
+ $table->add_at (1, $row++, new DC::UI::Label fontsize => 0.8, text => DC::OpenGL::gl_vendor . ", " . DC::OpenGL::gl_version,
can_events => 1,
tooltip => "" . (DC::OpenGL::gl_extensions) . "");
@@ -781,14 +782,14 @@
"Video Mode. The video mode to use for fullscreen (and the window size for windowed operation). "
. "The format is width x height \@ depth-per-channel + alpha-channel.";
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Video Mode");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Video Mode");
$table->add_at (1, $row++, my $hbox = new DC::UI::HBox);
$hbox->add (my $mode_slider = new DC::UI::Slider
force_w => $WIDTH * 0.1, expand => 1, range => [$CFG->{sdl_mode}, 0, $#SDL_MODES, 0, 1],
tooltip => $vidmode_tooltip);
$hbox->add (my $mode_label = new DC::UI::Label
- align => 0, valign => 0, height => 0.8, template => "9999x9999@9+9",
+ height => 0.8, template => "9999x9999@9+9",
can_events => 1, tooltip => $vidmode_tooltip);
$mode_slider->connect (changed => sub {
@@ -799,17 +800,17 @@
});
$mode_slider->emit (changed => $mode_slider->{range}[0]);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fullscreen");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fullscreen");
$table->add_at (1, $row++, $FULLSCREEN_ENABLE = new DC::UI::CheckBox
state => $CFG->{fullscreen},
tooltip => "Bring the client into fullscreen mode.",
on_changed => sub { my ($self, $value) = @_; $CFG->{fullscreen} = $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Force OpenGL 1.1");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Force OpenGL 1.1");
$table->add_at (1, $row++, new DC::UI::CheckBox
state => $CFG->{force_opengl11},
- tooltip => "Limit CFPlus to use OpenGL 1.1 features only. This will normally result in "
+ tooltip => "Limit Deliantra to use OpenGL 1.1 features only. This will normally result in "
. "higher memory usage and slower performance. It will, however, help tremendously on "
. "cards that claim to support a feature but fall back to software rendering. "
. "Nvidia Geforce FX cards are known to claim features the hardware doesn't support, "
@@ -818,7 +819,7 @@
on_changed => sub { my ($self, $value) = @_; $CFG->{force_opengl11} = $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Compress Textures");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Compress Textures");
$table->add_at (1, $row++, new DC::UI::CheckBox
state => $CFG->{texture_compression},
tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but "
@@ -828,14 +829,14 @@
on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fast & Ugly");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fast & Ugly");
$table->add_at (1, $row++, new DC::UI::CheckBox
state => $CFG->{fast},
tooltip => "Lower the visual quality considerably to speed up rendering.",
on_changed => sub { my ($self, $value) = @_; $CFG->{fast} = $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "GUI Fontsize");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "GUI Fontsize");
$table->add_at (1, $row++, new DC::UI::Slider
range => [$CFG->{gui_fontsize}, 0.5, 2, 0, 0.1],
tooltip => "The base font size used by most GUI elements that do not have their own setting.",
@@ -843,7 +844,7 @@
);
$table->add_at (1, $row++, new DC::UI::Button
- expand => 1, align => 0, text => "Apply",
+ expand => 1, text => "Apply",
tooltip => "Apply the video settings above.",
on_activate => sub {
video_shutdown ();
@@ -852,14 +853,14 @@
}
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Map Scale");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Map Scale");
$table->add_at (1, $row++, new DC::UI::Slider
range => [(log $CFG->{map_scale}) / (log 2), -3, 1, 0, 1],
tooltip => "Enlarge or shrink the displayed map. Changes are instant.",
on_changed => sub { my ($self, $value) = @_; $CFG->{map_scale} = 2 ** $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Map Smoothing");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Map Smoothing");
$table->add_at (1, $row++, new DC::UI::CheckBox
state => $CFG->{map_smoothing},
tooltip => "Map Smoothing tries to make tile borders less square. "
@@ -868,29 +869,29 @@
on_changed => sub { my ($self, $value) = @_; $CFG->{map_smoothing} = $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Fog of War");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fog of War");
$table->add_at (1, $row++, new DC::UI::CheckBox
state => $CFG->{fow_enable},
tooltip => "Fog-of-War marks areas that cannot be seen by the player. Changes are instant.",
on_changed => sub { my ($self, $value) = @_; $CFG->{fow_enable} = $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "FoW Intensity");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "FoW Intensity");
$table->add_at (1, $row++, new DC::UI::Slider
range => [$CFG->{fow_intensity}, 0, 1, 0, 1 / 256],
tooltip => "Fog of War Lightness. The higher the intensity, the lighter the Fog-of-War color. Changes are instant.",
on_changed => sub { my ($self, $value) = @_; $CFG->{fow_intensity} = $value; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Message Fontsize");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Message Fontsize");
$table->add_at (1, $row++, new DC::UI::Slider
range => [$CFG->{log_fontsize}, 0.5, 2, 0, 0.1],
tooltip => "The font size used by the message/server log window only. Changes are instant, "
. "but you still need to press apply to correctly re-layout the widget.",
- on_changed => sub { $MESSAGE_WINDOW->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 },
+ on_changed => sub { $MESSAGE_DIST->set_fontsize ($CFG->{log_fontsize} = $_[1]); 0 },
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Gauge fontsize");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge fontsize");
$table->add_at (1, $row++, new DC::UI::Slider
range => [$CFG->{gauge_fontsize}, 0.5, 2, 0, 0.1],
tooltip => "Adjusts the fontsize of the gauges at the bottom right. Changes are instant.",
@@ -901,7 +902,7 @@
}
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Gauge size");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Gauge size");
$table->add_at (1, $row++, new DC::UI::Slider
range => [$CFG->{gauge_size}, 0.2, 0.8],
tooltip => "Adjust the size of the stats gauges at the bottom right. Changes are instant.",
@@ -945,14 +946,14 @@
my $row = 0;
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Audio Enable");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Audio Enable");
$table->add_at (1, $row++, new DC::UI::CheckBox
state => $CFG->{audio_enable},
tooltip => "Master Audio Enable. If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.",
on_changed => sub { $CFG->{audio_enable} = $_[1]; 1 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Sound Effects");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Sound Effects");
$table->add_at (1, $row, new DC::UI::CheckBox
expand => 1, state => $CFG->{effects_enable},
tooltip => "If enabled, sound effects are enabled. If disabled, no sound effects will be played.",
@@ -969,7 +970,7 @@
on_changed => sub { $CFG->{effects_volume} = $_[1]; 1 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Background Music");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Background Music");
$table->add_at (1, $row, new DC::UI::CheckBox
expand => 1, state => $CFG->{bgm_enable},
tooltip => "If enabled, playing of background music is enabled. If disabled, no background music will be played.",
@@ -986,7 +987,7 @@
on_changed => sub { $CFG->{bgm_volume} = $_[1]; audio_music_update_volume; 0 }
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Frequency");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Frequency");
$table->add_at (1, $row++, new DC::UI::Selector
c_colspan => 2, expand => 1,
value => $CFG->{audio_hw_frequency},
@@ -1005,7 +1006,7 @@
}
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Channels");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Channels");
$table->add_at (1, $row++, new DC::UI::Selector
c_colspan => 2, expand => 1,
value => $CFG->{audio_hw_channels},
@@ -1024,7 +1025,7 @@
}
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Latency");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Latency");
$table->add_at (1, $row++, $AUDIO_HW_CHUNKSIZE = new DC::UI::Selector
c_colspan => 2, expand => 1,
value => $CFG->{audio_hw_chunksize},
@@ -1038,7 +1039,7 @@
);
# should really be a slider
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Mixer Voices");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Mixer Voices");
$table->add_at (1, $row++, new DC::UI::ValSlider
c_colspan => 2, expand => 1,
tooltip => "The number of simultaneous sound effects possible. Higher is better, but also more cpu-intensive and might cause stuttering.",
@@ -1054,7 +1055,7 @@
);
$table->add_at (1, $row++, new DC::UI::Button
- c_colspan => 2, expand => 1, align => 0, text => "Apply",
+ c_colspan => 2, expand => 1, text => "Apply",
tooltip => "Apply the audio settings",
on_activate => sub {
audio_shutdown ();
@@ -1114,10 +1115,10 @@
$hb->add (my $gg = new DC::UI::Gauge type => 'grace', tooltip => "#stat_grace");
$hb->add (my $fg = new DC::UI::Gauge type => 'food', tooltip => "#stat_food");
- $vbox->add (my $exp = new DC::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_exp");
+ $vbox->add (my $exp = new DC::UI::Label align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_exp");
$vbox->add (my $prg = new DC::UI::ExperienceProgress);
$vbox->add (my $sklprg = new DC::UI::ExperienceProgress);
- $vbox->add (my $rng = new DC::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_ranged");
+ $vbox->add (my $rng = new DC::UI::Label align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_ranged");
$GAUGES = {
exp => $exp, prg => $prg, sklprg => $sklprg,
@@ -1143,13 +1144,13 @@
$table->add_at (1, 3, new DC::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8; 0 });
$table->add_at (0, 4, new DC::UI::Button text => "die on click(tm)", on_activate => sub { &DC::debug() } );
- $table->add_at (0, 5, new DC::UI::TextEdit text => "line1\0152\0153");#d#
+ $table->add_at (0, 5, new DC::UI::TextEdit text => "line1\0152\0153\nµikachu\nづx゙つ゛");#d#
$table->add_at (7,7, my $t = new DC::UI::Table expand => 0);
- $t->add_at (0,0, new DC::UI::Label text => "a a a a", c_rowspan => 1, c_colspan => 2);
- $t->add_at (2,0, new DC::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1);
- $t->add_at (1,2, new DC::UI::Label text => "c c c c", c_rowspan => 1, c_colspan => 2);
- $t->add_at (0,1, new DC::UI::Label text => "d\nd", c_rowspan => 2, c_colspan => 1);
+ $t->add_at (0,0, new DC::UI::Label text => "a a", c_rowspan => 1, c_colspan => 2);
+ $t->add_at (2,0, new DC::UI::Label text => "b\nb", c_rowspan => 2, c_colspan => 1, ellipsise => 0 );
+ $t->add_at (1,2, new DC::UI::Label text => "c c", c_rowspan => 1, c_colspan => 2);
+ $t->add_at (0,1, new DC::UI::Label text => "d\nd", c_rowspan => 2, c_colspan => 1, ellipsise => 0 );
$t->add_at (1,1, new DC::UI::Label text => "e");
$table->add_at (7, 6, my $c = new DC::UI::Canvas);
@@ -1193,18 +1194,18 @@
child => (my $pi = new DC::UI::VBox),
);
- $pi->add ($STATWIDS->{title} = new DC::UI::Label valign => 0, align => -1, text => "Title:", expand => 1,
+ $pi->add ($STATWIDS->{title} = new DC::UI::Label text => "Title:", expand => 1, align => 0,
can_hover => 1, can_events => 1,
tooltip => "Your name and title. You can change your title by using the title command, if supported by the server.");
- $pi->add ($STATWIDS->{map} = new DC::UI::Label valign => 0, align => -1, text => "Map:", expand => 1,
+ $pi->add ($STATWIDS->{map} = new DC::UI::Label align => 0, text => "Map:", expand => 1,
can_hover => 1, can_events => 1,
tooltip => "The map you are currently on (if supported by the server).");
$pi->add (my $hb0 = new DC::UI::HBox);
- $hb0->add ($STATWIDS->{weight} = new DC::UI::Label valign => 0, align => -1, text => "Weight:", expand => 1,
+ $hb0->add ($STATWIDS->{weight} = new DC::UI::Label text => "Weight:", expand => 1, align => 0,
can_hover => 1, can_events => 1,
tooltip => "The weight of the player including all inventory items.");
- $hb0->add ($STATWIDS->{m_weight} = new DC::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1,
+ $hb0->add ($STATWIDS->{m_weight} = new DC::UI::Label align => 0, text => "Max weight:", expand => 1,
can_hover => 1, can_events => 1,
tooltip => "The weight limit: you cannot carry more than this.");
@@ -1235,16 +1236,16 @@
my ($col, $row, $id, $label, $template) = @$_;
$tbl->add_at ($col , $row, $STATWIDS->{$id} = new DC::UI::Label
- font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0,
- align => +1, template => $template, tooltip => "#stat_$label");
+ font => $FONT_FIXED, can_hover => 1, can_events => 1,
+ align => 1, template => $template, tooltip => "#stat_$label");
$tbl->add_at ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new DC::UI::Label
- font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0,
- align => -1, text => $label, tooltip => "#stat_$label");
+ font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2,
+ align => 0, text => $label, tooltip => "#stat_$label");
}
$vb->add (new DC::UI::FancyFrame
label => "Resistancies",
- child => (my $tbl2 = new DC::UI::Table expand => 1),
+ child => (my $tbl2 = new DC::UI::Table expand => 1, col_expand => [1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0]),
);
my $row = 0;
@@ -1293,13 +1294,12 @@
drain acid pois para deat phys
blind fear tund elec cold ghit/)
{
- $tbl2->add_at ($col, $row,
+ $tbl2->add_at ($col + 2, $row,
$STATWIDS->{"res_$_"} =
new DC::UI::Label
font => $FONT_FIXED,
template => "-100%",
- align => +1,
- valign => 0,
+ align => 1,
can_events => 1,
can_hover => 1,
tooltip => $resist_names{$_}->[1],
@@ -1311,9 +1311,10 @@
path => "ui/resist/resist_$_.png",
tooltip => $resist_names{$_}->[1],
);
- $tbl2->add_at ($col + 2, $row, new DC::UI::Label
+ $tbl2->add_at ($col + 0, $row, new DC::UI::Label
text => $resist_names{$_}->[0],
font => $FONT_FIXED,
+ align => 1,
can_hover => 1,
can_events => 1,
tooltip => $resist_names{$_}->[1],
@@ -1321,7 +1322,7 @@
$row++;
if ($row % 6 == 0) {
- $col += 3;
+ $col += 4;
$row = 0;
}
}
@@ -1377,12 +1378,11 @@
);
my @col = qw(#Users Host Uptime Version Description);
$table->add_at ($_, 0, new DC::UI::Label
- can_hover => 1, can_events => 1,
- align => 0, fg => [1, 1, 0],
+ can_hover => 1, can_events => 1, fg => [1, 1, 0],
text => $col[$_], tooltip => $tip[$_])
for 0 .. $#col;
- my @align = qw(1 0 1 1 -1);
+ my @align = qw(1 0.5 1 1 0);
my $y = 0;
for my $m (@{ $msg->{servers} }) {
@@ -1473,14 +1473,14 @@
child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]),
);
- $table->add_at (0, 4, new DC::UI::Label valign => 0, align => 1, text => "Username");
+ $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username");
$table->add_at (1, 4, new DC::UI::Entry
text => $CFG->{profile}{default}{user},
tooltip => "The name of your character on the server.",
on_changed => sub { my ($self, $value) = @_; $CFG->{profile}{default}{user} = $value; 1 }
);
- $table->add_at (0, 5, new DC::UI::Label valign => 0, align => 1, text => "Password");
+ $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password");
$table->add_at (1, 5, new DC::UI::Entry
text => $CFG->{profile}{default}{password},
hidden => 1,
@@ -1490,7 +1490,6 @@
$table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button
expand => 1,
- align => 0,
text => "Login / Register",
tooltip => "This button will either login to the account configured above or register a new account.",
on_activate => sub {
@@ -1503,7 +1502,7 @@
$vbox->add (new DC::UI::FancyFrame
label => "Registering",
min_h => 200,
- child => (new DC::UI::Label valign => -1, ellipsise => 0,
+ child => (new DC::UI::Label valign => 0, ellipsise => 0,
markup =>
"To register a new account, choose a username that hasn't been taken yet and "
. "try to log-in. Follow the instructions in the Log tab in the message window.",
@@ -1523,7 +1522,7 @@
my $row = 0;
- $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Host:Port");
+ $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Host:Port");
{
$table->add_at (1, $row, my $vbox = new DC::UI::VBox);
@@ -1551,7 +1550,7 @@
}#d#
}
- $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Map Size");
+ $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Map Size");
$table->add_at (1, $row, new DC::UI::Slider
force_w => 100,
range => [$CFG->{mapsize}, 10, 100, 0, 1],
@@ -1562,7 +1561,7 @@
on_changed => sub { my ($self, $value) = @_; $CFG->{mapsize} = $self->{range}[0] = $value = int $value; 1 },
);
- $table->add_at (0, ++$row, new DC::UI::Label valign => 0, align => 1, text => "Output-Rate");
+ $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Output-Rate");
$table->add_at (1, $row, new DC::UI::Entry
text => $CFG->{output_rate},
tooltip => "The maximum bandwidth in bytes per second that the server should not exceed "
@@ -1585,7 +1584,7 @@
my $row = 0;
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Tip of the day");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Tip of the day");
$table->add_at (1, $row++, new DC::UI::CheckBox
state => $CFG->{show_tips},
tooltip => "Show the Tip of the day window at startup?",
@@ -1596,7 +1595,7 @@
}
);
- $table->add_at (0, $row, new DC::UI::Label valign => 0, align => 1, text => "Messages Window Size");
+ $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Messages Window Size");
$table->add_at (1, $row++, my $saycmd = new DC::UI::Entry
text => $CFG->{logview_max_par},
tooltip => "This is maximum number of messages remembered in the Messages window. If the server "
@@ -1604,7 +1603,7 @@
. "computing time. A value of 0 disables this feature, but that is not recommended.",
on_changed => sub {
my ($self, $value) = @_;
- $MESSAGE_WINDOW->set_max_para ($CFG->{logview_max_par} = $value*1);
+ $MESSAGE_DIST->set_max_para ($CFG->{logview_max_par} = $value*1);
0
},
);
@@ -1740,7 +1739,7 @@
my $hb = new DC::UI::HBox homogeneous => 1;
$hb->add (my $vb1 = new DC::UI::VBox);
- $vb1->add (new DC::UI::Label align => 0, text => "Player");
+ $vb1->add (new DC::UI::Label text => "Player");
$vb1->add (my $hb1 = new DC::UI::HBox);
@@ -1760,7 +1759,7 @@
);
$hb1->add (new DC::UI::Label text => "Weight: ", align => 1, expand => 1);
#TODO# update to weigh/maxweight
- $hb1->add ($STATWIDS->{i_weight} = new DC::UI::Label align => -1);
+ $hb1->add ($STATWIDS->{i_weight} = new DC::UI::Label align => 0);
$vb1->add (my $sw1 = new DC::UI::ScrolledWindow expand => 1, scroll_y => 1);
$sw1->add ($INV = new DC::UI::Inventory);
@@ -2174,8 +2173,8 @@
$MAPWIDGET->connect (activate_console => sub {
my ($mapwidget, $preset) = @_;
- $MESSAGE_WINDOW->activate_console ($preset)
- if $MESSAGE_WINDOW;
+ $MESSAGE_DIST->activate_console ($preset)
+ if $MESSAGE_DIST;
});
$MAPWIDGET->show;
$MAPWIDGET->grab_focus;
@@ -2197,7 +2196,8 @@
;
$METASERVER = metaserver_dialog;
- $MESSAGE_WINDOW = new DC::UI::MessageWindow;
+ $MESSAGE_WINDOW = new DC::UI::Dockbar (name => 'message_window', title => 'Messages');
+ $MESSAGE_DIST = new DC::MessageDistributor dockbar => $MESSAGE_WINDOW;
$SETUP_DIALOG->add ($SETUP_NOTEBOOK = new DC::UI::Notebook expand => 1, debug => 1,
filter => new DC::UI::ScrolledWindow expand => 1, scroll_y => 1);
@@ -2296,10 +2296,10 @@
$LAST_REFRESH = $NOW;
}
-my $want_refresh = EV::idle_ns \&force_refresh;
+my $want_refresh = EV::prepare_ns \&force_refresh;
-my $input = EV::periodic 0, 1/60, undef, sub {
- $NOW = time;
+my $input = EV::periodic 0, 1 / $MAX_FPS, undef, sub {
+ $NOW = EV::now;
($SDL_CB{$_->{type}} || sub { warn "unhandled event $_->{type}" })->($_)
for DC::poll_events;