mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-09 20:27:13 +00:00
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "UIControl_Button.h"
|
|
|
|
class UIControl_EnchantmentButton : public UIControl_Button {
|
|
private:
|
|
// Maps to values in AS
|
|
enum EState {
|
|
eState_Inactive = 0,
|
|
eState_Active = 1,
|
|
eState_Selected = 2,
|
|
};
|
|
|
|
EState m_lastState;
|
|
int m_lastCost;
|
|
int m_index;
|
|
std::wstring m_enchantmentString;
|
|
bool m_bHasFocus;
|
|
|
|
IggyName m_funcChangeState;
|
|
|
|
unsigned int m_textColour, m_textFocusColour, m_textDisabledColour;
|
|
|
|
class EnchantmentNames {
|
|
public:
|
|
static EnchantmentNames instance;
|
|
|
|
private:
|
|
Random random;
|
|
std::vector<std::wstring> words;
|
|
|
|
EnchantmentNames();
|
|
|
|
public:
|
|
std::wstring getRandomName();
|
|
};
|
|
|
|
public:
|
|
UIControl_EnchantmentButton();
|
|
|
|
virtual bool setupControl(UIScene* scene, IggyValuePath* parent,
|
|
const std::string& controlName);
|
|
|
|
virtual void tick();
|
|
|
|
void init(int index);
|
|
virtual void ReInit();
|
|
void render(IggyCustomDrawCallbackRegion* region);
|
|
|
|
void updateState();
|
|
|
|
virtual void setFocus(bool focus);
|
|
}; |