* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a4399472.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
110 lines
2.9 KiB
C++
110 lines
2.9 KiB
C++
#include "stdafx.h"
|
|
#include "UI.h"
|
|
#include "UIControl_CheckBox.h"
|
|
|
|
UIControl_CheckBox::UIControl_CheckBox()
|
|
{
|
|
}
|
|
|
|
bool UIControl_CheckBox::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName)
|
|
{
|
|
UIControl::setControlType(UIControl::eCheckBox);
|
|
bool success = UIControl_Base::setupControl(scene,parent,controlName);
|
|
|
|
//CheckBox specific initialisers
|
|
m_checkedProp = registerFastName(L"Checked");
|
|
m_funcEnable = registerFastName(L"EnableCheckBox");
|
|
m_funcSetCheckBox = registerFastName(L"SetCheckBox");
|
|
|
|
m_bEnabled = true;
|
|
|
|
return success;
|
|
}
|
|
|
|
void UIControl_CheckBox::init(UIString label, int id, bool checked)
|
|
{
|
|
m_label = label;
|
|
m_id = id;
|
|
m_bChecked = checked;
|
|
|
|
IggyDataValue result;
|
|
IggyDataValue value[3];
|
|
value[0].type = IGGY_DATATYPE_string_UTF16;
|
|
IggyStringUTF16 stringVal;
|
|
|
|
stringVal.string = (IggyUTF16*)label.c_str();
|
|
stringVal.length = label.length();
|
|
value[0].string16 = stringVal;
|
|
|
|
value[1].type = IGGY_DATATYPE_number;
|
|
value[1].number = (int)id;
|
|
|
|
value[2].type = IGGY_DATATYPE_boolean;
|
|
value[2].boolval = checked;
|
|
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 3 , value );
|
|
|
|
#ifdef __PSVITA__
|
|
// 4J-TomK - add checkbox to the vita touch box list
|
|
|
|
switch(m_parentScene->GetParentLayer()->m_iLayer)
|
|
{
|
|
case eUILayer_Fullscreen:
|
|
case eUILayer_Scene:
|
|
case eUILayer_HUD:
|
|
ui.TouchBoxAdd(this,m_parentScene);
|
|
break;
|
|
}
|
|
#endif
|
|
}
|
|
|
|
bool UIControl_CheckBox::IsChecked()
|
|
{
|
|
rrbool checked = false;
|
|
IggyResult result = IggyValueGetBooleanRS ( &m_iggyPath , m_checkedProp, NULL, &checked );
|
|
m_bChecked = checked;
|
|
return checked;
|
|
}
|
|
|
|
bool UIControl_CheckBox::IsEnabled()
|
|
{
|
|
return m_bEnabled;
|
|
}
|
|
|
|
void UIControl_CheckBox::SetEnable(bool enable)
|
|
{
|
|
m_bEnabled = enable;
|
|
|
|
IggyDataValue result;
|
|
IggyDataValue value[1];
|
|
value[0].type = IGGY_DATATYPE_boolean;
|
|
value[0].boolval = enable;
|
|
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcEnable , 1 , value );
|
|
}
|
|
|
|
// 4J HEG - this is only ever used when required, most of this should happen in the flash
|
|
void UIControl_CheckBox::setChecked(bool checked)
|
|
{
|
|
IggyDataValue result;
|
|
IggyDataValue value[1];
|
|
value[0].type = IGGY_DATATYPE_boolean;
|
|
value[0].boolval = checked;
|
|
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcSetCheckBox , 1 , value );
|
|
}
|
|
|
|
// 4J-TomK we need to trigger this one via function instead of key down event because of how it works
|
|
void UIControl_CheckBox::TouchSetCheckbox(bool checked)
|
|
{
|
|
IggyDataValue result;
|
|
IggyDataValue value[1];
|
|
value[0].type = IGGY_DATATYPE_boolean;
|
|
value[0].boolval = checked;
|
|
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcSetCheckBox , 1 , value );
|
|
}
|
|
|
|
void UIControl_CheckBox::ReInit()
|
|
{
|
|
UIControl_Base::ReInit();
|
|
|
|
init(m_label, m_id, m_bChecked);
|
|
}
|