OpenMiner/include/gui/PlayerInventoryWidget.hpp
exilief dc8d781393 Switching from SDL to SFML (#14)
* Add SFML support besides SDL. Choose with global macro USE_SDL / USE_SFML.

+ Small fixes to make it compile on MinGW (with Glad instead of GLEW -> option NO_GLEW)

* Add SFML support besides SDL (Part 3). Cleaned up some macros.

* Add SFML support besides SDL (Part 4). Small SFML fixes. Changed Spaces->Tabs

* Add SFML support besides SDL (Part 5). Cleaning up more macros + small fixes.

* Port to SFML. Removed all SDL code.

* Small changes

* Conversion functions to/from SFML types for Vector2/3 and Color.

* Removed unused SDL files

* Changes for SFML port

* Changes for SFML port

* Fixed line endings (probably?)
2018-12-26 18:36:46 +01:00

43 lines
1.1 KiB
C++

/*
* =====================================================================================
*
* Filename: PlayerInventoryWidget.hpp
*
* Description:
*
* Created: 27/06/2018 05:32:49
*
* Author: Quentin Bazin, <quent42340@gmail.com>
*
* =====================================================================================
*/
#ifndef PLAYERINVENTORYWIDGET_HPP_
#define PLAYERINVENTORYWIDGET_HPP_
#include "CraftingWidget.hpp"
class PlayerInventoryWidget : public Widget {
public:
PlayerInventoryWidget(Inventory &playerInventory, Widget *parent = nullptr);
void onEvent(const sf::Event &event) override;
void update() override;
private:
void draw(RenderTarget &target, RenderStates states) const override;
Image m_background;
Inventory m_craftingInventory{2, 2};
CraftingWidget m_craftingWidget{m_craftingInventory, this};
Inventory &m_playerInventory;
InventoryWidget m_playerInventoryWidget{this};
InventoryWidget m_hotbarInventoryWidget{this};
MouseItemWidget m_mouseItemWidget{this};
};
#endif // PLAYERINVENTORYWIDGET_HPP_