Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/pickups2/src/orxonox/objects/pickup/PickupInventory.h @ 3008

Last change on this file since 3008 was 3001, checked in by danielh, 16 years ago
  • Added helper method to HumanController to get it's ControllableEntity as a Pawn
  • Removed tooltip, added default (empty) values for text and image from BaseItem
  • Fixed tolua in BaseItem.h
  • Added object to PickupCollection for the current UsableItem
  • Moved most inventory logic from Lua to PickupInventory (still slow)

TODO

  • Re-use of CEGUI item windows, destroying and creating them on each update is slow, very slow
File size: 3.2 KB
Line 
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 *      Daniel 'Huty' Haggenmueller
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file
31    @brief Declaration of static class for the inventory GUI window.
32*/
33
34#ifndef _PickupInventory_H__
35#define _PickupInventory_H__
36
37#include "OrxonoxPrereqs.h"
38
39#include "core/BaseObject.h"
40
41namespace CEGUI { class Window; class WindowManager; class Image; }
42
43// tolua_begin
44namespace orxonox
45{
46// tolua_end
47    class _OrxonoxExport BaseItem;
48
49    /**
50        @brief Static class for the inventory GUI window.
51        @author Daniel 'Huty' Haggenmueller
52    */ 
53// tolua_begin
54    class _OrxonoxExport PickupInventory
55    {
56// tolua_end
57    public:
58        //PickupInventory(BaseObject* creator);
59        //virtual ~PickupInventory();
60
61        /**
62            @brief Toggle visiblity of inventory.
63        */
64        static void toggleInventory(); // tolua_export
65
66        static void tabChanged(CEGUI::Window* tab); // tolua_export
67
68        static unsigned int getEquipmentCount(); // tolua_export
69        static unsigned int getUsableCount(); // tolua_export
70        static unsigned int getPassiveCount(); // tolua_export
71
72        static unsigned int getCurrentUsableIndex(); // tolua_export
73        static bool isCurrentUsable(const BaseItem* item); // tolua_export
74        static void selectUsable(unsigned int i); // tolua_export
75
76        static BaseItem* getEquipmentItem(unsigned int i); // tolua_export
77        static BaseItem* getUsableItem(unsigned int i); // tolua_export
78        static BaseItem* getPassiveItem(unsigned int i); // tolua_export
79
80        static std::string getImageForItem(const BaseItem* item); // tolua_export
81
82        static void clearInventory(CEGUI::WindowManager* winMgr, int equipCount, int usableCount); // tolua_export
83        static void updateTabs(CEGUI::WindowManager* winMgr, CEGUI::Window* equipWindow, CEGUI::Window* usableWindow); // tolua_export
84
85        static void updateEquipment(CEGUI::WindowManager* winMgr, CEGUI::Window* target);
86        static void updateUsable(CEGUI::WindowManager* winMgr, CEGUI::Window* target);
87
88        static void addItem(CEGUI::WindowManager* winMgr, CEGUI::Window* target, const std::string& id, BaseItem* item, const std::string& titleColour, int x, int y); // tolua_export
89    }; // tolua_export
90} // tolua_export
91
92#endif /* _PickupInventory_H__ */
Note: See TracBrowser for help on using the repository browser.