Signed-off-by: TRAfoer <lhf190@outlook.com>

This commit is contained in:
2026-02-13 23:04:26 +08:00
parent 96a2c60e16
commit 23f3caf876
29 changed files with 12268 additions and 5779 deletions

View File

@@ -166,7 +166,7 @@ namespace Michsky.MUIP
if (items[i].itemIcon == null) { setItemImage.gameObject.SetActive(false); }
else { imageHelper = items[i].itemIcon; setItemImage.sprite = imageHelper; }
items[i].itemIndex = i;
Item mainItem = items[i];
@@ -184,7 +184,7 @@ namespace Michsky.MUIP
if (selectedImage != null && !enableIcon) { selectedImage.gameObject.SetActive(false); }
else if (selectedImage != null) { selectedImage.sprite = items[selectedItemIndex].itemIcon; }
if (selectedText != null) { selectedText.text = items[selectedItemIndex].itemName; onItemTextChanged?.Invoke(selectedText); }
if (saveSelected)
{
if (invokeAtStart) { items[PlayerPrefs.GetInt("Dropdown_" + saveKey)].OnItemSelection.Invoke(); }
@@ -195,8 +195,8 @@ namespace Michsky.MUIP
// Obsolete
public void ChangeDropdownInfo(int itemIndex)
{
SetDropdownIndex(itemIndex);
{
SetDropdownIndex(itemIndex);
}
public void SetDropdownIndex(int itemIndex)
@@ -206,8 +206,8 @@ namespace Michsky.MUIP
public void SetDropdownIndex(int itemIndex, bool bypassSound = false)
{
if (selectedImage != null && enableIcon && items[itemIndex].itemIcon != null) { selectedImage.gameObject.SetActive(true); selectedImage.sprite = items[itemIndex].itemIcon; }
else if (selectedImage != null && enableIcon && items[itemIndex].itemIcon == null) { selectedImage.gameObject.SetActive(false); }
// if (selectedImage != null && enableIcon && items[itemIndex].itemIcon != null) { selectedImage.gameObject.SetActive(true); selectedImage.sprite = items[itemIndex].itemIcon; }
// else if (selectedImage != null && enableIcon && items[itemIndex].itemIcon == null) { selectedImage.gameObject.SetActive(false); }
if (selectedText != null) { selectedText.text = items[itemIndex].itemName; onItemTextChanged?.Invoke(selectedText); }
if (!bypassSound && enableDropdownSounds && useClickSound) { soundSource.PlayOneShot(clickSound); }
@@ -240,7 +240,7 @@ namespace Michsky.MUIP
}
else if (!isOn && animationType == AnimationType.Custom)
{
{
dropdownAnimator.Play("Stylish In");
isOn = true;
}
@@ -311,7 +311,7 @@ namespace Michsky.MUIP
{
if (!isInteractable) { return; }
if (enableDropdownSounds && useClickSound) { soundSource.PlayOneShot(clickSound); }
Animate();
}