Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

linker error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.