--- deliantra/Deliantra-Client/bin/cfplus 2006/06/07 06:28:30 1.64 +++ deliantra/Deliantra-Client/bin/cfplus 2006/06/13 18:14:03 1.72 @@ -86,6 +86,7 @@ our $LOGIN_BUTTON; our $QUIT_DIALOG; our $HOST_ENTRY; +our $SERVER_INFO; our $SETUP_DIALOG; our $SETUP_NOTEBOOK; @@ -364,6 +365,7 @@ $SETUP_NOTEBOOK->set_current_page ($SETUP_SERVER); $SETUP_DIALOG->show; $INV_WINDOW->hide; + $SETUP_SPELLS->clear_spells; return unless $CONN; @@ -627,6 +629,33 @@ $win } +sub debug_setup { + my $table = new CFClient::UI::Table; + + $table->add (0, 0, new CFClient::UI::Label text => "Widget Borders"); + $table->add (1, 0, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 1 }); + $table->add (0, 1, new CFClient::UI::Label text => "Tooltip Widget Info"); + $table->add (1, 1, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 2 }); + $table->add (0, 2, new CFClient::UI::Label text => "Show FPS"); + $table->add (1, 2, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 4 }); + $table->add (0, 3, new CFClient::UI::Label text => "Suppress Tooltips"); + $table->add (1, 3, new CFClient::UI::CheckBox on_changed => sub { $ENV{CFPLUS_DEBUG} ^= 8 }); + + my @default_smooth = (0.05, 0.13, 0.05, 0.13, 0.30, 0.13, 0.05, 0.13, 0.05); + + for my $x (0..2) { + for my $y (0 .. 2) { + $table->add ($x + 3, $y, + new CFClient::UI::Entry + text => $default_smooth[$x * 3 + $y], + on_changed => sub { $MAP->{smooth_matrix}[$x * 3 + $y] = $_[1] if $MAP; 0 }, + ); + } + } + + + $table +} sub stats_window { my $tgw = new CFClient::UI::FancyFrame @@ -789,26 +818,25 @@ $STATWIDS->{m_weight}->set_text (sprintf "Max weight: %.1fkg", $stats->{+CS_STAT_WEIGHT_LIM} / 1000); - # TODO: replace by CS_STAT_RES_xxx constants my %tbl = ( - phys => 100, - magic => 101, - fire => 102, - elec => 103, - cold => 104, - conf => 105, - acid => 106, - drain => 107, - ghit => 108, - pois => 109, - slow => 110, - para => 111, - tund => 112, - fear => 113, - depl => 113, - deat => 115, - holyw => 116, - blind => 117, + phys => CS_STAT_RES_PHYS, + magic => CS_STAT_RES_MAG, + fire => CS_STAT_RES_FIRE, + elec => CS_STAT_RES_ELEC, + cold => CS_STAT_RES_COLD, + conf => CS_STAT_RES_CONF, + acid => CS_STAT_RES_ACID, + drain => CS_STAT_RES_DRAIN, + ghit => CS_STAT_RES_GHOSTHIT, + pois => CS_STAT_RES_POISON, + slow => CS_STAT_RES_SLOW, + para => CS_STAT_RES_PARA, + tund => CS_STAT_TURN_UNDEAD, + fear => CS_STAT_RES_FEAR, + depl => CS_STAT_RES_DEPLETE, + deat => CS_STAT_RES_DEATH, + holyw => CS_STAT_RES_HOLYWORD, + blind => CS_STAT_RES_BLIND, ); $STATWIDS->{"res_$_"}->set_text (sprintf "%d%", $stats->{$tbl{$_}}) @@ -1051,6 +1079,15 @@ } ); + $vbox->add (new CFClient::UI::Label + text => "Server Info", + fontsize => 1.2, + padding_y => 8, + fg => [1, 1, 0, 1], + ); + + $vbox->add ($SERVER_INFO = new CFClient::UI::Label ellipsise => 0); + $vbox } @@ -1184,6 +1221,7 @@ ["Ignore cursed" => PICKUP_NOT_CURSED], ["Jewelery" => PICKUP_JEWELS], ], + ["Weight/Value ratio", 2, 17] ) { my ($title, $x, $y, @bits) = @$_; @@ -1211,6 +1249,25 @@ } } + $table->add (2, 18, new CFClient::UI::ValSlider + range => [0, 0, 16, 1, 1], + to_value => sub { ">= " . 5 * $_[0] }, + on_changed => sub { + my ($slider, $value) = @_; + + $::CFG->{pickup} &= ~0x7; + $::CFG->{pickup} |= int $value + if $value; + 1; + }); + $table->add (3, 18, new CFClient::UI::Button + text => "set", + on_activate => sub { + $::CONN->send_command ("pickup $::CFG->{pickup}") + if defined $::CONN; + 1; + }); + $table } @@ -1297,6 +1354,17 @@ }; my $vb = new CFClient::UI::VBox; + $vb->add (my $hb = new CFClient::UI::HBox); + $hb->add (new CFClient::UI::Label text => "only shift-up stops fire"); + $hb->add (new CFClient::UI::CheckBox + expand => 1, + state => $CFG->{shift_fire_stop}, + tooltip => "If this checkbox is enabled you will stop fire only if you stop pressing shift", + on_changed => sub { + my ($cbox, $value) = @_; + $CFG->{shift_fire_stop} = $value; + }); + $vb->add ($binding_list); $vb->add (my $hb = new CFClient::UI::HBox); @@ -1449,6 +1517,7 @@ y => $FONTSIZE + 8, border_bg => [1, 1, 1, 192/255], bg => [1, 1, 1, 0], + no_close_button => 1, child => ($MAPMAP = new CFClient::MapWidget::MapMap tooltip => "Map. On servers that support this feature, this will display an overview of the surrounding areas.", ), @@ -1510,6 +1579,8 @@ . "binding editor closes"); $SETUP_NOTEBOOK->add (Spells => $SETUP_SPELLS = spell_setup, "Displays all spells you have and lets you edit keyboard shortcuts for them."); + $SETUP_NOTEBOOK->add (Debug => debug_setup, + "Some debuggign options. Do not ask."); $BUTTONBAR = new CFClient::UI::Buttonbar x => 0, y => 0, z => 200; # put on top @@ -1865,6 +1936,8 @@ } Event::loop; +#CFClient::SDL_Quit; +#CFClient::_exit 0; END { CFClient::SDL_Quit }