Feat/gui enhancements (#54)

fix slider sounds
fix button sounds in settings page

---------

Co-authored-by: DrPerkyLegit <116128211+DrPerkyLegit@users.noreply.github.com>
Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/54
Co-authored-by: DrPerkyLegit <6+drperkylegit@noreply.neolegacy.dev>
Co-committed-by: DrPerkyLegit <6+drperkylegit@noreply.neolegacy.dev>
This commit is contained in:
DrPerkyLegit
2026-07-19 15:42:27 +01:00
committed by TheHuckle
co-authored by DrPerkyLegit
parent a248586ad9
commit 18136070c1
7 changed files with 36 additions and 10 deletions
@@ -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;
}
@@ -32,6 +32,8 @@ protected:
int m_itemCount;
int m_iCurrentSelection;
std::unordered_map<int, int> 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;
};
@@ -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<int>(controlId))
{
case BUTTON_HAO_CHANGESKIN:
@@ -157,7 +157,7 @@ void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue)
int sliderIdInt = static_cast<int>(sliderId);
int value = static_cast<int>(currentValue);
ui.PlayUISFX(eSFX_Scroll);
m_multiList.handleSliderMove(sliderIdInt, value);
switch(sliderIdInt)
{
@@ -232,7 +232,7 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal
int sliderIdInt = static_cast<int>(sliderId);
int value = static_cast<int>(currentValue);
ui.PlayUISFX(eSFX_Scroll);
m_multiList.handleSliderMove(sliderIdInt, value);
switch (sliderIdInt)
{
@@ -211,7 +211,7 @@ void UIScene_SettingsOptionsMenu::handleSliderMove(F64 sliderId, F64 currentValu
int sliderIdInt = static_cast<int>(sliderId);
int value = static_cast<int>(currentValue);
ui.PlayUISFX(eSFX_Scroll);
m_multiList.handleSliderMove(sliderIdInt, value);
switch(sliderIdInt)
{
@@ -231,7 +231,7 @@ void UIScene_SettingsUIMenu::handleSliderMove(F64 sliderId, F64 currentValue)
int sliderIdInt = static_cast<int>(sliderId);
int value = static_cast<int>(currentValue);
ui.PlayUISFX(eSFX_Scroll);
m_multiList.handleSliderMove(sliderIdInt, value);
switch(sliderIdInt)
{