Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2010, 10:44:10 PM (14 years ago)
Author:
dafrick
Message:

Loads of changes.
1) PickupInventory should now be working even for extreme cases.
2) Added support for inactive Spawnpoints in Gametype.
3) Made Pickupable rewardble. meaning from now on any Pickupable can be given as a reward for completing Quests.
4) Added some keybinds to KeybindMenu, such as PickupInventory, QuestGUI and Chat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/orxonox/interfaces/Pickupable.cc

    r6901 r6996  
    3434#include "Pickupable.h"
    3535
     36#include "core/LuaState.h"
     37#include "core/GUIManager.h"
    3638#include "core/Identifier.h"
    3739#include "core/CoreIncludes.h"
     40#include "util/Convert.h"
     41#include "infos/PlayerInfo.h"
    3842#include "pickup/PickupIdentifier.h"
     43#include "worldentities/pawns/Pawn.h"
    3944#include "PickupCarrier.h"
    4045
     
    9196        this->used_ = used;
    9297        this->changedUsed();
     98
     99        GUIManager::getInstance().getLuaState()->doString("PickupInventory.update()");
    93100        return true;
    94101    }
     
    196203        this->pickedUp_ = pickedUp;
    197204        this->changedPickedUp();
     205        GUIManager::getInstance().getLuaState()->doString("PickupInventory.update()");
    198206        return true;
    199207    }
     
    273281        SUPER(Pickupable, clone, item);
    274282    }
     283
     284    /**
     285    @brief
     286        Method to transcribe a Pickupable as a Rewardable to the player.
     287    @param player
     288        A pointer to the PlayerInfo, do whatever you want with it.
     289    @return
     290        Return true if successful.
     291    */
     292    bool Pickupable::reward(PlayerInfo* player)
     293    {
     294        ControllableEntity* entity = player->getControllableEntity();
     295        Pawn* pawn = static_cast<Pawn*>(entity);
     296        PickupCarrier* carrier = static_cast<PickupCarrier*>(pawn);
     297        return carrier->pickup(this);
     298    }
    275299   
    276300}
Note: See TracChangeset for help on using the changeset viewer.