ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.288 by root, Mon Jun 5 21:14:40 2006 UTC vs.
Revision 1.298 by root, Wed Jun 7 07:00:30 2006 UTC

315} 315}
316 316
317sub move_abs { 317sub move_abs {
318 my ($self, $x, $y, $z) = @_; 318 my ($self, $x, $y, $z) = @_;
319 319
320 $self->{x} = List::Util::max 0, int $x; 320 $self->{x} = List::Util::max 0, List::Util::min $self->{root}{w} - $self->{w}, int $x;
321 $self->{y} = List::Util::max 0, int $y; 321 $self->{y} = List::Util::max 0, List::Util::min $self->{root}{h} - $self->{h}, int $y;
322 $self->{z} = $z if defined $z; 322 $self->{z} = $z if defined $z;
323 323
324 $self->update; 324 $self->update;
325} 325}
326 326
525 if $self->{parent}; 525 if $self->{parent};
526} 526}
527 527
528sub reconfigure { 528sub reconfigure {
529 my ($self) = @_; 529 my ($self) = @_;
530
531 # some widgets cache req_w and req_h
532 delete $self->{req_w};
533 delete $self->{req_h};
534 530
535 $self->realloc; 531 $self->realloc;
536 $self->update; 532 $self->update;
537} 533}
538 534
1559 $self->{text} = "T$text"; 1555 $self->{text} = "T$text";
1560 1556
1561 $self->{layout} = new CFClient::Layout if $self->{layout}->is_rgba; 1557 $self->{layout} = new CFClient::Layout if $self->{layout}->is_rgba;
1562 $self->{layout}->set_text ($text); 1558 $self->{layout}->set_text ($text);
1563 1559
1564 delete $self->{req_h}; 1560 delete $self->{size_req};
1565 $self->realloc; 1561 $self->realloc;
1566 $self->update; 1562 $self->update;
1567} 1563}
1568 1564
1569sub set_markup { 1565sub set_markup {
1575 my $rgba = $markup =~ /span.*(?:foreground|background)/; 1571 my $rgba = $markup =~ /span.*(?:foreground|background)/;
1576 1572
1577 $self->{layout} = new CFClient::Layout $rgba if $self->{layout}->is_rgba != $rgba; 1573 $self->{layout} = new CFClient::Layout $rgba if $self->{layout}->is_rgba != $rgba;
1578 $self->{layout}->set_markup ($markup); 1574 $self->{layout}->set_markup ($markup);
1579 1575
1580 delete $self->{req_h}; 1576 delete $self->{size_req};
1581 $self->realloc; 1577 $self->realloc;
1582 $self->update; 1578 $self->update;
1583} 1579}
1584 1580
1585sub size_request { 1581sub size_request {
1586 my ($self) = @_; 1582 my ($self) = @_;
1587 1583
1588 if (exists $self->{req_h}) { 1584 $self->{size_req} ||= do {
1589 @$self{qw(req_w req_h)}
1590 } else {
1591 $self->{layout}->set_font ($self->{font}) if $self->{font}; 1585 $self->{layout}->set_font ($self->{font}) if $self->{font};
1592 $self->{layout}->set_width ($self->{max_w} || -1); 1586 $self->{layout}->set_width ($self->{max_w} || -1);
1593 $self->{layout}->set_ellipsise ($self->{ellipsise}); 1587 $self->{layout}->set_ellipsise ($self->{ellipsise});
1594 $self->{layout}->set_single_paragraph_mode ($self->{ellipsise}); 1588 $self->{layout}->set_single_paragraph_mode ($self->{ellipsise});
1595 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); 1589 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE);
1604 1598
1605 $w = List::Util::max $w, $w2; 1599 $w = List::Util::max $w, $w2;
1606 $h = List::Util::max $h, $h2; 1600 $h = List::Util::max $h, $h2;
1607 } 1601 }
1608 1602
1609 ($w, $h) 1603 [$w, $h]
1610 } 1604 };
1605
1606 @{ $self->{size_req} }
1611} 1607}
1612 1608
1613sub size_allocate { 1609sub size_allocate {
1614 my ($self, $w, $h) = @_; 1610 my ($self, $w, $h) = @_;
1615 1611
1624 1620
1625 $self->{fontsize} = $fontsize; 1621 $self->{fontsize} = $fontsize;
1626 delete $self->{texture}; 1622 delete $self->{texture};
1627 1623
1628 $self->realloc; 1624 $self->realloc;
1625}
1626
1627sub reconfigure {
1628 my ($self) = @_;
1629
1630 delete $self->{size_req};
1631
1632 $self->SUPER::reconfigure;
1629} 1633}
1630 1634
1631sub _draw { 1635sub _draw {
1632 my ($self) = @_; 1636 my ($self) = @_;
1633 1637
1654 : ($self->{h} - $tex->{h}) * 0.5); 1658 : ($self->{h} - $tex->{h}) * 0.5);
1655 }; 1659 };
1656 1660
1657 glEnable GL_TEXTURE_2D; 1661 glEnable GL_TEXTURE_2D;
1658 1662
1663 my $w = List::Util::min $self->{w} + 4, $tex->{w};
1664 my $h = List::Util::min $self->{h} + 2, $tex->{h};
1665
1659 if ($tex->{format} == GL_ALPHA) { 1666 if ($tex->{format} == GL_ALPHA) {
1660 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 1667 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
1661 glColor @{$self->{fg}}; 1668 glColor @{$self->{fg}};
1662 $tex->draw_quad_alpha ($self->{ox}, $self->{oy}); 1669 $tex->draw_quad_alpha ($self->{ox}, $self->{oy}, $w, $h);
1663 } else { 1670 } else {
1664 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; 1671 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
1665 $tex->draw_quad_alpha_premultiplied ($self->{ox}, $self->{oy}); 1672 $tex->draw_quad_alpha_premultiplied ($self->{ox}, $self->{oy}, $w, $h);
1666 } 1673 }
1667 1674
1668 glDisable GL_TEXTURE_2D; 1675 glDisable GL_TEXTURE_2D;
1669} 1676}
1670 1677
1687 can_hover => 1, 1694 can_hover => 1,
1688 can_focus => 1, 1695 can_focus => 1,
1689 valign => 0, 1696 valign => 0,
1690 can_events => 1, 1697 can_events => 1,
1691 #text => ... 1698 #text => ...
1699 #hidden => "*",
1692 @_ 1700 @_
1693 ) 1701 )
1694} 1702}
1695 1703
1696sub _set_text { 1704sub _set_text {
1703 $self->{last_activity} = $::NOW; 1711 $self->{last_activity} = $::NOW;
1704 $self->{text} = $text; 1712 $self->{text} = $text;
1705 1713
1706 $text =~ s/./*/g if $self->{hidden}; 1714 $text =~ s/./*/g if $self->{hidden};
1707 $self->{layout}->set_text ("$text "); 1715 $self->{layout}->set_text ("$text ");
1708 delete $self->{req_h}; 1716 delete $self->{size_req};
1709 1717
1710 $self->_emit (changed => $self->{text}); 1718 $self->_emit (changed => $self->{text});
1711 1719
1712 $self->realloc; 1720 $self->realloc;
1713 $self->update; 1721 $self->update;
2299sub set_range { 2307sub set_range {
2300 my ($self, $range) = @_; 2308 my ($self, $range) = @_;
2301 2309
2302 ($range, $self->{range}) = ($self->{range}, $range); 2310 ($range, $self->{range}) = ($self->{range}, $range);
2303 2311
2304 $self->update
2305 if "@$range" ne "@{$self->{range}}"; 2312 if ("@$range" ne "@{$self->{range}}") {
2313 $self->update;
2314 $self->set_value ($self->{range}[0]);
2315 }
2306} 2316}
2307 2317
2308sub set_value { 2318sub set_value {
2309 my ($self, $value) = @_; 2319 my ($self, $value) = @_;
2310 2320
2457sub set_range { shift->{slider}->set_range (@_) } 2467sub set_range { shift->{slider}->set_range (@_) }
2458sub set_value { shift->{slider}->set_value (@_) } 2468sub set_value { shift->{slider}->set_value (@_) }
2459 2469
2460############################################################################# 2470#############################################################################
2461 2471
2462package CFClient::UI::TextView; 2472package CFClient::UI::TextScroller;
2463 2473
2464our @ISA = CFClient::UI::HBox::; 2474our @ISA = CFClient::UI::HBox::;
2465 2475
2466use CFClient::OpenGL; 2476use CFClient::OpenGL;
2467 2477
2469 my $class = shift; 2479 my $class = shift;
2470 2480
2471 my $self = $class->SUPER::new ( 2481 my $self = $class->SUPER::new (
2472 fontsize => 1, 2482 fontsize => 1,
2473 can_events => 0, 2483 can_events => 0,
2484 indent => 0,
2474 #font => default_font 2485 #font => default_font
2475 @_, 2486 @_,
2476 2487
2477 layout => (new CFClient::Layout 1), 2488 layout => (new CFClient::Layout 1),
2478 par => [], 2489 par => [],
2501 $self->SUPER::size_allocate ($w, $h); 2512 $self->SUPER::size_allocate ($w, $h);
2502 2513
2503 $self->{layout}->set_font ($self->{font}) if $self->{font}; 2514 $self->{layout}->set_font ($self->{font}) if $self->{font};
2504 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); 2515 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE);
2505 $self->{layout}->set_width ($self->{children}[0]{w}); 2516 $self->{layout}->set_width ($self->{children}[0]{w});
2517 $self->{layout}->set_indent ($self->{fontsize} * $::FONTSIZE * $self->{indent});
2506 2518
2507 $self->reflow; 2519 $self->reflow;
2508} 2520}
2509 2521
2510sub text_size { 2522sub text_size {
2512 2524
2513 my $layout = $self->{layout}; 2525 my $layout = $self->{layout};
2514 2526
2515 $layout->set_height ($self->{fontsize} * $::FONTSIZE); 2527 $layout->set_height ($self->{fontsize} * $::FONTSIZE);
2516 $layout->set_width ($self->{children}[0]{w} - $indent); 2528 $layout->set_width ($self->{children}[0]{w} - $indent);
2529 $layout->set_indent ($self->{fontsize} * $::FONTSIZE * $self->{indent});
2517 $layout->set_markup ($text); 2530 $layout->set_markup ($text);
2518 2531
2519 $layout->size 2532 $layout->size
2520} 2533}
2521 2534
2560 2573
2561 return unless $self->{h} > 0; 2574 return unless $self->{h} > 0;
2562 2575
2563 delete $self->{texture}; 2576 delete $self->{texture};
2564 2577
2565 $ROOT->on_post_alloc ($self, sub { 2578 $ROOT->on_post_alloc ($self => sub {
2566 my ($W, $H) = @{$self->{children}[0]}{qw(w h)}; 2579 my ($W, $H) = @{$self->{children}[0]}{qw(w h)};
2567 2580
2568 if (delete $self->{need_reflow}) { 2581 if (delete $self->{need_reflow}) {
2569 my $height = 0; 2582 my $height = 0;
2570 2583
2573 $layout->set_height ($self->{fontsize} * $::FONTSIZE); 2586 $layout->set_height ($self->{fontsize} * $::FONTSIZE);
2574 2587
2575 for (@{$self->{par}}) { 2588 for (@{$self->{par}}) {
2576 if (1 || $_->[0] >= $W) { # TODO: works,but needs reconfigure etc. support 2589 if (1 || $_->[0] >= $W) { # TODO: works,but needs reconfigure etc. support
2577 $layout->set_width ($W - $_->[3]); 2590 $layout->set_width ($W - $_->[3]);
2591 $layout->set_indent ($self->{fontsize} * $::FONTSIZE * $self->{indent});
2578 $layout->set_markup ($_->[4]); 2592 $layout->set_markup ($_->[4]);
2579 my ($w, $h) = $layout->size; 2593 my ($w, $h) = $layout->size;
2580 $_->[0] = $w + $_->[3]; 2594 $_->[0] = $w + $_->[3];
2581 $_->[1] = $h; 2595 $_->[1] = $h;
2582 } 2596 }
2585 } 2599 }
2586 2600
2587 $self->{height} = $height; 2601 $self->{height} = $height;
2588 2602
2589 $self->{children}[1]->set_range ([$height, 0, $height, $H, 1]); 2603 $self->{children}[1]->set_range ([$height, 0, $height, $H, 1]);
2590 2604
2591 delete $self->{texture}; 2605 delete $self->{texture};
2592 } 2606 }
2593 2607
2594 $self->{texture} ||= new_from_opengl CFClient::Texture $W, $H, sub { 2608 $self->{texture} ||= new_from_opengl CFClient::Texture $W, $H, sub {
2595 glClearColor 0, 0, 0, 0; 2609 glClearColor 0, 0, 0, 0;
2614 my $h = $par->[1]; 2628 my $h = $par->[1];
2615 2629
2616 if ($y0 < $y + $h && $y < $y1) { 2630 if ($y0 < $y + $h && $y < $y1) {
2617 $layout->set_foreground (@{ $par->[2] }); 2631 $layout->set_foreground (@{ $par->[2] });
2618 $layout->set_width ($W - $par->[3]); 2632 $layout->set_width ($W - $par->[3]);
2633 $layout->set_indent ($self->{fontsize} * $::FONTSIZE * $self->{indent});
2619 $layout->set_markup ($par->[4]); 2634 $layout->set_markup ($par->[4]);
2620 2635
2621 my ($w, $h, $data, $format, $internalformat) = $layout->render; 2636 my ($w, $h, $data, $format, $internalformat) = $layout->render;
2622 2637
2623 glRasterPos $par->[3], $y - $y0; 2638 glRasterPos $par->[3], $y - $y0;
2737 $tooltip .= "\n\n" . (ref $widget) . "\n" 2752 $tooltip .= "\n\n" . (ref $widget) . "\n"
2738 . "$widget->{x} $widget->{y} $widget->{w} $widget->{h}\n" 2753 . "$widget->{x} $widget->{y} $widget->{w} $widget->{h}\n"
2739 . "req $widget->{req_w} $widget->{req_h}\n" 2754 . "req $widget->{req_w} $widget->{req_h}\n"
2740 . "visible $widget->{visible}"; 2755 . "visible $widget->{visible}";
2741 } 2756 }
2757
2758 $tooltip =~ s/^\n+//;
2759 $tooltip =~ s/\n+$//;
2742 2760
2743 $self->add (new CFClient::UI::Label 2761 $self->add (new CFClient::UI::Label
2744 markup => $tooltip, 2762 markup => $tooltip,
2745 max_w => ($widget->{tooltip_width} || 0.25) * $::WIDTH, 2763 max_w => ($widget->{tooltip_width} || 0.25) * $::WIDTH,
2746 fontsize => 0.8, 2764 fontsize => 0.8,
2774 or return; 2792 or return;
2775 2793
2776 my ($x, $y) = $widget->coord2global ($widget->{w}, 0); 2794 my ($x, $y) = $widget->coord2global ($widget->{w}, 0);
2777 2795
2778 ($x, $y) = $widget->coord2global (-$self->{w}, 0) 2796 ($x, $y) = $widget->coord2global (-$self->{w}, 0)
2779 if $x + $self->{w} > $::WIDTH; 2797 if $x + $self->{w} > $self->{root}{w};
2780 2798
2781 $self->move_abs ($x, $y); 2799 $self->move_abs ($x, $y);
2782 }); 2800 });
2783} 2801}
2784 2802
2916 ); 2934 );
2917 2935
2918 $self->add ($self->{vbox} = new CFClient::UI::VBox); 2936 $self->add ($self->{vbox} = new CFClient::UI::VBox);
2919 2937
2920 for my $item (@{ $self->{items} }) { 2938 for my $item (@{ $self->{items} }) {
2921 my ($widget, $cb) = @$item; 2939 my ($widget, $cb, $tooltip) = @$item;
2922 2940
2923 # handle various types of items, only text for now 2941 # handle various types of items, only text for now
2924 if (!ref $widget) { 2942 if (!ref $widget) {
2925 $widget = new CFClient::UI::Label 2943 $widget = new CFClient::UI::Label
2926 can_hover => 1, 2944 can_hover => 1,
2927 can_events => 1, 2945 can_events => 1,
2928 text => $widget; 2946 markup => $widget,
2947 tooltip => $tooltip
2929 } 2948 }
2930 2949
2931 $self->{item}{$widget} = $item; 2950 $self->{item}{$widget} = $item;
2932 2951
2933 $self->{vbox}->add ($widget); 2952 $self->{vbox}->add ($widget);
3080sub set_current_page { 3099sub set_current_page {
3081 my ($self, $page) = @_; 3100 my ($self, $page) = @_;
3082 3101
3083 $self->{multiplexer}->set_current_page ($page); 3102 $self->{multiplexer}->set_current_page ($page);
3084 $self->_emit (page_changed => $self->{multiplexer}{current}); 3103 $self->_emit (page_changed => $self->{multiplexer}{current});
3104}
3105
3106#############################################################################
3107
3108package CFClient::UI::Combobox;
3109
3110use utf8;
3111
3112our @ISA = CFClient::UI::Button::;
3113
3114sub new {
3115 my $class = shift;
3116
3117 my $self = $class->SUPER::new (
3118 options => [], # [value, title, longdesc], ...
3119 value => undef,
3120 @_,
3121 );
3122
3123 $self->_set_value ($self->{value});
3124
3125 $self
3126}
3127
3128sub button_down {
3129 my ($self, $ev) = @_;
3130
3131 my @menu_items;
3132
3133 for (@{ $self->{options} }) {
3134 my ($value, $title, $tooltip) = @$_;
3135
3136 push @menu_items, [$tooltip || $title, sub { $self->set_value ($value) }];
3137 }
3138
3139 CFClient::UI::Menu->new (items => \@menu_items)->popup ($ev);
3140}
3141
3142sub _set_value {
3143 my ($self, $value) = @_;
3144
3145 my ($item) = grep $_->[0] eq $value, @{ $self->{options} }
3146 or return;
3147
3148 $self->{value} = $item->[0];
3149 $self->set_markup ("$item->[1] ⇓");
3150 $self->set_tooltip ($item->[2]);
3151}
3152
3153sub set_value {
3154 my ($self, $value) = @_;
3155
3156 return unless $self->{value} ne $value;
3157
3158 $self->_set_value ($value);
3159 $self->_emit (changed => $value);
3085} 3160}
3086 3161
3087############################################################################# 3162#############################################################################
3088 3163
3089package CFClient::UI::Statusbox; 3164package CFClient::UI::Statusbox;
3480 commands => [], 3555 commands => [],
3481 @_, 3556 @_,
3482 ) 3557 )
3483} 3558}
3484 3559
3485# XXX: Do sorting? Argl... 3560my $TOOLTIP_ALL = "\n\n<small>Left click - ready spell\nMiddle click - invoke spell\nRight click - further options</small>";
3561
3562my @TOOLTIP_NAME = (align => 0, can_events => 1, can_hover => 1, tooltip =>
3563 "<b>Name</b>. The name of the spell.$TOOLTIP_ALL");
3564my @TOOLTIP_LVL = (align => 1, can_events => 1, can_hover => 1, tooltip =>
3565 "<b>Level</b>. Minimum level the caster needs in the associated skill to be able to attempt casting this spell.$TOOLTIP_ALL");
3566my @TOOLTIP_SP = (align => 1, can_events => 1, can_hover => 1, tooltip =>
3567 "<b>Spell points / Grace points</b>. Amount of spell or grace points used by each invocation.$TOOLTIP_ALL");
3568my @TOOLTIP_DMG = (align => 1, can_events => 1, can_hover => 1, tooltip =>
3569 "<b>Damage</b>. The amount of damage the spell deals when it hits.$TOOLTIP_ALL");
3570
3571sub rebuild_spell_list {
3572 my ($self) = @_;
3573
3574 $CFClient::UI::ROOT->on_refresh ($self => sub {
3575 $self->clear;
3576
3577 $self->add (1, 0, new CFClient::UI::Label text => "Spell Name", @TOOLTIP_NAME);
3578 $self->add (2, 0, new CFClient::UI::Label text => "Lvl" , @TOOLTIP_LVL);
3579 $self->add (3, 0, new CFClient::UI::Label text => "Sp/Gp", @TOOLTIP_SP);
3580 $self->add (4, 0, new CFClient::UI::Label text => "Dmg" , @TOOLTIP_DMG);
3581
3582 my $row = 0;
3583
3584 for (sort { $a cmp $b } keys %{ $self->{spell} }) {
3585 my $spell = $self->{spell}{$_};
3586
3587 $row++;
3588
3589 my $spell_cb = sub {
3590 my ($widget, $ev) = @_;
3591
3592 if ($ev->{button} == 1) {
3593 $::CONN->user_send ("cast $spell->{name}");
3594 } elsif ($ev->{button} == 2) {
3595 $::CONN->user_send ("invoke $spell->{name}");
3596 } elsif ($ev->{button} == 3) {
3597 (new CFClient::UI::Menu
3598 items => [
3599 ["bind <i>cast $spell->{name}</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["cast $spell->{name}"]) }],
3600 ["bind <i>invoke $spell->{name}</i> to a key" => sub { $::BIND_EDITOR->do_quick_binding (["invoke $spell->{name}"]) }],
3601 ],
3602 )->popup ($ev);
3603 } else {
3604 return 0;
3605 }
3606
3607 1
3608 };
3609
3610 $self->add (0, $row, new CFClient::UI::Face
3611 face => $spell->{face},
3612 can_hover => 1,
3613 can_events => 1,
3614 tooltip => $spell->{message},
3615 on_button_down => $spell_cb,
3616 );
3617
3618 $self->add (1, $row, new CFClient::UI::Label
3619 expand => 1,
3620 text => $spell->{name},
3621 can_hover => 1,
3622 can_events => 1,
3623 tooltip => "$spell->{message}$TOOLTIP_ALL",
3624 on_button_down => $spell_cb,
3625 );
3626
3627 $self->add (2, $row, new CFClient::UI::Label text => $spell->{level}, @TOOLTIP_LVL);
3628 $self->add (3, $row, new CFClient::UI::Label text => $spell->{mana} || $spell->{grace}, @TOOLTIP_SP);
3629 $self->add (4, $row, new CFClient::UI::Label text => $spell->{damage}, @TOOLTIP_DMG);
3630 }
3631 });
3632}
3633
3486sub add_spell { 3634sub add_spell {
3487 my ($self, $spell) = @_; 3635 my ($self, $spell) = @_;
3636
3488 $self->{spells}->{$spell->{name}} = $spell; 3637 $self->{spell}->{$spell->{name}} = $spell;
3489 3638 $self->rebuild_spell_list;
3490 $self->add (0, $self->{tbl_idx}, new CFClient::UI::Face
3491 face => $spell->{face},
3492 can_hover => 1,
3493 can_events => 1,
3494 tooltip => $spell->{message});
3495
3496 $self->add (1, $self->{tbl_idx}, new CFClient::UI::Label
3497 text => $spell->{name},
3498 can_hover => 1,
3499 can_events => 1,
3500 tooltip => $spell->{message},
3501 expand => 1);
3502
3503 $self->add (2, $self->{tbl_idx}, new CFClient::UI::Label
3504 text => (sprintf "lvl: %2d sp: %2d dmg: %2d",
3505 $spell->{level}, ($spell->{mana} || $spell->{grace}), $spell->{damage}),
3506 expand => 1);
3507
3508 $self->add (3, $self->{tbl_idx}++, new CFClient::UI::Button
3509 text => "bind to key",
3510 on_activate => sub { $::BIND_EDITOR->do_quick_binding (["cast $spell->{name}"]) });
3511}
3512
3513sub rebuild_spell_list {
3514 my ($self) = @_;
3515 $self->{tbl_idx} = 0;
3516 $self->add_spell ($_) for values %{$self->{spells}};
3517} 3639}
3518 3640
3519sub remove_spell { 3641sub remove_spell {
3520 my ($self, $spell) = @_; 3642 my ($self, $spell) = @_;
3643
3521 delete $self->{spells}->{$spell->{name}}; 3644 delete $self->{spell}->{$spell->{name}};
3522 $self->rebuild_spell_list; 3645 $self->rebuild_spell_list;
3523} 3646}
3524 3647
3525############################################################################# 3648#############################################################################
3526 3649

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines