the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "UI.h"
3#include "UIControl_Button.h"
4
5UIControl_Button::UIControl_Button()
6{
7}
8
9bool UIControl_Button::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName)
10{
11 UIControl::setControlType(UIControl::eButton);
12 bool success = UIControl_Base::setupControl(scene,parent,controlName);
13
14 //Button specific initialisers
15 m_funcEnableButton = registerFastName(L"EnableButton");
16
17 return success;
18}
19
20void UIControl_Button::init(UIString label, int id)
21{
22 m_label = label;
23 m_id = id;
24
25 IggyDataValue result;
26 IggyDataValue value[2];
27 value[0].type = IGGY_DATATYPE_string_UTF16;
28 IggyStringUTF16 stringVal;
29
30 stringVal.string = (IggyUTF16*)label.c_str();
31 stringVal.length = label.length();
32 value[0].string16 = stringVal;
33
34 value[1].type = IGGY_DATATYPE_number;
35 value[1].number = id;
36 IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value );
37
38#ifdef __PSVITA__
39 // 4J-PB - add this button to the vita touch box list
40
41 switch(m_parentScene->GetParentLayer()->m_iLayer)
42 {
43 case eUILayer_Error:
44 case eUILayer_Fullscreen:
45 case eUILayer_Scene:
46 case eUILayer_HUD:
47 ui.TouchBoxAdd(this,m_parentScene);
48 break;
49 }
50#endif
51}
52
53void UIControl_Button::ReInit()
54{
55 UIControl_Base::ReInit();
56
57 init(m_label, m_id);
58}
59
60void UIControl_Button::setEnable(bool enable)
61{
62 IggyDataValue result;
63 IggyDataValue value[1];
64
65 value[0].type = IGGY_DATATYPE_boolean;
66 value[0].boolval = enable;
67 IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcEnableButton , 1 , value );
68}