2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#include "StarPane.hpp"
|
|
|
|
#include "StarLuaComponents.hpp"
|
|
|
|
#include "StarContainerInteractor.hpp"
|
|
|
|
#include "StarGuiReader.hpp"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_CLASS(ContainerEntity);
|
|
|
|
STAR_CLASS(Player);
|
|
|
|
STAR_CLASS(WorldClient);
|
|
|
|
STAR_CLASS(Item);
|
|
|
|
STAR_CLASS(ItemGridWidget);
|
|
|
|
STAR_CLASS(ItemBag);
|
|
|
|
STAR_CLASS(ContainerPane);
|
|
|
|
|
|
|
|
class ContainerPane : public Pane {
|
|
|
|
public:
|
|
|
|
ContainerPane(WorldClientPtr worldClient, PlayerPtr player, ContainerInteractorPtr containerInteractor);
|
|
|
|
|
|
|
|
void displayed() override;
|
|
|
|
void dismissed() override;
|
|
|
|
PanePtr createTooltip(Vec2I const& screenPosition) override;
|
|
|
|
|
|
|
|
bool giveContainerResult(ContainerResult result);
|
|
|
|
|
|
|
|
protected:
|
2023-07-20 14:58:49 +00:00
|
|
|
void update(float dt) override;
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
enum class ExpectingSwap {
|
|
|
|
None,
|
|
|
|
Inventory,
|
|
|
|
SwapSlot,
|
|
|
|
SwapSlotStack
|
|
|
|
};
|
|
|
|
|
|
|
|
void swapSlot(ItemGridWidget* grid);
|
|
|
|
void startCrafting();
|
|
|
|
void stopCrafting();
|
|
|
|
void toggleCrafting();
|
|
|
|
void clear();
|
|
|
|
void burn();
|
|
|
|
|
|
|
|
WorldClientPtr m_worldClient;
|
|
|
|
PlayerPtr m_player;
|
|
|
|
ContainerInteractorPtr m_containerInteractor;
|
|
|
|
ItemBagPtr m_itemBag;
|
|
|
|
|
|
|
|
ExpectingSwap m_expectingSwap;
|
|
|
|
|
|
|
|
GuiReader m_reader;
|
|
|
|
|
|
|
|
Maybe<LuaWorldComponent<LuaUpdatableComponent<LuaBaseComponent>>> m_script;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|