[11263] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
| 23 | * Patrick Wintermeyer |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
[11277] | 29 | #include <vector> |
---|
| 30 | #include <string> |
---|
| 31 | |
---|
[11263] | 32 | #include "core/CoreIncludes.h" |
---|
| 33 | #include "core/XMLPort.h" |
---|
| 34 | #include "util/Convert.h" |
---|
| 35 | #include "core/class/Super.h" |
---|
[11277] | 36 | #include "HUDPickupSystem.h" |
---|
| 37 | #include "pickup/Pickup.h" |
---|
| 38 | #include "HUDPickupItem.h" |
---|
[11305] | 39 | #include "pickup/PickupManager.h" |
---|
[11263] | 40 | |
---|
| 41 | namespace orxonox |
---|
| 42 | { |
---|
| 43 | RegisterClass(HUDPickupSystem); |
---|
| 44 | |
---|
| 45 | HUDPickupSystem::HUDPickupSystem(Context* context) : OrxonoxOverlay(context) |
---|
| 46 | { |
---|
| 47 | RegisterObject(HUDPickupSystem); |
---|
| 48 | |
---|
[11277] | 49 | overlayElement_ = static_cast<Ogre::PanelOverlayElement* >(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "HUDPickupSystem" + getUniqueNumberString())); |
---|
| 50 | overlayElement_->setMaterialName("PickupBar"); |
---|
| 51 | overlayElement_->setPosition(0.0f,0.0f); |
---|
| 52 | overlayElement_->setDimensions(0.70f,0.15f); |
---|
[11293] | 53 | orxout() << "hello here is the HUDPickupSystem" << endl; |
---|
[11277] | 54 | this->background_->addChild(overlayElement_); |
---|
| 55 | |
---|
[11305] | 56 | PickupManager::getInstance().setPickupSystem(this); |
---|
[11263] | 57 | } |
---|
| 58 | |
---|
| 59 | HUDPickupSystem::~HUDPickupSystem() |
---|
| 60 | { |
---|
| 61 | if (this->isInitialized()) |
---|
| 62 | { |
---|
| 63 | //TODO: Destroy me |
---|
| 64 | } |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | //TODO: XMLPort |
---|
| 68 | |
---|
[11305] | 69 | void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks) |
---|
[11263] | 70 | { |
---|
[11305] | 71 | for(Pickupable* p : picks) |
---|
[11277] | 72 | { |
---|
[11293] | 73 | HUDPickupItem* item = new HUDPickupItem(this->getContext()); |
---|
[11305] | 74 | item->initializeMaterial(((Pickup*)p)->getRepresentationName()); |
---|
[11295] | 75 | item->printHello(); |
---|
[11277] | 76 | } |
---|
[11263] | 77 | } |
---|
| 78 | |
---|
| 79 | void HUDPickupSystem::createPickupList() |
---|
| 80 | { |
---|
| 81 | |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | void HUDPickupSystem::destroyAll() |
---|
| 85 | { |
---|
| 86 | |
---|
| 87 | } |
---|
| 88 | } |
---|