Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2016, 6:34:27 PM (7 years ago)
Author:
patricwi
Message:

visualization finished, bug when ending or reloading the level

File:
1 edited

Legend:

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

    r11323 r11325  
    5151        overlayElement_->setPosition(0.0f,0.0f);
    5252        overlayElement_->setDimensions(0.70f,0.15f);
    53         orxout() << "hello here is the HUDPickupSystem" << endl;
    5453        this->background_->addChild(overlayElement_);
    5554    }
     
    6362    }
    6463
    65    //TODO: XMLPort
    66 
    6764    void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks)
    6865    {
    6966        int i=0;
    70         const float offsetX = 0.32f;
     67        const float offsetX = 0.335f;
    7168        float offsetY = 0.77f;
    7269        const float x = 0.1f;
     
    8885                {
    8986                    HUDPickupItem* item = new HUDPickupItem(this->getContext());
    90                     // item->initializeMaterial(((Pickup*)p)->getRepresentationName(), offsetX+i*x, offsetY);
    91                 if(i%2==0)
    92                     item->initializeMaterial("Shield", offsetX+i*x, offsetY);
    93                 else
    94                     item->initializeMaterial("ArrowUp", offsetX+i*x, offsetY);
    95                 item->setOverlayGroup(this->getOverlayGroup());
    96                 this->picks[p] = item;
     87                    item->initializeMaterial(this->getIcon(((Pickup*)p)->getRepresentationName()), offsetX+i*x, offsetY);
     88                    orxout() << ((Pickup*)p)->getRepresentationName() << endl;
     89               
     90                    item->setOverlayGroup(this->getOverlayGroup());
     91                    this->picks[p] = item;
    9792                }
    9893               
     
    113108        assert(item);
    114109        // item->setOverlayGroup(nullptr);
    115         item->hideMe(pickup);
     110        item->hideMe(pickup, repaint);
    116111        assert(overlayElement_);
    117112        // overlayElement_->_update();
     
    125120        this->background_->removeChild(overlayElement_->getName());
    126121    }
     122
     123    std::string HUDPickupSystem::getIcon(std::string repName)
     124    {
     125        if(repName.find("invisible", 0)!=std::string::npos) return "Eye";
     126        else if(repName.find("tri", 0)!=std::string::npos) return "Asterix";
     127        else if(repName.find("health", 0)!=std::string::npos || repName.find("Health", 0)!=std::string::npos) return "Cross";
     128        else if(repName.find("shield", 0)!=std::string::npos) return "Shield";
     129        else if(repName.find("munition", 0)!=std::string::npos) return "Munition";
     130        else if(repName.find("shrink", 0)!=std::string::npos) return "Shrink";
     131        else if(repName.find("boost", 0)!=std::string::npos) return "Flash";
     132        else if(repName.find("speed", 0)!=std::string::npos) return "3arrowsup";
     133        else if(repName.find("drone", 0)!=std::string::npos) return "Damage";
     134        //        else if(repName.find("xxxxxxx", 0)!=std::string::npos) return "Splash";
     135        else return "Unknown";
     136    }
    127137}
Note: See TracChangeset for help on using the changeset viewer.