… | |
… | |
27 | ); |
27 | ); |
28 | |
28 | |
29 | $self->{map_widget}->clr_commands; |
29 | $self->{map_widget}->clr_commands; |
30 | |
30 | |
31 | my @cmd_help = map { |
31 | my @cmd_help = map { |
32 | $_->{kw}[0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x |
32 | $_->[DC::Pod::N_KW][0] =~ /^(\S+) (?:\s+ \( ([^\)]*) \) )?/x |
33 | or die "unparseable command help: $_->{kw}[0]"; |
33 | or die "unparseable command help: $_->[DC::Pod::N_KW][0]"; |
34 | |
34 | |
35 | my $cmd = $1; |
35 | my $cmd = $1; |
36 | my @args = split /\|/, $2; |
36 | my @args = split /\|/, $2; |
37 | @args = (".*") unless @args; |
37 | @args = (".*") unless @args; |
38 | |
38 | |
… | |
… | |
43 | for @args; |
43 | for @args; |
44 | |
44 | |
45 | map ["$cmd$_", $text], |
45 | map ["$cmd$_", $text], |
46 | sort { (length $a) <=> (length $b) } |
46 | sort { (length $a) <=> (length $b) } |
47 | @args |
47 | @args |
48 | } sort { $a->{par} <=> $b->{par} } |
48 | } sort { $a->[DC::Pod::N_PAR] <=> $b->[DC::Pod::N_PAR] } |
49 | DC::Pod::find command => "*"; |
49 | DC::Pod::find command => "*"; |
50 | |
50 | |
51 | $self->{json_coder} |
51 | $self->{json_coder} |
52 | ->convert_blessed |
52 | ->convert_blessed |
53 | ->filter_json_single_key_object ("\fw" => sub { |
53 | ->filter_json_single_key_object ("\fw" => sub { |
… | |
… | |
225 | @w |
225 | @w |
226 | }; |
226 | }; |
227 | |
227 | |
228 | # either array reference, or face # |
228 | # either array reference, or face # |
229 | if ($type eq "inline") { |
229 | if ($type eq "inline") { |
|
|
230 | $done_cb->(); |
230 | $parse_list->($template); |
231 | $parse_list->($template); |
231 | $done_cb->(); |
|
|
232 | } elsif ($type eq "face") { |
232 | } elsif ($type eq "face") { |
233 | #... |
233 | my $handler; $handler = $self->register_face_handler ($template, sub { |
|
|
234 | my ($face) = @_; |
|
|
235 | |
|
|
236 | undef $handler; |
234 | $done_cb->(0); |
237 | $done_cb->(); |
|
|
238 | $parse_list->($self->{json_coder}->decode ($face->{data})); |
|
|
239 | }); |
235 | } else { |
240 | } else { |
236 | $done_cb->(0); |
241 | $done_cb->(0); |
237 | } |
242 | } |
238 | } |
243 | } |
239 | |
244 | |
… | |
… | |
270 | spell_list => $::SPELL_LIST, |
275 | spell_list => $::SPELL_LIST, |
271 | |
276 | |
272 | floorbox => $::FLOORBOX, |
277 | floorbox => $::FLOORBOX, |
273 | help_window => $::HELP_WINDOW, |
278 | help_window => $::HELP_WINDOW, |
274 | message_window => $::MESSAGE_WINDOW, |
279 | message_window => $::MESSAGE_WINDOW, |
|
|
280 | message_dist => $::MESSAGE_DIST, |
275 | statusbox => $::SDTATUSBOX, |
281 | statusbox => $::SDTATUSBOX, |
276 | |
282 | |
277 | inv => $::INV, |
283 | inv => $::INV, |
278 | invr => $::INVR, |
284 | invr => $::INVR, |
279 | invr_hb => $::INVR_HB, |
285 | invr_hb => $::INVR_HB, |
… | |
… | |
328 | |
334 | |
329 | # message window |
335 | # message window |
330 | sub ext_channel_info { |
336 | sub ext_channel_info { |
331 | my ($self, $info) = @_; |
337 | my ($self, $info) = @_; |
332 | $self->{channels}->{$info->{id}} = $info; |
338 | $self->{channels}->{$info->{id}} = $info; |
333 | $::MESSAGE_WINDOW->add_channel ($info); |
339 | $::MESSAGE_DIST->add_channel ($info); |
334 | } |
340 | } |
335 | |
341 | |
336 | ############################################################################# |
342 | ############################################################################# |
337 | |
343 | |
338 | sub logprint { |
344 | sub logprint { |
… | |
… | |
520 | $sktbl->clear; |
526 | $sktbl->clear; |
521 | |
527 | |
522 | my $sw = $self->{skillwid}{""} ||= [ |
528 | my $sw = $self->{skillwid}{""} ||= [ |
523 | 0, 0, (new DC::UI::Label text => "Experience", align => 1), |
529 | 0, 0, (new DC::UI::Label text => "Experience", align => 1), |
524 | 1, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
530 | 1, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
525 | 2, 0, (new DC::UI::Label text => "Progress", align => 0), |
531 | 2, 0, (new DC::UI::Label text => "Progress"), |
526 | 3, 0, (new DC::UI::Label text => "Skill", expand => 1), |
532 | 3, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0), |
527 | 4, 0, (new DC::UI::Label text => "Experience", align => 1), |
533 | 4, 0, (new DC::UI::Label text => "Experience", align => 1), |
528 | 5, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
534 | 5, 0, (new DC::UI::Label text => "Lvl.", align => 1), |
529 | 6, 0, (new DC::UI::Label text => "Progress", align => 0), |
535 | 6, 0, (new DC::UI::Label text => "Progress"), |
530 | 7, 0, (new DC::UI::Label text => "Skill", expand => 1), |
536 | 7, 0, (new DC::UI::Label text => "Skill", expand => 1, align => 0), |
531 | ]; |
537 | ]; |
532 | |
538 | |
533 | my @add = @$sw; |
539 | my @add = @$sw; |
534 | |
540 | |
535 | my $TOOLTIP_ALL = "\n\n<small>Left click - ready skill\nMiddle click - use spell\nRight click - further options</small>"; |
541 | my $TOOLTIP_ALL = "\n\n<small>Left click - ready skill\nMiddle click - use spell\nRight click - further options</small>"; |
… | |
… | |
574 | |
580 | |
575 | # progress |
581 | # progress |
576 | (new DC::UI::ExperienceProgress), |
582 | (new DC::UI::ExperienceProgress), |
577 | |
583 | |
578 | # label |
584 | # label |
579 | (new DC::UI::Label text => $name, on_button_down => $spell_cb, |
585 | (new DC::UI::Label text => $name, on_button_down => $spell_cb, align => 0, |
580 | can_events => 1, can_hover => 1, tooltip => (DC::Pod::section_label skill_description => $name) . $TOOLTIP_ALL), |
586 | can_events => 1, can_hover => 1, tooltip => (DC::Pod::section_label skill_description => $name) . $TOOLTIP_ALL), |
581 | ]; |
587 | ]; |
582 | |
588 | |
583 | push @add, |
589 | push @add, |
584 | $x * 4 + 0, $y, $sw->[0], |
590 | $x * 4 + 0, $y, $sw->[0], |
… | |
… | |
1134 | |
1140 | |
1135 | my %skill_help; |
1141 | my %skill_help; |
1136 | |
1142 | |
1137 | for my $node (DC::Pod::find skill_description => "*") { |
1143 | for my $node (DC::Pod::find skill_description => "*") { |
1138 | my (undef, @par) = DC::Pod::section_of $node; |
1144 | my (undef, @par) = DC::Pod::section_of $node; |
1139 | $skill_help{$node->{kw}[0]} = DC::Pod::as_label @par; |
1145 | $skill_help{$node->[DC::Pod::N_KW][0]} = DC::Pod::as_label @par; |
1140 | }; |
1146 | }; |
1141 | |
1147 | |
1142 | for my $skill (values %{$self->{skill_info}}) { |
1148 | for my $skill (values %{$self->{skill_info}}) { |
1143 | $self->{map_widget}->add_command ("ready_skill $skill", |
1149 | $self->{map_widget}->add_command ("ready_skill $skill", |
1144 | (DC::asxml "Ready the skill '$skill'\n\n") |
1150 | (DC::asxml "Ready the skill '$skill'\n\n") |
… | |
… | |
1202 | my ($conn, $tag, $name) = @_; |
1208 | my ($conn, $tag, $name) = @_; |
1203 | $conn->{open_container} = $tag; |
1209 | $conn->{open_container} = $tag; |
1204 | update_floorbox; |
1210 | update_floorbox; |
1205 | |
1211 | |
1206 | $::INVR_HB->clear (); |
1212 | $::INVR_HB->clear (); |
1207 | $::INVR_HB->add (new DC::UI::Label align => 0, expand => 1, text => $name); |
1213 | $::INVR_HB->add (new DC::UI::Label expand => 1, text => $name); |
1208 | |
1214 | |
1209 | if ($tag != 0) { # Floor isn't closable, is it? |
1215 | if ($tag != 0) { # Floor isn't closable, is it? |
1210 | $::INVR_HB->add (new DC::UI::Button |
1216 | $::INVR_HB->add (new DC::UI::Button |
1211 | text => "Close container", |
1217 | text => "Close container", |
1212 | tooltip => "Close the currently open container (if one is open)", |
1218 | tooltip => "Close the currently open container (if one is open)", |
… | |
… | |
1296 | |
1302 | |
1297 | my $weight = .001 * $self->{player}{weight}; |
1303 | my $weight = .001 * $self->{player}{weight}; |
1298 | my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM}; |
1304 | my $limit = .001 * $self->{stat}{+CS_STAT_WEIGHT_LIM}; |
1299 | |
1305 | |
1300 | $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight); |
1306 | $::STATWIDS->{weight}->set_text (sprintf "Weight: %.1fkg", $weight); |
1301 | $::STATWIDS->{m_weight}->set_text (sprintf "%.1fkg", $limit); |
1307 | $::STATWIDS->{m_weight}->set_text (sprintf "Max Weight: %.1fkg", $limit); |
1302 | $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit); |
1308 | $::STATWIDS->{i_weight}->set_text (sprintf "%.1f/%.1fkg", $weight, $limit); |
1303 | } |
1309 | } |
1304 | |
1310 | |
1305 | sub update_server_info { |
1311 | sub update_server_info { |
1306 | my ($self) = @_; |
1312 | my ($self) = @_; |
… | |
… | |
1314 | . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" |
1320 | . "extended command support $yesno[$self->{setup}{extcmd} > 0]\n" |
1315 | . "examine command support $yesno[$self->{setup}{excmd} > 0]\n" |
1321 | . "examine command support $yesno[$self->{setup}{excmd} > 0]\n" |
1316 | . "editing support $yesno[!!$self->{editor_support}]\n" |
1322 | . "editing support $yesno[!!$self->{editor_support}]\n" |
1317 | . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" |
1323 | . "map attributes $yesno[$self->{setup}{extmap} > 0]\n" |
1318 | . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n" |
1324 | . "big image protocol support $yesno[$self->{setup}{fxix} > 0]\n" |
1319 | . "cfplus support $yesno[$self->{cfplus_ext} > 0]" |
1325 | . "client support $yesno[$self->{cfplus_ext} > 0]" |
1320 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
1326 | . ($self->{cfplus_ext} > 0 ? ", version $self->{cfplus_ext}" : "") ."\n" |
1321 | . "map size $self->{mapw}×$self->{maph}\n" |
1327 | . "map size $self->{mapw}×$self->{maph}\n" |
1322 | ); |
1328 | ); |
1323 | |
1329 | |
1324 | } |
1330 | } |