diff --git a/Minecraft.Client/Common/UI/UIControl_MultiList.cpp b/Minecraft.Client/Common/UI/UIControl_MultiList.cpp index 62004d78..102efa40 100644 --- a/Minecraft.Client/Common/UI/UIControl_MultiList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_MultiList.cpp @@ -169,10 +169,35 @@ void UIControl_MultiList::AddNewSlider(const wstring &label, int id, int minVal, IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcAddNewItem_Slider, 5, value); + m_sliderValues.emplace(id, initialVal); m_itemIds.push_back(id); ++m_itemCount; } +void UIControl_MultiList::handleSliderMove(int id, int newValue) { + auto it = m_sliderValues.find(id); + + if (it == m_sliderValues.end()) return; + + if (newValue != it->second) { + int valueCount = 1; + + if (g_KBMInput.IsKBMActive() && g_KBMInput.HasAnyInput()) { + if (newValue % 10 == 0) { + ui.PlayUISFX(eSFX_Scroll); + it->second = newValue; + } else if (valueCount <= 20) { + ui.PlayUISFX(eSFX_Scroll); + it->second = newValue; + } + } else { + ui.PlayUISFX(eSFX_Scroll); + it->second = newValue; + } + + } +} + void UIControl_MultiList::AddNewTextInput(const wstring &label, int id) { IggyDataValue result; @@ -324,6 +349,7 @@ void UIControl_MultiList::clearList() getIggyValuePath(), m_removeAllItemsFunc, 0, nullptr); m_itemIds.clear(); + m_sliderValues.clear(); m_itemCount = 0; m_iCurrentSelection = 0; } diff --git a/Minecraft.Client/Common/UI/UIControl_MultiList.h b/Minecraft.Client/Common/UI/UIControl_MultiList.h index 96408ee0..753b4f5e 100644 --- a/Minecraft.Client/Common/UI/UIControl_MultiList.h +++ b/Minecraft.Client/Common/UI/UIControl_MultiList.h @@ -32,6 +32,8 @@ protected: int m_itemCount; int m_iCurrentSelection; + std::unordered_map m_sliderValues; + public: UIControl_MultiList(); @@ -59,6 +61,8 @@ public: int getItemCount() const { return m_itemCount; } void SetTouchFocus(S32 iX, S32 iY, bool bRepeat); + void handleSliderMove(int id, int newValue); + private: int getListIndex(int id) const; }; diff --git a/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp index b0b7e055..5e12654c 100644 --- a/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HelpAndOptionsMenu.cpp @@ -193,12 +193,6 @@ void UIScene_HelpAndOptionsMenu::handleInput(int iPad, int key, bool repeat, boo #ifdef __ORBIS__ case ACTION_MENU_TOUCHPAD_PRESS: #endif - //CD - Added for audio - if(pressed) - { - ui.PlayUISFX(eSFX_Press); - } - case ACTION_MENU_UP: case ACTION_MENU_DOWN: sendInputToMovie(key, repeat, pressed, released); @@ -208,6 +202,8 @@ void UIScene_HelpAndOptionsMenu::handleInput(int iPad, int key, bool repeat, boo void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId) { + ui.PlayUISFX(eSFX_Press); + switch(static_cast(controlId)) { case BUTTON_HAO_CHANGESKIN: diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp index 6e19fdd2..322e8df9 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsAudioMenu.cpp @@ -157,7 +157,7 @@ void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue) int sliderIdInt = static_cast(sliderId); int value = static_cast(currentValue); - ui.PlayUISFX(eSFX_Scroll); + m_multiList.handleSliderMove(sliderIdInt, value); switch(sliderIdInt) { diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 8b559450..dcb1171d 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -232,7 +232,7 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal int sliderIdInt = static_cast(sliderId); int value = static_cast(currentValue); - ui.PlayUISFX(eSFX_Scroll); + m_multiList.handleSliderMove(sliderIdInt, value); switch (sliderIdInt) { diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp index 42f057a8..0bda3045 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsOptionsMenu.cpp @@ -211,7 +211,7 @@ void UIScene_SettingsOptionsMenu::handleSliderMove(F64 sliderId, F64 currentValu int sliderIdInt = static_cast(sliderId); int value = static_cast(currentValue); - ui.PlayUISFX(eSFX_Scroll); + m_multiList.handleSliderMove(sliderIdInt, value); switch(sliderIdInt) { diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp index 72346886..2edefa00 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp @@ -231,7 +231,7 @@ void UIScene_SettingsUIMenu::handleSliderMove(F64 sliderId, F64 currentValue) int sliderIdInt = static_cast(sliderId); int value = static_cast(currentValue); - ui.PlayUISFX(eSFX_Scroll); + m_multiList.handleSliderMove(sliderIdInt, value); switch(sliderIdInt) {