… | |
… | |
1377 | }); |
1377 | }); |
1378 | refresh; |
1378 | refresh; |
1379 | } |
1379 | } |
1380 | |
1380 | |
1381 | sub conn::container_add { |
1381 | sub conn::container_add { |
1382 | my ($self, $id, $items) = @_; |
1382 | my ($self, $tag, $items) = @_; |
1383 | |
1383 | |
1384 | update_floorbox if $id == 0; |
1384 | update_floorbox if $tag == 0; |
1385 | if ($self->{player}{tag} == $id) { |
1385 | |
1386 | $INV->set_items ($self->{container}{$self->{player}{tag}}); |
1386 | $INV->set_items ($self->{container}{$self->{player}{tag}}) |
1387 | } |
1387 | if $tag == $self->{player}{tag}; |
|
|
1388 | |
1388 | # $self-<{player}{tag} => player inv |
1389 | # $self-<{player}{tag} => player inv |
1389 | #use PApp::Util; warn PApp::Util::dumpval $self->{container}{$self->{player}{tag}}; |
1390 | #use PApp::Util; warn PApp::Util::dumpval $self->{container}{$self->{player}{tag}}; |
1390 | } |
1391 | } |
1391 | |
1392 | |
1392 | sub conn::container_clear { |
1393 | sub conn::container_clear { |
1393 | my ($self, $id) = @_; |
1394 | my ($self, $tag) = @_; |
1394 | |
1395 | |
1395 | update_floorbox if $id == 0; |
1396 | update_floorbox if $tag == 0; |
1396 | if ($self->{player}{tag} == $id) { |
1397 | |
1397 | $INV->set_items ($self->{container}{$id}); |
1398 | $INV->set_items ($self->{container}{$tag}) |
1398 | } |
1399 | if $tag == $self->{player}{tag}; |
1399 | |
1400 | |
1400 | # use PApp::Util; warn PApp::Util::dumpval $self->{container}{0}; |
1401 | # use PApp::Util; warn PApp::Util::dumpval $self->{container}{0}; |
1401 | } |
1402 | } |
1402 | |
1403 | |
1403 | sub conn::item_delete { |
1404 | sub conn::item_delete { |
1404 | my ($self, @items) = @_; |
1405 | my ($self, @items) = @_; |
1405 | |
1406 | |
1406 | for (@items) { |
1407 | for (@items) { |
1407 | update_floorbox if $_->{container} == 0; |
1408 | update_floorbox if $_->{container} == 0; |
1408 | if ($self->{player}{tag} == $_->{container}) { |
1409 | |
1409 | $INV->set_items ($self->{container}{$_->{container}}); |
1410 | $INV->set_items ($self->{container}{$_->{container}}) |
1410 | } |
1411 | if $_->{container} == $self->{player}{tag}; |
1411 | } |
1412 | } |
1412 | } |
1413 | } |
1413 | |
1414 | |
1414 | sub conn::item_update { |
1415 | sub conn::item_update { |
1415 | my ($self, $item) = @_; |
1416 | my ($self, $item) = @_; |
1416 | |
1417 | |
1417 | update_floorbox if $item->{container} == 0; |
1418 | update_floorbox if $item->{container} == 0; |
1418 | if ($self->{player}{tag} == $item->{container}) { |
1419 | |
1419 | $INV->set_items ($self->{container}{$item->{container}}); |
1420 | $INV->set_items ($self->{container}{$item->{container}}) |
1420 | } |
1421 | if $item->{container}; == $self->{player}{tag}; |
1421 | } |
1422 | } |
1422 | |
1423 | |
1423 | %SDL_CB = ( |
1424 | %SDL_CB = ( |
1424 | CFClient::SDL_QUIT => sub { |
1425 | CFClient::SDL_QUIT => sub { |
1425 | Event::unloop -1; |
1426 | Event::unloop -1; |