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

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.107 by root, Sun Aug 13 03:20:56 2006 UTC vs.
Revision 1.118 by root, Tue Aug 22 06:37:30 2006 UTC

59 return;#d# 59 return;#d#
60 #return unless defined $^S && !$^S; 60 #return unless defined $^S && !$^S;
61 $Event::DIED->(undef, $_[0]); 61 $Event::DIED->(undef, $_[0]);
62}; 62};
63 63
64our $VERSION = '0.1'; 64our $VERSION = '0.9';
65 65
66my $MAX_FPS = 60; 66my $MAX_FPS = 60;
67my $MIN_FPS = 5; # unused as of yet 67my $MIN_FPS = 5; # unused as of yet
68 68
69our $META_SERVER = "crossfire.real-time.com:13326"; 69our $META_SERVER = "crossfire.real-time.com:13326";
155 155
156# server query dialog 156# server query dialog
157sub server_query { 157sub server_query {
158 my ($conn, $flags, $prompt) = @_; 158 my ($conn, $flags, $prompt) = @_;
159 159
160 $conn->{query_dialog} = my $dialog = new CFPlus::UI::FancyFrame 160 $conn->{query_dialog} = my $dialog = new CFPlus::UI::Toplevel
161 x => "center", 161 x => "center",
162 y => "center", 162 y => "center",
163 title => "Server Query", 163 title => "Server Query",
164 child => my $vbox = new CFPlus::UI::VBox, 164 child => my $vbox = new CFPlus::UI::VBox,
165 ; 165 ;
190 ); 190 );
191 191
192 $dialog->grab_focus; 192 $dialog->grab_focus;
193 193
194 } elsif ($flags & CS_QUERY_SINGLECHAR) { 194 } elsif ($flags & CS_QUERY_SINGLECHAR) {
195 $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; 195 $dialog->{tooltip} = "#charcreation_focus";
196 196
197 if ($prompt =~ /Now choose a character|Press any key for the next race/i) { 197 if ($prompt =~ /Now choose a character|Press any key for the next race/i) {
198 $MESSAGE_WINDOW->show; 198 $MESSAGE_WINDOW->show;
199 199
200 unshift @dialog, new CFPlus::UI::Label 200 unshift @dialog, new CFPlus::UI::Label
222 ); 222 );
223 223
224 unshift @dialog, new CFPlus::UI::Label 224 unshift @dialog, new CFPlus::UI::Label
225 max_w => $::WIDTH * 0.4, 225 max_w => $::WIDTH * 0.4,
226 ellipsise => 0, 226 ellipsise => 0,
227 markup => 227 markup => (CFPlus::Pod::section_label ui => "chargen_race"),
228 "<big><b>Character Creation: Race</b></big>\n\n"
229 . "Look at the <b>Messages</b> window to see a description of this race "
230 . "and the center of the screen to see how this race looks like "
231 . "(<small>below this dialog window: you may need to move the dialog away and "
232 . "click into the display area to make it visible</small>).\n\n"
233 . "You can look at another race, or accept this race (you will cycle back to "
234 . "this race eventually, so you can take your time making this important choice."
235 ; 228 ;
236 229
237 } elsif ($prompt =~ /roll new stats/) { 230 } elsif ($prompt =~ /roll new stats/) {
238 if (my $stat = delete $conn->{stat_change_with}) { 231 if (my $stat = delete $conn->{stat_change_with}) {
239 $conn->send ("reply $stat"); 232 $conn->send ("reply $stat");
320 } 313 }
321 314
322 unshift @dialog, new CFPlus::UI::Label 315 unshift @dialog, new CFPlus::UI::Label
323 max_w => $::WIDTH * 0.4, 316 max_w => $::WIDTH * 0.4,
324 ellipsise => 0, 317 ellipsise => 0,
325 markup => 318 markup => (CFPlus::Pod::section_label ui => "chargen_stats"),
326 "<big><b>Character Creation: Stats</b></big>\n\n"
327 . "<b>Stats</b> are a very important aspect of your character. You can use the tooltips to learn what each Stat governs.\n\n"
328 . "The stats generated by the server are always sorted from Str (highest) to Cha (lowest). "
329 . "They will be modified later by both the race and the class you choose.\n\n"
330 . "You can create another set of stats, swap two stat values with each other or accept the stats as shown below and continue.\n"
331 ; 319 ;
332 } 320 }
333 321
334 push @dialog, my $entry = new CFPlus::UI::Entry 322 push @dialog, my $entry = new CFPlus::UI::Entry
335 on_changed => sub { 323 on_changed => sub {
379 user => $CFG->{profile}{default}{user}, 367 user => $CFG->{profile}{default}{user},
380 pass => $CFG->{profile}{default}{password}, 368 pass => $CFG->{profile}{default}{password},
381 mapw => $mapsize, 369 mapw => $mapsize,
382 maph => $mapsize, 370 maph => $mapsize,
383 371
372 client => "cfplus $VERSION $] $^O",
373
384 map_widget => $MAPWIDGET, 374 map_widget => $MAPWIDGET,
385 logview => $LOGVIEW, 375 logview => $LOGVIEW,
386 statusbox => $STATUSBOX, 376 statusbox => $STATUSBOX,
387 map => $MAP, 377 map => $MAP,
388 mapmap => $MAPMAP, 378 mapmap => $MAPMAP,
622 (new CFPlus::UI::Empty expand => 1), 612 (new CFPlus::UI::Empty expand => 1),
623 (my $hb = new CFPlus::UI::HBox), 613 (my $hb = new CFPlus::UI::HBox),
624 ], 614 ],
625 ); 615 );
626 616
627 $hb->add (my $hg = new CFPlus::UI::Gauge type => 'hp', 617 $hb->add (my $hg = new CFPlus::UI::Gauge type => 'hp', tooltip => "#stat_health");
628 tooltip => "<b>Health points</b>. Measures of how much damage you can take before dying. Hit points are determined from your level and are influenced by the value of your Con. Hp value may range between 1 to beyond 500 and higher values indicate a greater ability to withstand punishment.");
629 $hb->add (my $mg = new CFPlus::UI::Gauge type => 'mana', 618 $hb->add (my $mg = new CFPlus::UI::Gauge type => 'mana', tooltip => "#stat_mana");
630 tooltip => "<b>Spell points</b>. Measures of how much \"fuel\" you have for casting spells and incantations. Mana is calculated from your level and your Pow. Mana values can range between 1 to beyond 500 (glowing crystals can increase the current spell points beyond your normal maximum). Higher values indicate greater amounts of mana.");
631 $hb->add (my $gg = new CFPlus::UI::Gauge type => 'grace', 619 $hb->add (my $gg = new CFPlus::UI::Gauge type => 'grace', tooltip => "#stat_grace");
632 tooltip => "<b>Grace points</b> - how favored you are by your god. In game terms, how much divine magic you can cast. Your level, Wis and Pow effect what the value of grace is. Prayong on an altar of your god can increase this value beyond your normal maximum. Grace can take on large positive and negative values. Positive values indicate favor by the gods.");
633 $hb->add (my $fg = new CFPlus::UI::Gauge type => 'food', 620 $hb->add (my $fg = new CFPlus::UI::Gauge type => 'food', tooltip => "#stat_food");
634 tooltip => "<b>Food</b>. Ranges between 0 (starving) and 999 (satiated). At a value of 0 the character begins to die. Some magic can speed up or slow down the character digestion. Healing wounds will speed up digestion too.");
635 621
636 $vbox->add (my $exp = new CFPlus::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, 622 $vbox->add (my $exp = new CFPlus::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_exp");
637 tooltip => "<b>Experience points and overall level</b> - experience is increased as a reward for appropriate action (such as killing monsters) and may decrease as a result of a magical attack or dying. Level is directly derived from the experience value. As the level of the character increases, the character becomes able to succeed at more difficult tasks. A character's level starts at a value of 0 and may range up beyond 100.");
638 $vbox->add (my $rng = new CFPlus::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, 623 $vbox->add (my $rng = new CFPlus::UI::Label valign => 0, align => 1, can_hover => 1, can_events => 1, tooltip => "#stat_ranged");
639 tooltip => "<b>Ranged attack</b> - how you attack when you press shift-cursor (spell, skill, weapon etc.)");
640 624
641 $GAUGES = { 625 $GAUGES = {
642 exp => $exp, win => $win, range => $rng, 626 exp => $exp, win => $win, range => $rng,
643 food => $fg, mana => $mg, hp => $hg, grace => $gg 627 food => $fg, mana => $mg, hp => $hg, grace => $gg
644 }; 628 };
681 expand => 1, 665 expand => 1,
682 scroll_y => 1 666 scroll_y => 1
683 ); 667 );
684 $r->add (my $vb = new CFPlus::UI::VBox); 668 $r->add (my $vb = new CFPlus::UI::VBox);
685 669
670 $vb->add (new CFPlus::UI::FancyFrame
671 label => "Player",
672 child => (my $pi = new CFPlus::UI::VBox),
673 );
674
686 $vb->add ($STATWIDS->{title} = new CFPlus::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, 675 $pi->add ($STATWIDS->{title} = new CFPlus::UI::Label valign => 0, align => -1, text => "Title:", expand => 1,
687 can_hover => 1, can_events => 1, 676 can_hover => 1, can_events => 1,
688 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); 677 tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server.");
689 $vb->add ($STATWIDS->{map} = new CFPlus::UI::Label valign => 0, align => -1, text => "Map:", expand => 1, 678 $pi->add ($STATWIDS->{map} = new CFPlus::UI::Label valign => 0, align => -1, text => "Map:", expand => 1,
690 can_hover => 1, can_events => 1, 679 can_hover => 1, can_events => 1,
691 tooltip => "The map you are currently on (if supported by the server)."); 680 tooltip => "The map you are currently on (if supported by the server).");
692 681
693 $vb->add (my $hb0 = new CFPlus::UI::HBox); 682 $pi->add (my $hb0 = new CFPlus::UI::HBox);
694 $hb0->add ($STATWIDS->{weight} = new CFPlus::UI::Label valign => 0, align => -1, text => "Weight:", expand => 1, 683 $hb0->add ($STATWIDS->{weight} = new CFPlus::UI::Label valign => 0, align => -1, text => "Weight:", expand => 1,
695 can_hover => 1, can_events => 1, 684 can_hover => 1, can_events => 1,
696 tooltip => "The weight of the player including all inventory items."); 685 tooltip => "The weight of the player including all inventory items.");
697 $hb0->add ($STATWIDS->{m_weight} = new CFPlus::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1, 686 $hb0->add ($STATWIDS->{m_weight} = new CFPlus::UI::Label valign => 0, align => -1, text => "Max weight:", expand => 1,
698 can_hover => 1, can_events => 1, 687 can_hover => 1, can_events => 1,
699 tooltip => "The weight limit: you cannot carry more than this."); 688 tooltip => "The weight limit: you cannot carry more than this.");
700 689
690 $vb->add (new CFPlus::UI::FancyFrame
691 label => "Primary/Secondary Statistics",
701 $vb->add (my $hb = new CFPlus::UI::HBox expand => 1); 692 child => (my $hb = new CFPlus::UI::HBox expand => 1),
693 );
702 $hb->add (my $tbl = new CFPlus::UI::Table expand => 1); 694 $hb->add (my $tbl = new CFPlus::UI::Table expand => 1);
703 695
704 my $color2 = [1, 1, 0]; 696 my $color2 = [1, 1, 0];
705 697
706 for ( 698 for (
727 $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFPlus::UI::Label 719 $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFPlus::UI::Label
728 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0, 720 font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0,
729 align => -1, text => $label, tooltip => "#stat_$label"); 721 align => -1, text => $label, tooltip => "#stat_$label");
730 } 722 }
731 723
724 $vb->add (new CFPlus::UI::FancyFrame
725 label => "Resistancies",
732 $vb->add (my $tbl2 = new CFPlus::UI::Table expand => 1); 726 child => (my $tbl2 = new CFPlus::UI::Table expand => 1),
727 );
733 728
734 my $row = 0; 729 my $row = 0;
735 my $col = 0; 730 my $col = 0;
736 731
737 my %resist_names = ( 732 my %resist_names = (
931sub metaserver_dialog { 926sub metaserver_dialog {
932 my $vbox = new CFPlus::UI::VBox; 927 my $vbox = new CFPlus::UI::VBox;
933 my $table = new CFPlus::UI::Table; 928 my $table = new CFPlus::UI::Table;
934 $vbox->add (new CFPlus::UI::ScrolledWindow expand => 1, child => $table); 929 $vbox->add (new CFPlus::UI::ScrolledWindow expand => 1, child => $table);
935 930
936 my $dialog = new CFPlus::UI::FancyFrame 931 my $dialog = new CFPlus::UI::Toplevel
937 title => "Server List", 932 title => "Server List",
938 name => 'metaserver_dialog', 933 name => 'metaserver_dialog',
939 x => 'center', 934 x => 'center',
940 y => 'center', 935 y => 'center',
941 z => 3, 936 z => 3,
953} 948}
954 949
955sub server_setup { 950sub server_setup {
956 my $vbox = new CFPlus::UI::VBox; 951 my $vbox = new CFPlus::UI::VBox;
957 952
953 $vbox->add (new CFPlus::UI::FancyFrame
954 label => "Connection Settings",
958 $vbox->add (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]); 955 child => (my $table = new CFPlus::UI::Table expand => 1, col_expand => [0, 1]),
956 );
959 $table->add (0, 2, new CFPlus::UI::Label valign => 0, align => 1, text => "Host:Port"); 957 $table->add (0, 2, new CFPlus::UI::Label valign => 0, align => 1, text => "Host:Port");
960 958
961 { 959 {
962 $table->add (1, 2, my $vbox = new CFPlus::UI::VBox); 960 $table->add (1, 2, my $vbox = new CFPlus::UI::VBox);
963 961
1058 $CFG->{say_command} = $value; 1056 $CFG->{say_command} = $value;
1059 0 1057 0
1060 } 1058 }
1061 ); 1059 );
1062 1060
1063 $vbox->add (new CFPlus::UI::Label 1061 $vbox->add (new CFPlus::UI::FancyFrame
1064 text => "Server Info", 1062 label => "Server Info",
1065 fontsize => 1.2,
1066 padding_y => 8,
1067 fg => [1, 1, 0, 1],
1068 );
1069
1070 $vbox->add ($SERVER_INFO = new CFPlus::UI::Label ellipsise => 0); 1063 child => ($SERVER_INFO = new CFPlus::UI::Label ellipsise => 0),
1064 );
1071 1065
1072 $vbox 1066 $vbox
1073} 1067}
1074 1068
1075sub message_window { 1069sub message_window {
1076 my $window = new CFPlus::UI::FancyFrame 1070 my $window = new CFPlus::UI::Toplevel
1077 name => "message_window", 1071 name => "message_window",
1078 title => "Messages", 1072 title => "Messages",
1079 border_bg => [1, 1, 1, 1], 1073 border_bg => [1, 1, 1, 1],
1080 x => "max", 1074 x => "max",
1081 y => 0, 1075 y => 0,
1134 1128
1135 $window 1129 $window
1136} 1130}
1137 1131
1138sub open_string_query { 1132sub open_string_query {
1139 my $cb = $_[1]; 1133 my ($title, $cb, $txt, $tooltip) = @_;
1140 my $dialog = new CFPlus::UI::FancyFrame 1134 my $dialog = new CFPlus::UI::Toplevel
1141 x => "center", 1135 x => "center",
1142 y => "center", 1136 y => "center",
1143 z => 50, 1137 z => 50,
1144 force_w => $WIDTH * 4/5, 1138 force_w => $WIDTH * 4/5,
1145 title => $_[0]; 1139 title => $title;
1146 1140
1147 $dialog->add ( 1141 $dialog->add (
1148 my $e = new CFPlus::UI::Entry 1142 my $e = new CFPlus::UI::Entry
1149 on_activate => sub { $cb->(@_); $dialog->hide; 0 }, 1143 on_activate => sub { $cb->(@_); $dialog->hide; 0 },
1150 on_key_down => sub { $_[1]->{sym} == 27 and $dialog->hide; 0 }, 1144 on_key_down => sub { $_[1]->{sym} == 27 and $dialog->hide; 0 },
1145 tooltip => $tooltip
1151 ); 1146 );
1152 1147
1153 $e->grab_focus; 1148 $e->grab_focus;
1149 $e->set_text ($txt) if $txt;
1154 $dialog->show; 1150 $dialog->show;
1155} 1151}
1156 1152
1157sub open_quit_dialog { 1153sub open_quit_dialog {
1158 unless ($QUIT_DIALOG) { 1154 unless ($QUIT_DIALOG) {
1159 $QUIT_DIALOG = new CFPlus::UI::FancyFrame 1155 $QUIT_DIALOG = new CFPlus::UI::Toplevel
1160 x => "center", 1156 x => "center",
1161 y => "center", 1157 y => "center",
1162 z => 50, 1158 z => 50,
1163 title => "Really Quit?", 1159 title => "Really Quit?",
1164 on_key_down => sub { 1160 on_key_down => sub {
1353 $PL_WINDOW->show; 1349 $PL_WINDOW->show;
1354 } 1350 }
1355} 1351}
1356 1352
1357sub player_window { 1353sub player_window {
1358 my $plwin = $PL_WINDOW = new CFPlus::UI::FancyFrame 1354 my $plwin = $PL_WINDOW = new CFPlus::UI::Toplevel
1359 x => "center", 1355 x => "center",
1360 y => "center", 1356 y => "center",
1361 force_w => $WIDTH * 9/10, 1357 force_w => $WIDTH * 9/10,
1362 force_h => $HEIGHT * 9/10, 1358 force_h => $HEIGHT * 9/10,
1363 title => "Player", 1359 title => "Player",
1452 } 1448 }
1453 } 1449 }
1454 }; 1450 };
1455 1451
1456 my $vb = new CFPlus::UI::VBox; 1452 my $vb = new CFPlus::UI::VBox;
1453 $vb->add (new CFPlus::UI::FancyFrame
1454 label => "Options",
1457 $vb->add (my $hb = new CFPlus::UI::HBox); 1455 child => (my $hb = new CFPlus::UI::HBox),
1456 );
1458 $hb->add (new CFPlus::UI::Label text => "only shift-up stops fire"); 1457 $hb->add (new CFPlus::UI::Label text => "only shift-up stops fire");
1459 $hb->add (new CFPlus::UI::CheckBox 1458 $hb->add (new CFPlus::UI::CheckBox
1460 expand => 1, 1459 expand => 1,
1461 state => $CFG->{shift_fire_stop}, 1460 state => $CFG->{shift_fire_stop},
1462 tooltip => "If this checkbox is enabled you will stop fire only if you stop pressing shift", 1461 tooltip => "If this checkbox is enabled you will stop fire only if you stop pressing shift",
1464 my ($cbox, $value) = @_; 1463 my ($cbox, $value) = @_;
1465 $CFG->{shift_fire_stop} = $value; 1464 $CFG->{shift_fire_stop} = $value;
1466 0 1465 0
1467 }); 1466 });
1468 1467
1469 $vb->add ($binding_list); 1468 $vb->add (new CFPlus::UI::FancyFrame
1469 label => "Bindings",
1470 child => $binding_list);
1470 $vb->add (my $hb = new CFPlus::UI::HBox); 1471 $vb->add (my $hb = new CFPlus::UI::HBox);
1471 1472
1472 $hb->add (new CFPlus::UI::Button 1473 $hb->add (new CFPlus::UI::Button
1473 text => "record new", 1474 text => "record new",
1474 expand => 1, 1475 expand => 1,
1507 1508
1508 $vb 1509 $vb
1509} 1510}
1510 1511
1511sub help_window { 1512sub help_window {
1512 my $win = new CFPlus::UI::FancyFrame 1513 my $win = new CFPlus::UI::Toplevel
1513 x => 'center', 1514 x => 'center',
1514 y => 'center', 1515 y => 'center',
1515 z => 2, 1516 z => 2,
1516 name => 'doc_browser', 1517 name => 'doc_browser',
1517 force_w => int $WIDTH * 7/8, 1518 force_w => int $WIDTH * 7/8,
1519 title => "Help Browser", 1520 title => "Help Browser",
1520 has_close_button => 1; 1521 has_close_button => 1;
1521 1522
1522 $win->add (my $vbox = new CFPlus::UI::VBox); 1523 $win->add (my $vbox = new CFPlus::UI::VBox);
1523 1524
1525 $vbox->add (new CFPlus::UI::FancyFrame
1526 label => "Navigation",
1524 $vbox->add (my $buttons = new CFPlus::UI::HBox); 1527 child => (my $buttons = new CFPlus::UI::HBox),
1528 );
1525 $vbox->add (my $viewer = new CFPlus::UI::TextScroller 1529 $vbox->add (my $viewer = new CFPlus::UI::TextScroller
1526 expand => 1, fontsize => 0.8, padding_x => 4); 1530 expand => 1, fontsize => 0.8, padding_x => 4, padding_y => 4);
1527 1531
1528 $buttons->add (new CFPlus::UI::Label text => "Choose a document to display: "); 1532 my @history;
1529 $buttons->add (my $combo = new CFPlus::UI::Selector 1533 my @future;
1530 value => undef, 1534 my $curnode;
1531 options => [ 1535
1532 [intro => "Introduction"], 1536 my $load_node; $load_node = sub {
1533 [manual => "Main Manual"], 1537 my ($node, $para) = @_;
1534 [skill_help => "Skill Reference"], 1538
1535 [command_help => "Command Reference"], 1539 $buttons->clear;
1536 [dmcommand_help => "DM Commands"], 1540
1537 [COPYING => "License Terms"], 1541 $buttons->add (new CFPlus::UI::Button
1538 ], 1542 text => "⇤",
1543 tooltip => "back to the starting page",
1539 on_changed => sub { 1544 on_activate => sub {
1540 my ($self, $pod) = @_; 1545 unshift @future, [$curnode, $viewer->current_paragraph] if $curnode;
1541 1546 unshift @future, @history;
1542 $viewer->clear; 1547 @history = ();
1543 $viewer->add_paragraph (CFPlus::Pod::section pod => $pod); 1548 $load_node->(@{shift @future});
1544 $viewer->set_offset (0);
1545
1546 0 1549 },
1550 );
1551
1552 if (@history) {
1553 $buttons->add (new CFPlus::UI::Button
1554 text => "⋘",
1555 tooltip => "back to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $history[-1][0]) . "</i>",
1556 on_activate => sub {
1557 unshift @future, [$curnode, $viewer->current_paragraph] if $curnode;
1558 $load_node->(@{pop @history});
1559 },
1560 );
1547 }, 1561 }
1548 on_visibility_change => sub { 1562
1549 my ($self, $visible) = @_; 1563 if (@future) {
1550 return unless $visible; 1564 $buttons->add (new CFPlus::UI::Button
1551 return if $self->{value}; 1565 text => "⋙",
1552 $self->set_value ("intro"); 1566 tooltip => "forward to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $future[0][0]) . "</i>",
1567 on_activate => sub {
1568 push @history, [$curnode, $viewer->current_paragraph];
1569 $load_node->(@{shift @future});
1570 },
1553 0 1571 );
1554 }, 1572 }
1573
1574 $buttons->add (new CFPlus::UI::Label text => " ");
1575
1576 my @path = CFPlus::Pod::full_path_of $node;
1577 pop @path; # drop current node
1578
1579 for my $node (@path) {
1580 $buttons->add (new CFPlus::UI::Button
1581 text => $node->{kw}[0],
1582 tooltip => "go to <i>" . (CFPlus::asxml CFPlus::Pod::full_path $node) . "</i>",
1583 on_activate => sub {
1584 push @history, [$curnode, $viewer->current_paragraph] if $curnode; @future = ();
1585 $load_node->($node);
1586 },
1587 );
1588 $buttons->add (new CFPlus::UI::Label text => "/");
1589 }
1590
1591 $buttons->add (new CFPlus::UI::Label text => $node->{kw}[0], padding_x => 4, padding_y => 4);
1592
1593 $curnode = $node;
1594
1595 $viewer->clear;
1596 $viewer->add_paragraph (CFPlus::Pod::as_paragraphs CFPlus::Pod::section_of $curnode);
1597 $viewer->scroll_to ($para);
1555 ); 1598 };
1599
1600 $load_node->(CFPlus::Pod::find pod => "mainpage");
1601
1602 $CFPlus::Pod::goto_document = sub {
1603 my (@path) = @_;
1604
1605 push @history, [$curnode, $viewer->current_paragraph] if $curnode; @future = ();
1606
1607 $load_node->((CFPlus::Pod::find @path)[0]);
1608 $win->show;
1609 };
1556 1610
1557 $win 1611 $win
1558} 1612}
1559 1613
1560sub sdl_init { 1614sub sdl_init {
1609 force_x => 0, 1663 force_x => 0,
1610 force_y => "max", 1664 force_y => "max",
1611 child => $STATUSBOX, 1665 child => $STATUSBOX,
1612 )->show; 1666 )->show;
1613 1667
1614 CFPlus::UI::FancyFrame->new ( 1668 CFPlus::UI::Toplevel->new (
1615 title => "Map", 1669 title => "Map",
1616 name => "mapmap", 1670 name => "mapmap",
1617 x => 0, 1671 x => 0,
1618 y => $FONTSIZE + 8, 1672 y => $FONTSIZE + 8,
1619 border_bg => [1, 1, 1, 192/255], 1673 border_bg => [1, 1, 1, 192/255],
1647 can_hover => 1, 1701 can_hover => 1,
1648 can_events => 1, 1702 can_events => 1,
1649 tooltip => "<b>Server Log</b>. This text viewer contains all the messages sent by the server.", 1703 tooltip => "<b>Server Log</b>. This text viewer contains all the messages sent by the server.",
1650 ; 1704 ;
1651 1705
1652 $SETUP_DIALOG = new CFPlus::UI::FancyFrame 1706 $SETUP_DIALOG = new CFPlus::UI::Toplevel
1653 title => "Setup", 1707 title => "Setup",
1654 name => "setup_dialog", 1708 name => "setup_dialog",
1655 x => 'center', 1709 x => 'center',
1656 y => 'center', 1710 y => 'center',
1657 z => 2, 1711 z => 2,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines