diff options
Diffstat (limited to 'Thronefall_v1.0/Decompile/ChoiceUI.cs')
-rw-r--r-- | Thronefall_v1.0/Decompile/ChoiceUI.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Thronefall_v1.0/Decompile/ChoiceUI.cs b/Thronefall_v1.0/Decompile/ChoiceUI.cs new file mode 100644 index 0000000..62415e2 --- /dev/null +++ b/Thronefall_v1.0/Decompile/ChoiceUI.cs @@ -0,0 +1,48 @@ +using TMPro; +using UnityEngine; +using UnityEngine.UI; + +public class ChoiceUI : MonoBehaviour +{ + public Choice choice; + + public TMP_Text title; + + public TMP_Text description; + + public GameObject selected; + + public Image icon; + + public GameObject unlocked; + + public GameObject locked; + + private bool isunlocked; + + public bool IsUnlocked => isunlocked; + + public void SetChoice(Choice _choice) + { + if (!_choice.requiresUnlocked) + { + isunlocked = true; + } + else + { + isunlocked = PerkManager.instance.UnlockedEquippables.Contains(_choice.requiresUnlocked); + } + unlocked.SetActive(isunlocked); + locked.SetActive(!isunlocked); + choice = _choice; + title.text = _choice.name; + description.text = _choice.tooltip; + icon.sprite = _choice.icon; + SetHighlighted(_highlighted: false); + } + + public void SetHighlighted(bool _highlighted) + { + selected.SetActive(_highlighted); + } +} |