osb/source/windowing/StarLargeCharPlateWidget.hpp
Kae f42031dc9e make text anchors in LargeCharPlate configurable
also gave the char previews some animation!
2024-05-23 11:43:15 +10:00

65 lines
1.3 KiB
C++

#pragma once
#include "StarWidget.hpp"
#include "StarButtonWidget.hpp"
#include "StarPortraitWidget.hpp"
#include "StarLabelWidget.hpp"
namespace Star {
STAR_CLASS(Player);
STAR_CLASS(LargeCharPlateWidget);
class LargeCharPlateWidget : public ButtonWidget {
public:
LargeCharPlateWidget(WidgetCallbackFunc mainCallback, PlayerPtr player = PlayerPtr());
void mouseOut() override;
void setPlayer(PlayerPtr player = PlayerPtr());
void enableDelete(WidgetCallbackFunc const& callback);
void disableDelete();
virtual bool sendEvent(InputEvent const& event) override;
void update(float dt) override;
protected:
virtual void renderImpl() override;
private:
PlayerPtr m_player;
Json m_config;
PortraitWidgetPtr m_portrait;
Vec2I m_portraitOffset;
float m_portraitScale;
String m_playerPlateHover;
String m_noPlayerPlate;
String m_noPlayerPlateHover;
String m_playerPlate;
LabelWidgetPtr m_playerName;
LabelWidgetPtr m_playerPhrase;
LabelWidgetPtr m_modeName;
LabelWidgetPtr m_mode;
ButtonWidgetPtr m_delete;
Vec2I m_playerNameOffset;
Vec2I m_playerPhraseOffset;
Vec2I m_modeNameOffset;
Vec2I m_modeOffset;
Vec2I m_deleteOffset;
String m_createCharText;
Color m_createCharTextColor;
Color m_regularTextColor;
Color m_disabledTextColor;
};
}