Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2016, 4:18:45 PM (7 years ago)
Author:
patricwi
Message:

linker error

Location:
code/branches/HUD_HS16/src/modules
Files:
6 edited

Legend:

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

    r11295 r11305  
    6565    }
    6666
    67     void initializeMaterial(const std::string& s)
     67    void HUDPickupItem::initializeMaterial(const std::string& s)
    6868    {
    6969        overlayElement_->setMaterialName(s);
    7070    }
    7171
    72     void printHello()
     72    void HUDPickupItem::printHello()
    7373    {
    7474        orxout() << "lets say hello" << endl;
  • code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.h

    r11295 r11305  
    5353}
    5454
    55 #endif /* _HUDWeapon_H__ */
     55#endif
  • code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc

    r11295 r11305  
    3737#include "pickup/Pickup.h"
    3838#include "HUDPickupItem.h"
     39#include "pickup/PickupManager.h"
    3940
    4041namespace orxonox
     
    5354        this->background_->addChild(overlayElement_);
    5455
     56        PickupManager::getInstance().setPickupSystem(this);
    5557    }
    5658
     
    6567   //TODO: XMLPort
    6668
    67     void HUDPickupSystem::updatePickupList(std::vector<WeakPtr<Pickup>> picks)
     69    void HUDPickupSystem::updatePickupList(std::vector<Pickupable*> picks)
    6870    {
    69         for(Pickup* p : picks)
     71        for(Pickupable* p : picks)
    7072        {
    7173            HUDPickupItem* item = new HUDPickupItem(this->getContext());
    72             // item->initializeMaterial(p->getRepresentationName());
     74            item->initializeMaterial(((Pickup*)p)->getRepresentationName());
    7375            item->printHello();
    7476        }
  • code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.h

    r11293 r11305  
    2626 *
    2727 */
     28
     29
     30#ifndef _HUDPickupSystem_H__
     31#define _HUDPickupSystem_H__
     32
    2833#include "overlays/OverlaysPrereqs.h"
    2934
     
    5863        // virtual void positionChanged() override;
    5964        // virtual void sizeChanged() override;
     65        void updatePickupList(std::vector<Pickupable*> picks);   
    6066    private:
    61         void updatePickupList(std::vector<WeakPtr<Pickup>> picks);
    6267        void createPickupList();
    6368        void destroyAll();
     
    6974    };
    7075}
     76
     77#endif
  • code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc

    r11277 r11305  
    5151#include "CollectiblePickup.h"
    5252#include "PickupRepresentation.h"
    53 // #include "overlays/hud/HUDPickupSystem.h"
     53#include "overlays/hud/HUDPickupSystem.h"
    5454
    5555namespace orxonox
     
    7070    SetConsoleCommand("useUnusePickup", &PickupManager::useUnusePickup).addShortcut().setActive(true);
    7171
    72    // SetConsoleCommand("HumanController", "fire",           &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
    7372    /**
    7473    @brief
     
    8281
    8382        orxout(internal_info, context::pickups) << "PickupManager created." << endl;
     83    }
     84
     85    void PickupManager::setPickupSystem(HUDPickupSystem* system)
     86    {
     87        pickupSystem=system;
    8488    }
    8589
     
    295299            this->pickups_[index] = pickup;
    296300
    297             //  //Add pickup keybinding
    298             // if( KeyBinderManager::exists() )
    299             //     addKeyBindingForNewPickup(pickup, index);
    300             // else
    301             //     orxout() << "Could not create new keybinding because KeyBinderManager doesn't exist." << endl;
     301            //TODO
     302            std::vector<Pickupable*> picks;
     303
     304            PickupManager& manager = PickupManager::getInstance();
     305           
     306            Pickupable* pickup = nullptr;
     307
     308            for(uint32_t i = 0; i!=10; i++)
     309            {
     310                pickup=manager.pickups_.find(i)->second;
     311                picks.push_back(pickup);
     312            }
     313            // pickupSystem->updatePickupList(picks);
     314           
    302315        }
    303316        else // If it was dropped, it is removed from the required lists.
     
    307320            index = it->second;
    308321
    309             // //Remove pickup keybinding
    310             // if( KeyBinderManager::exists() )
    311             //       removeKeyBindingForOldPickup(pickup, index);
    312             // else
    313             //     orxout() << "Could not delete old keybinding because KeyBinderManager doesn't exist." << endl;
    314 
    315             // Remove the Pickupable from the indexes_ and pickups_ list.
     322           
    316323            this->indexes_.erase(pickup);
    317324            this->pickups_.find(index)->second=nullptr; //set to null, so that can be identified as free slot by getPickupIndex()
     
    342349
    343350    }
    344 
    345     //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9
    346     //FUNCTION: Adds a keybinding for the new pickup using its index and sets a console command
    347     // void PickupManager::addKeyBindingForNewPickup(Pickupable* pickup, uint32_t index)
    348     // {
    349     //     std::string name="Keys.KeyNumpad";
    350     //     std::string binding="useOrUnusePickup";
    351 
    352     //     name.append(std::to_string(index));
    353     //     binding.append(std::to_string(index));
    354 
    355     //     SetConsoleCommand(binding, &PickupManager::useUnusePickup(pickup, index));
    356     //     KeyBinderManager::getInstance().getCurrent()->setBinding(binding, name, true);
    357 
    358     //     orxout() << "Keybinding for item " << index << " has been added on keybinding " << name << endl;
    359 
    360 
    361     // }
    362 
    363     //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9
    364     //FUNCTION: Removes the keybinding of the pickup using its index
    365     // void PickupManager::removeKeyBindingForOldPickup(Pickupable* pickup, uint32_t index)
    366     // {
    367     //     std::string name="Keys.KeyNumpad";
    368     //     std::string binding="";
    369 
    370     //     name.append(std::to_string(index));
    371 
    372     //     SetConsoleCommand(binding, nullptr);
    373     //     KeyBinderManager::getInstance().getCurrent()->setBinding("", name, true);
    374 
    375     //     orxout() << "Keybinding for item " << index << " has been removed on keybinding " << name << endl;
    376 
    377     // }
    378351
    379352    //This function is called by the command line or by the key binding
  • code/branches/HUD_HS16/src/modules/pickup/PickupManager.h

    r11253 r11305  
    4545#include "util/Singleton.h"
    4646#include "interfaces/PickupListener.h"
     47#include "overlays/hud/HUDPickupSystem.h"
    4748
    4849namespace orxonox // tolua_export
     
    148149            static void dropPickupNetworked(uint32_t pickup); //!< Helper method to drop the input pickup on the server.
    149150            static void usePickupNetworked(uint32_t pickup, bool use); //!< Helper method to use (or unuse) the input Pickupable on the server.
     151            void setPickupSystem(HUDPickupSystem* system);
    150152
    151153        private:
     154            HUDPickupSystem* pickupSystem;
    152155            static PickupManager* singletonPtr_s;
    153156            static const std::string guiName_s; //!< The name of the PickupInventory
Note: See TracChangeset for help on using the changeset viewer.