Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Michsky.MUIP
|
||||
if (overrideColors == false)
|
||||
{
|
||||
mainText.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, mainText.color.a);
|
||||
placeholderText.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, placeholderText.color.a);
|
||||
if (placeholderText != null) placeholderText.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, placeholderText.color.a);
|
||||
filledImage.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, filledImage.color.a);
|
||||
backgroundImage.color = new Color(UIManagerAsset.inputFieldColor.r, UIManagerAsset.inputFieldColor.g, UIManagerAsset.inputFieldColor.b, backgroundImage.color.a);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace Michsky.MUIP
|
||||
if (overrideFonts == false)
|
||||
{
|
||||
mainText.font = UIManagerAsset.inputFieldFont;
|
||||
placeholderText.font = UIManagerAsset.inputFieldFont;
|
||||
if (placeholderText != null) placeholderText.font = UIManagerAsset.inputFieldFont;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user