diff --git a/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp b/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp index 4f0e5ca0..c623c210 100644 --- a/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp @@ -31,6 +31,7 @@ void UIControl_ButtonList::init(int id) IggyDataValue result; IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; value[0].number = id; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 1 , value ); diff --git a/Minecraft.Client/Common/UI/UIControl_List.h b/Minecraft.Client/Common/UI/UIControl_List.h index 59523251..f6b72a96 100644 --- a/Minecraft.Client/Common/UI/UIControl_List.h +++ b/Minecraft.Client/Common/UI/UIControl_List.h @@ -17,19 +17,18 @@ public: UIControl_List(); ~UIControl_List(); - bool setupControl(UIScene* scene, IggyValuePath* parent, const std::string& controlName); + virtual bool setupControl(UIScene* scene, IggyValuePath* parent, const std::string& controlName); void init(int id); virtual void ReInit(); + virtual void tick(); + void clearList(); void removeItem(int index); - int getItemCount() - { - return m_itemCount; - } + int getItemCount(); void setCurrentSelection(int iSelection); int getCurrentSelection(); diff --git a/Minecraft.Client/Common/UI/UIControl_MultiList.cpp b/Minecraft.Client/Common/UI/UIControl_MultiList.cpp index 47b096dc..137307d0 100644 --- a/Minecraft.Client/Common/UI/UIControl_MultiList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_MultiList.cpp @@ -3,6 +3,7 @@ UIControl_MultiList::UIControl_MultiList() { + m_id = 0; m_min = 0; m_max = 100; m_current = 0; @@ -32,6 +33,7 @@ void UIControl_MultiList::AddNewLabel(UIString label) IggyDataValue result; IggyDataValue value[1]; + IggyStringUTF16 stringVal; stringVal.string = (IggyUTF16*)label.c_str(); stringVal.length = (S32)label.length(); @@ -47,6 +49,7 @@ void UIControl_MultiList::AddNewButton(UIString label, int id) { IggyDataValue result; IggyDataValue value[2]; + IggyStringUTF16 stringVal; stringVal.string = (IggyUTF16*)label.c_str(); stringVal.length = (S32)label.length(); @@ -65,6 +68,7 @@ void UIControl_MultiList::AddNewCheckbox(UIString label, int id, bool checked) { IggyDataValue result; IggyDataValue value[3]; + value[0].type = IGGY_DATATYPE_string_UTF16; IggyStringUTF16 stringVal; @@ -93,6 +97,7 @@ void UIControl_MultiList::AddNewSlider(UIString label, int id, int min, int max, IggyDataValue result; IggyDataValue value[5]; + value[0].type = IGGY_DATATYPE_string_UTF16; IggyStringUTF16 stringVal; @@ -101,16 +106,16 @@ void UIControl_MultiList::AddNewSlider(UIString label, int id, int min, int max, value[0].string16 = stringVal; value[1].type = IGGY_DATATYPE_number; - value[1].number = (int)id; + value[1].number = id; value[2].type = IGGY_DATATYPE_number; - value[2].number = (int)min; + value[2].number = min; value[3].type = IGGY_DATATYPE_number; - value[3].number = (int)max; + value[3].number = max; value[4].type = IGGY_DATATYPE_number; - value[4].number = (int)current; + value[4].number = current; auto out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcAddNewItemSlider, 5, value); @@ -124,6 +129,7 @@ void UIControl_MultiList::AddNewTextInput(UIString label, int id) IggyDataValue result; IggyDataValue value[2]; + value[0].type = IGGY_DATATYPE_string_UTF16; IggyStringUTF16 stringVal; @@ -180,6 +186,7 @@ bool UIControl_MultiList::GetCheckboxValue(int index) { IggyDataValue result; IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; value[0].number = UIControl_List::getListIndex(index); @@ -224,6 +231,7 @@ int UIControl_MultiList::GetSliderValue(int index) { IggyDataValue result; IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; value[0].number = UIControl_List::getListIndex(index); diff --git a/Minecraft.Client/Common/UI/UIControl_list.cpp b/Minecraft.Client/Common/UI/UIControl_list.cpp index a4e8e256..4dd09262 100644 --- a/Minecraft.Client/Common/UI/UIControl_list.cpp +++ b/Minecraft.Client/Common/UI/UIControl_list.cpp @@ -34,8 +34,8 @@ void UIControl_List::init(int id) m_id = id; IggyDataValue result; - IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; value[0].number = id; @@ -51,6 +51,11 @@ void UIControl_List::ReInit() m_iCurrentSelection = 0; } +void UIControl_List::tick() +{ + UIControl_Base::tick(); +} + void UIControl_List::clearList() { IggyDataValue result; @@ -63,8 +68,8 @@ void UIControl_List::clearList() void UIControl_List::removeItem(int index) { IggyDataValue result; - IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; value[0].number = index; @@ -73,11 +78,16 @@ void UIControl_List::removeItem(int index) --m_itemCount; } +int UIControl_List::getItemCount() +{ + return m_itemCount; +} + void UIControl_List::setCurrentSelection(int iSelection) { IggyDataValue result; - IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; value[0].number = iSelection; @@ -97,8 +107,8 @@ void UIControl_List::updateChildFocus(int iChild) void UIControl_List::SetTouchFocus(S32 iX, S32 iY, bool bRepeat) { IggyDataValue result; - IggyDataValue value[3]; + value[0].type = IGGY_DATATYPE_number; value[0].number = iX; value[1].type = IGGY_DATATYPE_number; @@ -112,8 +122,8 @@ void UIControl_List::SetTouchFocus(S32 iX, S32 iY, bool bRepeat) bool UIControl_List::CanTouchTrigger(S32 iX, S32 iY) { IggyDataValue result; - IggyDataValue value[2]; + value[0].type = IGGY_DATATYPE_number; value[0].number = iX; value[1].type = IGGY_DATATYPE_number;