… | |
… | |
438 | # try to create single paragraphs of multiple lines sent by the server |
438 | # try to create single paragraphs of multiple lines sent by the server |
439 | $spell->{message} =~ s/(?<=\S)\n(?=\w)/ /g; |
439 | $spell->{message} =~ s/(?<=\S)\n(?=\w)/ /g; |
440 | $spell->{message} =~ s/\n+$//; |
440 | $spell->{message} =~ s/\n+$//; |
441 | $spell->{message} ||= "Server did not provide a description for this spell."; |
441 | $spell->{message} ||= "Server did not provide a description for this spell."; |
442 | |
442 | |
443 | $::SETUP_SPELLS->add_spell ($spell); |
443 | $::SPELL_PAGE->add_spell ($spell); |
444 | |
444 | |
445 | $self->{map_widget}->add_command ("invoke $spell->{name}", CFClient::UI::Label::escape $spell->{message}); |
445 | $self->{map_widget}->add_command ("invoke $spell->{name}", CFClient::UI::Label::escape $spell->{message}); |
446 | $self->{map_widget}->add_command ("cast $spell->{name}", CFClient::UI::Label::escape $spell->{message}); |
446 | $self->{map_widget}->add_command ("cast $spell->{name}", CFClient::UI::Label::escape $spell->{message}); |
447 | } |
447 | } |
448 | |
448 | |
449 | sub spell_delete { |
449 | sub spell_delete { |
450 | my ($self, $spell) = @_; |
450 | my ($self, $spell) = @_; |
|
|
451 | |
451 | $::SETUP_SPELLS->remove_spell ($spell); |
452 | $::SPELL_PAGE->remove_spell ($spell); |
452 | } |
453 | } |
453 | |
454 | |
454 | sub addme_success { |
455 | sub addme_success { |
455 | my ($self) = @_; |
456 | my ($self) = @_; |
456 | |
457 | |
… | |
… | |
536 | |
537 | |
537 | $row++; |
538 | $row++; |
538 | } else { |
539 | } else { |
539 | $::FLOORBOX->add (1, $row, new CFClient::UI::Button |
540 | $::FLOORBOX->add (1, $row, new CFClient::UI::Button |
540 | text => "More...", |
541 | text => "More...", |
541 | on_activate => sub { $::INV_WINDOW->toggle_visibility; 0 }, |
542 | on_activate => sub { ::toggle_player_page ($::INVENTORY_PAGE); 0 }, |
542 | ); |
543 | ); |
543 | last; |
544 | last; |
544 | } |
545 | } |
545 | } |
546 | } |
546 | }); |
547 | }); |