… | |
… | |
36 | |
36 | |
37 | use CFClient; |
37 | use CFClient; |
38 | use CFClient::OpenGL (); |
38 | use CFClient::OpenGL (); |
39 | use CFClient::Protocol; |
39 | use CFClient::Protocol; |
40 | use CFClient::UI; |
40 | use CFClient::UI; |
|
|
41 | use CFClient::BindingEditor; |
41 | use CFClient::MapWidget; |
42 | use CFClient::MapWidget; |
42 | |
43 | |
43 | $SIG{QUIT} = sub { Carp::cluck "QUIT" }; |
44 | $SIG{QUIT} = sub { Carp::cluck "QUIT" }; |
44 | |
45 | |
45 | $Event::DIED = sub { |
46 | $Event::DIED = sub { |
… | |
… | |
749 | ); |
750 | ); |
750 | $tbl2->add ($col + 1, $row, new CFClient::UI::Image |
751 | $tbl2->add ($col + 1, $row, new CFClient::UI::Image |
751 | font => $FONT_FIXED, |
752 | font => $FONT_FIXED, |
752 | can_hover => 1, |
753 | can_hover => 1, |
753 | can_events => 1, |
754 | can_events => 1, |
754 | image => "ui/resist/resist_$_.png", |
755 | path => "ui/resist/resist_$_.png", |
755 | tooltip => $resist_names{$_}, |
756 | tooltip => $resist_names{$_}, |
756 | ); |
757 | ); |
757 | |
758 | |
758 | $row++; |
759 | $row++; |
759 | if ($row % 6 == 0) { |
760 | if ($row % 6 == 0) { |
… | |
… | |
946 | x => 'center', |
947 | x => 'center', |
947 | y => 'center', |
948 | y => 'center', |
948 | z => 3, |
949 | z => 3, |
949 | force_h => $::HEIGHT * 0.4, |
950 | force_h => $::HEIGHT * 0.4, |
950 | child => (my $vbox = new CFClient::UI::VBox), |
951 | child => (my $vbox = new CFClient::UI::VBox), |
|
|
952 | has_close_button => 1, |
951 | on_visibility_change => sub { |
953 | on_visibility_change => sub { |
952 | update_metaserver if $_[1]; |
954 | update_metaserver if $_[1]; |
953 | 0 |
955 | 0 |
954 | }, |
956 | }, |
955 | ; |
957 | ; |
… | |
… | |
1435 | $buttons->add (new CFClient::UI::Label text => "Choose a document to display: "); |
1437 | $buttons->add (new CFClient::UI::Label text => "Choose a document to display: "); |
1436 | $buttons->add (my $combo = new CFClient::UI::Combobox |
1438 | $buttons->add (my $combo = new CFClient::UI::Combobox |
1437 | value => undef, |
1439 | value => undef, |
1438 | options => [ |
1440 | options => [ |
1439 | [intro => "Introduction"], |
1441 | [intro => "Introduction"], |
1440 | [manual => "Manual"], |
1442 | [manual => "Main Manual"], |
1441 | [skill_help => "Skills"], |
1443 | [skill_help => "Skill Reference"], |
1442 | [command_help => "Commands"], |
1444 | [command_help => "Command Reference"], |
1443 | [dmcommand_help => "DM Commands"], |
1445 | [dmcommand_help => "DM Commands"], |
1444 | [COPYING => "License Terms"], |
1446 | [COPYING => "License Terms"], |
1445 | ], |
1447 | ], |
1446 | on_changed => sub { |
1448 | on_changed => sub { |
1447 | my ($self, $pod) = @_; |
1449 | my ($self, $pod) = @_; |
1448 | |
1450 | |
1449 | my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod", |
1451 | my $pom = CFClient::load_pod CFClient::find_rcfile "pod/$pod.pod", |
1450 | doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] }; |
1452 | doc_viewer => 1, sub { CFClient::pod_to_pango_list $_[0] }; |
1451 | |
1453 | |
1452 | $viewer->clear; |
1454 | $viewer->clear; |
|
|
1455 | |
|
|
1456 | # $viewer->add_paragraph ([1, 1, 1, 1], ["<big>Test</big>\n\n \x{fffc} \x{fffc}\n", |
|
|
1457 | # (new CFClient::UI::Image path => "x.png", can_hover => 1, can_events => 1), |
|
|
1458 | # (new CFClient::UI::Label text => "üüüü", can_hover => 1, can_events => 1, tooltip => "??"), |
|
|
1459 | # ]);#d# |
1453 | |
1460 | |
1454 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1461 | $viewer->add_paragraph ([1, 1, 1, 1], $_->[1], $_->[0]) |
1455 | for @$pom; |
1462 | for @$pom; |
1456 | |
1463 | |
1457 | $viewer->set_offset (0); |
1464 | $viewer->set_offset (0); |
|
|
1465 | |
1458 | 0 |
1466 | 0 |
1459 | }, |
1467 | }, |
1460 | on_visibility_change => sub { |
1468 | on_visibility_change => sub { |
1461 | my ($self, $visible) = @_; |
1469 | my ($self, $visible) = @_; |
1462 | return unless $visible; |
1470 | return unless $visible; |
… | |
… | |
1509 | z => 100, |
1517 | z => 100, |
1510 | force_x => "max", |
1518 | force_x => "max", |
1511 | force_y => 0; |
1519 | force_y => 0; |
1512 | $DEBUG_STATUS->show; |
1520 | $DEBUG_STATUS->show; |
1513 | |
1521 | |
1514 | $BIND_EDITOR = new CFClient::UI::BindEditor (x => "max", y => 0); |
1522 | $BIND_EDITOR = new CFClient::BindingEditor (x => "max", y => 0); |
1515 | |
1523 | |
1516 | $STATUSBOX = new CFClient::UI::Statusbox; |
1524 | $STATUSBOX = new CFClient::UI::Statusbox; |
1517 | $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", timeout => 864000, pri => -100, color => [1, 1, 1, 0.8]); |
1525 | $STATUSBOX->add ("Use <b>Alt-Enter</b> to toggle fullscreen mode", timeout => 864000, pri => -100, color => [1, 1, 1, 0.8]); |
1518 | |
1526 | |
1519 | (new CFClient::UI::Frame |
1527 | (new CFClient::UI::Frame |