Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2016, 6:01:02 PM (9 years ago)
Author:
patricwi
Message:

bug when ending or restarting a game with non-empty inventory and size and address of pickups still has to be specified so that the item corresponds to the right pickup symbol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc

    r11314 r11323  
    5959        if (this->isInitialized())
    6060        {
    61             //TODO: Destroy me
     61            this->picks.clear();
    6262        }
    6363    }
     
    8080            {
    8181                // orxout() << "actual pick is: " << p << endl;
    82                 if(i%4==0)
     82                if(i%5==0)
    8383                {
    8484                    offsetY+=0.04f;
    8585                    i=0;
    8686                }   
    87                 HUDPickupItem* item = new HUDPickupItem(this->getContext());
    88                 // item->initializeMaterial(((Pickup*)p)->getRepresentationName(), offsetX+i*x, offsetY);
     87                if(this->picks.count(p)==0)
     88                {
     89                    HUDPickupItem* item = new HUDPickupItem(this->getContext());
     90                    // item->initializeMaterial(((Pickup*)p)->getRepresentationName(), offsetX+i*x, offsetY);
    8991                if(i%2==0)
    9092                    item->initializeMaterial("Shield", offsetX+i*x, offsetY);
     
    9395                item->setOverlayGroup(this->getOverlayGroup());
    9496                this->picks[p] = item;
     97                }
     98               
    9599                ++i;
    96100            }
     
    104108    void HUDPickupSystem::removePickup(Pickupable* pickup)
    105109    {
     110        assert(pickup);
    106111        HUDPickupItem* item = this->picks.find(pickup)->second;
    107112        orxout() << "removePickup: pickup= " << pickup << " item= " << item << endl;
    108113        assert(item);
    109         item->setOverlayGroup(nullptr);
    110         item->hideMe();
    111         overlayElement_->_update();
     114        // item->setOverlayGroup(nullptr);
     115        item->hideMe(pickup);
     116        assert(overlayElement_);
     117        // overlayElement_->_update();
     118        assert(this->background_);
     119        // this->background_->_update();
     120        this->picks.erase(pickup);
    112121    }
    113122
Note: See TracChangeset for help on using the changeset viewer.