ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/pclient
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/pclient (file contents):
Revision 1.160 by root, Sat Apr 22 23:11:34 2006 UTC vs.
Revision 1.165 by elmex, Sun Apr 23 01:46:20 2006 UTC

126 my ($self, $value) = @_; 126 my ($self, $value) = @_;
127 $CFG->{fullscreen} = $value; 127 $CFG->{fullscreen} = $value;
128 }); 128 });
129 129
130 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly"); 130 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly");
131 $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{fast}, connect_changed => sub { 131 $table->add (1, $row++, new CFClient::UI::CheckBox
132 state => $CFG->{fast},
133 tooltip => "Lower the visual quality considerably to speed up rendering.",
134 connect_changed => sub {
132 my ($self, $value) = @_; 135 my ($self, $value) = @_;
133 $CFG->{fast} = $value; 136 $CFG->{fast} = $value;
137 }
134 }); 138 );
135 139
136 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War"); 140 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War");
137 $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{fow_enable}, connect_changed => sub { 141 $table->add (1, $row++, new CFClient::UI::CheckBox
142 state => $CFG->{fow_enable},
143 tooltip => "Fog-of-War marks areas that cannot be seen by the player",
144 connect_changed => sub {
138 my ($self, $value) = @_; 145 my ($self, $value) = @_;
139 $CFG->{fow_enable} = $value; 146 $CFG->{fow_enable} = $value;
147 }
140 }); 148 );
141 149
142 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity"); 150 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity");
143 $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{fow_intensity}, 0, 1 + 0.001, 0.001], connect_changed => sub { 151 $table->add (1, $row++, new CFClient::UI::Slider
152 range => [$CFG->{fow_intensity}, 0, 1 + 0.001, 0.001],
153 tooltip => "The higher the intensity, the lighter the Fog-of-War color",
154 connect_changed => sub {
144 my ($self, $value) = @_; 155 my ($self, $value) = @_;
145 $CFG->{fow_intensity} = $value; 156 $CFG->{fow_intensity} = $value;
157 }
146 }); 158 );
147 159
148 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth"); 160 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth");
149 $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{fow_smooth}, connect_changed => sub { 161 $table->add (1, $row++, new CFClient::UI::CheckBox
162 state => $CFG->{fow_smooth},
163 tooltip => "Smooth the Fog-of-War a bit to make it more realistic",
164 connect_changed => sub {
150 my ($self, $value) = @_; 165 my ($self, $value) = @_;
151 $CFG->{fow_smooth} = $value; 166 $CFG->{fow_smooth} = $value;
152 status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2; 167 status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2;
168 }
153 }); 169 );
154 170
155 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize"); 171 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "GUI Fontsize");
156 $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gui_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { 172 $table->add (1, $row++, new CFClient::UI::Slider
173 range => [$CFG->{gui_fontsize}, 0.5, 2, 0.1],
174 tooltip => "The font size used by most GUI elements",
175 connect_changed => sub {
157 $CFG->{gui_fontsize} = 0.1 * int $_[1] * 10; 176 $CFG->{gui_fontsize} = 0.1 * int $_[1] * 10;
158# $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize}; 177# $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize};
178 }
159 }); 179 );
160 180
161 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Server Log Fontsize"); 181 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Server Log Fontsize");
162 $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{log_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { 182 $table->add (1, $row++, new CFClient::UI::Slider
183 range => [$CFG->{log_fontsize}, 0.5, 2, 0.1],
184 tooltip => "The font size used by the server log window only",
185 connect_changed => sub {
163 $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = 0.1 * int $_[1] * 10); 186 $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = 0.1 * int $_[1] * 10);
187 }
164 }); 188 );
165 189
166 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize"); 190 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Stats Fontsize");
167 $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{stat_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { 191
192 $table->add (1, $row++, new CFClient::UI::Slider
193 range => [$CFG->{stat_fontsize}, 0.5, 2, 0.1],
194 tooltip => "The font size used by the statistics window only",
195 connect_changed => sub {
168 $CFG->{stat_fontsize} = 0.1 * int $_[1] * 10; 196 $CFG->{stat_fontsize} = 0.1 * int $_[1] * 10;
169 &set_stats_window_fontsize; 197 &set_stats_window_fontsize;
198 }
170 }); 199 );
171 200
172 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge width"); 201 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge size");
173 $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gauge_w_size}, 0.1, 0.5, 0.02], connect_changed => sub { 202 $table->add (1, $row++, new CFClient::UI::Slider
174 $CFG->{gauge_w_size} = $_[1]; 203 range => [$CFG->{gauge_size}, 0.2, 0.8, 0.02],
175 my $h = int ($HEIGHT * $CFG->{gauge_size}); 204 tooltip => "Adjust the size of the stats gauges at the bottom right",
176 my $w = int ($WIDTH * $CFG->{gauge_w_size}); 205 connect_changed => sub {
177 $GAUGES->{win}->set_size ($w, $h);
178 $GAUGES->{win}->{y} = $HEIGHT - $h;
179 $GAUGES->{win}->{x} = $WIDTH - $w;
180 $GAUGES->{win}->update;
181 });
182
183 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge height");
184 $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gauge_size}, 0.2, 0.8, 0.02], connect_changed => sub {
185 $CFG->{gauge_size} = $_[1]; 206 $CFG->{gauge_size} = $_[1];
186 my $h = int ($HEIGHT * $CFG->{gauge_size}); 207 my $h = int $HEIGHT * $CFG->{gauge_size};
187 my $w = int ($WIDTH * $CFG->{gauge_w_size});
188 $GAUGES->{win}->set_size ($w, $h); 208 $GAUGES->{win}->set_size ($WIDTH, $h);
189 $GAUGES->{win}->{y} = $HEIGHT - $h; 209 $GAUGES->{win}->move (0, $HEIGHT - $h);
190 $GAUGES->{win}->{x} = $WIDTH - $w; 210 }
191 $GAUGES->{win}->update;
192 }); 211 );
193
194 212
195 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize"); 213 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Gauge fontsize");
196 $table->add (1, $row++, new CFClient::UI::Slider range => [$CFG->{gauge_fontsize}, 0.7, 1.7, 0.1], connect_changed => sub { 214 $table->add (1, $row++, new CFClient::UI::Slider
215 range => [$CFG->{gauge_fontsize}, 0.5, 2.0, 0.1],
216 connect_changed => sub {
197 $CFG->{gauge_fontsize} = 0.1 * int $_[1] * 10; 217 $CFG->{gauge_fontsize} = 0.1 * int $_[1] * 10;
198 &set_gauge_window_fontsize; 218 &set_gauge_window_fontsize;
199 $GAUGES->{win}->check_size; 219 #$GAUGES->{win}->check_size;
200 $GAUGES->{win}->update; 220 #$GAUGES->{win}->update;
221 }
201 }); 222 );
202 223
203 224 $table->add (1, $row++, new CFClient::UI::Button
204 225 expand => 1, align => 0, text => "Apply",
205 $table->add (1, $row++, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { 226 tooltip => "Apply the video settings (unless they are auto-apply)",
227 connect_activate => sub {
206 video_shutdown (); 228 video_shutdown ();
207 video_init (); 229 video_init ();
230 }
208 }); 231 );
209 232
210 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable"); 233 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable");
211 $table->add (1, $row++, new CFClient::UI::CheckBox state => $CFG->{audio_enable}, connect_changed => sub { 234 $table->add (1, $row++, new CFClient::UI::CheckBox
235 state => $CFG->{audio_enable},
236 tooltip => "If enabled, sound effects and music will be played. If disabled, no audio will be used and the soundcard will not be opened.",
237 connect_changed => sub {
212 $CFG->{audio_enable} = $_[1]; 238 $CFG->{audio_enable} = $_[1];
239 }
213 }); 240 );
214# $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume"); 241# $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume");
215# $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], connect_changed => sub { 242# $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], connect_changed => sub {
216# $CFG->{effects_volume} = $_[1]; 243# $CFG->{effects_volume} = $_[1];
217# }); 244# });
218 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music"); 245 $table->add (0, $row, new CFClient::UI::Label valign => 0, align => 1, text => "Background Music");
219 $table->add (1, $row++, my $hbox = new CFClient::UI::HBox); 246 $table->add (1, $row++, my $hbox = new CFClient::UI::HBox);
220 $hbox->add (new CFClient::UI::CheckBox expand => 1, state => $CFG->{bgm_enable}, connect_changed => sub { 247 $hbox->add (new CFClient::UI::CheckBox
248 expand => 1, state => $CFG->{bgm_enable},
249 tooltip => "Enable background music playing",
250 connect_changed => sub {
221 $CFG->{bgm_enable} = $_[1]; 251 $CFG->{bgm_enable} = $_[1];
252 }
222 }); 253 );
223 $hbox->add (new CFClient::UI::Slider expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0.1], connect_changed => sub { 254 $hbox->add (new CFClient::UI::Slider
255 expand => 1, range => [$CFG->{bgm_volume}, 0, 1, 0.1],
256 tooltip => "The volume of the background music",
257 connect_changed => sub {
224 $CFG->{bgm_volume} = $_[1]; 258 $CFG->{bgm_volume} = $_[1];
225 CFClient::MixMusic::volume $_[1] * 128; 259 CFClient::MixMusic::volume $_[1] * 128;
260 }
226 }); 261 );
227 262
228 $table->add (1, $row++, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub { 263 $table->add (1, $row++, new CFClient::UI::Button
264 expand => 1, align => 0, text => "Apply",
265 tooltip => "Apply the audio settings that are not auto-apply",
266 connect_activate => sub {
229 audio_shutdown (); 267 audio_shutdown ();
230 audio_init (); 268 audio_init ();
269 }
231 }); 270 );
232 271
233 $dialog 272 $dialog
234} 273}
235 274
236sub set_stats_window_fontsize { 275sub set_stats_window_fontsize {
245 } 284 }
246} 285}
247 286
248sub make_gauge_window { 287sub make_gauge_window {
249 my $gh = int ($HEIGHT * $CFG->{gauge_size}); 288 my $gh = int ($HEIGHT * $CFG->{gauge_size});
250 my $gw = int ($WIDTH * $CFG->{gauge_w_size}); 289# my $gw = int ($WIDTH * $CFG->{gauge_w_size});
251 290
252 my $win = new CFClient::UI::Frame ( 291 my $win = new CFClient::UI::Frame (
253 y => $HEIGHT - $gh, x => $WIDTH - $gw, req_w => $gw, req_h => $gh 292 y => $HEIGHT - $gh, x => 0, req_w => $WIDTH, req_h => $gh
254 ); 293 );
255 $win->add (my $vb = new CFClient::UI::VBox); 294 $win->add (my $vb = new CFClient::UI::VBox);
256 295
257 $vb->add (my $hb = new CFClient::UI::HBox expand => 1); 296 $vb->add (my $hbg = new CFClient::UI::HBox expand => 1);
297
298
299 $hbg->add (new CFClient::UI::Empty expand => 1);
300 $hbg->add (my $hb = new CFClient::UI::HBox);
258 $hb->add (my $hg = new CFClient::UI::Gauge type => 'hp', expand => 1); 301 $hb->add (my $hg = new CFClient::UI::Gauge type => 'hp');
259 $hb->add (my $mg = new CFClient::UI::Gauge type => 'mana', expand => 1); 302 $hb->add (my $mg = new CFClient::UI::Gauge type => 'mana');
260 $hb->add (my $gg = new CFClient::UI::Gauge type => 'grace', expand => 1); 303 $hb->add (my $gg = new CFClient::UI::Gauge type => 'grace');
261 $hb->add (my $fg = new CFClient::UI::Gauge type => 'food', expand => 1); 304 $hb->add (my $fg = new CFClient::UI::Gauge type => 'food');
305
262 $vb->add (my $exp = new CFClient::UI::Label valign => 0, align => -1, text => "XP:"); 306 $vb->add (my $exp = new CFClient::UI::Label valign => 0, align => 1, text => "XP:");
263 $vb->add (my $lvl = new CFClient::UI::Label valign => 0, align => -1, text => "Lvl:"); 307# $vb->add (my $lvl = new CFClient::UI::Label valign => 0, align => 1, text => "Lvl:");
264 $vb->add (my $rng = new CFClient::UI::Label valign => 0, align => -1, text => "Rng:"); 308 $vb->add (my $rng = new CFClient::UI::Label valign => 0, align => 1, text => "Rng:");
265 309
266 310
267 $GAUGES = { 311 $GAUGES = {
268 exp => $exp, lvl => $lvl, win => $win, range => $rng, 312 exp => $exp,# lvl => $lvl,
313 win => $win, range => $rng,
269 food => $fg, mana => $mg, hp => $hg, grace => $gg 314 food => $fg, mana => $mg, hp => $hg, grace => $gg
270 }; 315 };
271 $win 316 $win
272} 317}
273 318
320 365
321 for (qw/slow holyw conf fire depl magic 366 for (qw/slow holyw conf fire depl magic
322 drain acid pois para deat phys 367 drain acid pois para deat phys
323 blind fear tund elec cold ghit/) 368 blind fear tund elec cold ghit/)
324 { 369 {
325 $tbl2->add ($col , $row, 370 $tbl2->add ($col, $row,
326 $STATWIDS->{"res_$_"} = 371 $STATWIDS->{"res_$_"} =
327 new CFClient::UI::Label text => "0", align => +1, valign => 0 372 new CFClient::UI::Label text => "0", align => +1, valign => 0
328 ); 373 );
329 $tbl2->add ($col + 1, $row, new CFClient::UI::Image image => "ui/resist/resist_$_.png"); 374 $tbl2->add ($col + 1, $row, new CFClient::UI::Image image => "ui/resist/resist_$_.png");
330 375
356 401
357 $GAUGES->{hp} ->set_value ($hp, $hp_m); 402 $GAUGES->{hp} ->set_value ($hp, $hp_m);
358 $GAUGES->{mana} ->set_value ($sp, $sp_m); 403 $GAUGES->{mana} ->set_value ($sp, $sp_m);
359 $GAUGES->{food} ->set_value ($fo, $fo_m); 404 $GAUGES->{food} ->set_value ($fo, $fo_m);
360 $GAUGES->{grace} ->set_value ($gr, $gr_m); 405 $GAUGES->{grace} ->set_value ($gr, $gr_m);
361 $GAUGES->{exp} ->set_text ("XP: " . ($stats->{11} || $stats->{28})); 406 $GAUGES->{exp} ->set_text ("XP: " . ($stats->{11} || $stats->{28}) * 1
407 ." LVL: " . $stats->{12} * 1);
362 my $rng = $stats->{20}; 408 my $rng = $stats->{20};
363 $rng =~ s/^Range: //; # thank you so much dear server 409 $rng =~ s/^Range: //; # thank you so much dear server
364 $GAUGES->{range} ->set_text ("Rng: " . $rng); 410 $GAUGES->{range} ->set_text ("Rng: " . $rng);
365 $GAUGES->{lvl} ->set_text ("LVL: " . $stats->{12}); 411# $GAUGES->{lvl} ->set_text ("LVL: " . $stats->{12});
412 my $title = $stats->{21};
413 $title =~ s/^Player: //;
366 $STATWIDS->{title} ->set_text ("Title: " . $stats->{21}); 414 $STATWIDS->{title} ->set_text ("Title: " . $title);
367 415
368 if (0) { # this code can vanish, just wanted to preserver it for a checkin 416 if (0) { # this code can vanish, just wanted to preserver it for a checkin
369 $STATWIDS->{st_str} ->set_text (sprintf "S%d", $stats->{5}); 417 $STATWIDS->{st_str} ->set_text (sprintf "S%d", $stats->{5});
370 $STATWIDS->{st_dex} ->set_text (sprintf "D%d", $stats->{8}); 418 $STATWIDS->{st_dex} ->set_text (sprintf "D%d", $stats->{8});
371 $STATWIDS->{st_con} ->set_text (sprintf "Co%d", $stats->{9}); 419 $STATWIDS->{st_con} ->set_text (sprintf "Co%d", $stats->{9});
408 pois => 109, 456 pois => 109,
409 slow => 110, 457 slow => 110,
410 para => 111, 458 para => 111,
411 tund => 112, 459 tund => 112,
412 fear => 113, 460 fear => 113,
461 depl => 113,
413 deat => 115, 462 deat => 115,
414 holyw => 116, 463 holyw => 116,
415 blind => 117 464 blind => 117
416 ); 465 );
417 466
1114 fow_smooth => 0, 1163 fow_smooth => 0,
1115 gui_fontsize => 1, 1164 gui_fontsize => 1,
1116 log_fontsize => 1, 1165 log_fontsize => 1,
1117 gauge_fontsize => 1, 1166 gauge_fontsize => 1,
1118 gauge_size => 0.35, 1167 gauge_size => 0.35,
1119 gauge_w_size => 0.14,
1120 stat_fontsize => 1, 1168 stat_fontsize => 1,
1121 mapsize => 100, 1169 mapsize => 100,
1122 host => "crossfire.schmorp.de", 1170 host => "crossfire.schmorp.de",
1123 say_command => 'say', 1171 say_command => 'say',
1124 audio_enable => 1, 1172 audio_enable => 1,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines