the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 55 lines 940 B view raw
1#pragma once 2 3#include "UIControl_Button.h" 4 5class UIControl_EnchantmentButton : public UIControl_Button 6{ 7private: 8 // Maps to values in AS 9 enum EState 10 { 11 eState_Inactive = 0, 12 eState_Active = 1, 13 eState_Selected = 2, 14 }; 15 16 EState m_lastState; 17 int m_lastCost; 18 int m_index; 19 wstring m_enchantmentString; 20 bool m_bHasFocus; 21 22 IggyName m_funcChangeState; 23 24 unsigned int m_textColour, m_textFocusColour, m_textDisabledColour; 25 26 class EnchantmentNames 27 { 28 public: 29 static EnchantmentNames instance; 30 31 private: 32 Random random; 33 vector<wstring> words; 34 35 EnchantmentNames(); 36 37 public: 38 wstring getRandomName(); 39 }; 40 41public: 42 UIControl_EnchantmentButton(); 43 44 virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName); 45 46 virtual void tick(); 47 48 void init(int index); 49 virtual void ReInit(); 50 void render(IggyCustomDrawCallbackRegion *region); 51 52 void updateState(); 53 54 virtual void setFocus(bool focus); 55};