mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-05-22 02:35:26 +00:00
89 lines
2.8 KiB
C++
89 lines
2.8 KiB
C++
#include "StdAfx.h"
|
|
|
|
#include "UI.h"
|
|
#include "UIControl_LeftIconButtonList.h"
|
|
|
|
UIControl_LeftIconButtonList::UIControl_LeftIconButtonList()
|
|
{
|
|
//UIControl_ButtonList::UIControl_ButtonList(this); //?
|
|
}
|
|
|
|
bool UIControl_LeftIconButtonList::setupControl(UIScene* scene, IggyValuePath* parent, const std::string& controlName)
|
|
{
|
|
bool success = UIControl_Base::setupControl(scene, parent, controlName);
|
|
|
|
m_addNewItemFastName = UIControl::registerFastName(L"addNewItem");
|
|
m_setTextureNameFastName = UIControl::registerFastName(L"SetTextureName");
|
|
m_useIggyIconsFastName = UIControl::registerFastName(L"UseIggyIcons");
|
|
|
|
return success;
|
|
}
|
|
|
|
void UIControl_LeftIconButtonList::AddNewItem(int index, const std::wstring& label, const std::wstring& textureName)
|
|
{
|
|
IggyDataValue result;
|
|
|
|
IggyDataValue value[3];
|
|
value[0].type = IGGY_DATATYPE_number;
|
|
value[0].number = index;
|
|
|
|
IggyStringUTF16 stringVal;
|
|
stringVal.string = (IggyUTF16*)textureName.c_str();
|
|
stringVal.length = textureName.length();
|
|
value[1].type = IGGY_DATATYPE_string_UTF16;
|
|
value[1].string16 = stringVal;
|
|
|
|
IggyStringUTF16 stringVal2;
|
|
stringVal2.string = (IggyUTF16*)textureName.c_str();
|
|
stringVal2.length = textureName.length();
|
|
value[2].type = IGGY_DATATYPE_string_UTF16;
|
|
value[2].string16 = stringVal2;
|
|
|
|
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_addNewItemFastName, 3, value);
|
|
|
|
// UIControl_List::addElement(1, -1);
|
|
}
|
|
|
|
void UIControl_LeftIconButtonList::SetItem(int index, const std::wstring& label, const std::wstring& textureName)
|
|
{
|
|
// UIControl_List::SetItemLabel(index, &label, 1);
|
|
|
|
IggyDataValue result;
|
|
|
|
IggyDataValue value[3];
|
|
value[0].type = IGGY_DATATYPE_number;
|
|
value[0].number = index;
|
|
|
|
IggyStringUTF16 stringVal;
|
|
stringVal.string = (IggyUTF16*)textureName.c_str();
|
|
stringVal.length = textureName.length();
|
|
value[1].type = IGGY_DATATYPE_string_UTF16;
|
|
value[1].string16 = stringVal;
|
|
|
|
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_setTextureNameFastName, 2, value);
|
|
}
|
|
|
|
void UIControl_LeftIconButtonList::SetTextureName(int index, const std::wstring& textureName)
|
|
{
|
|
IggyDataValue result;
|
|
|
|
IggyDataValue value[2];
|
|
value[0].type = IGGY_DATATYPE_number;
|
|
value[0].number = index;
|
|
|
|
IggyStringUTF16 stringVal;
|
|
stringVal.string = (IggyUTF16*)textureName.c_str();
|
|
stringVal.length = textureName.length();
|
|
|
|
value[1].type = IGGY_DATATYPE_string_UTF16;
|
|
value[1].string16 = stringVal;
|
|
|
|
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_setTextureNameFastName, 2, value);
|
|
}
|
|
|
|
void UIControl_LeftIconButtonList::UseIggyIcons()
|
|
{
|
|
IggyDataValue result;
|
|
|
|
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_useIggyIconsFastName, 0, nullptr);
|
|
} |