/// <summary> /// Gets the nice name for a KeyCode /// </summary> /// <remarks> /// <para>Prefers, in order: a name from the CFG_KEYNAMES string list, the defined name for the value, the KeyCode number as a string</para> /// </remarks> public static string GetNameForKeyCode(KeyCode key) { string keyNumberString = ((int)key).ToString(); if (Sub.Exists(keyNumberString, "CFG_KEYNAME")) { return(Sub.Replace(keyNumberString, "CFG_KEYNAME")); } return(Enum.GetName(typeof(KeyCode), key) ?? keyNumberString); }
public override void OnAllModulesLoaded() { if (AutosetWindowTitle) { try { SetWindowTitle((LookupWindowTitle && Sub.Exists("WindowTitle", "IGUI")) ? Sub.Replace("WindowTitle", "IGUI") : DefaultWindowTitle); } catch { } } }
public void OnSkillSelected(int i, Button b) { //Debug.Log(Enum.GetName(typeof(SkillType), i)); //set selected index, paint detail, enable buttons if valid var skillName = Enum.GetName(typeof(SkillType), i); SelectedSkill = i; DetailPanel.SetActive(true); DetailTitle.text = Sub.Replace(skillName, SubList); DetailDescription.text = Sub.Exists(skillName, DescriptionList) ? Sub.Replace(skillName, DescriptionList) : string.Empty; DetailLevel.text = string.Format("{0}->{1}", NewStats.Skills[(SkillType)i], NewStats.Skills[(SkillType)i] + RpgValues.SkillGainForPoints(1)); LevelUpButton.interactable = (PotentialPoints > 0); }