// Creates formatting tokens for skill popups TextFile.Token[] CreateSkillTokens(DFCareer.Skills skill) { List <TextFile.Token> tokens = new List <TextFile.Token>(); TextFile.Token skillNameToken = new TextFile.Token(); skillNameToken.text = DaggerfallUnity.Instance.TextProvider.GetSkillName(skill); skillNameToken.formatting = TextFile.Formatting.Text; TextFile.Token skillValueToken = new TextFile.Token(); skillValueToken.text = string.Format("{0}%", playerEntity.Skills.GetSkillValue(skill)); skillValueToken.formatting = TextFile.Formatting.Text; DFCareer.Stats primaryStat = DaggerfallSkills.GetPrimaryStat(skill); TextFile.Token skillPrimaryStatToken = new TextFile.Token(); skillPrimaryStatToken.text = DaggerfallUnity.Instance.TextProvider.GetAbbreviatedStatName(primaryStat); skillPrimaryStatToken.formatting = TextFile.Formatting.Text; TextFile.Token spacesToken = new TextFile.Token(); spacesToken.formatting = TextFile.Formatting.Text; spacesToken.text = " "; TextFile.Token tabToken = new TextFile.Token(); tabToken.formatting = TextFile.Formatting.PositionPrefix; // Add tokens in order tokens.Add(skillNameToken); tokens.Add(tabToken); tokens.Add(tabToken); tokens.Add(skillValueToken); tokens.Add(spacesToken); tokens.Add(skillPrimaryStatToken); return(tokens.ToArray()); }
// Creates formatting tokens for skill popups TextFile.Token[] CreateSkillTokens(DFCareer.Skills skill, bool twoColumn = false, int startPosition = 0) { bool highlight = playerEntity.GetSkillRecentlyIncreased(skill); List <TextFile.Token> tokens = new List <TextFile.Token>(); TextFile.Formatting formatting = highlight ? TextFile.Formatting.TextHighlight : TextFile.Formatting.Text; TextFile.Token skillNameToken = new TextFile.Token(); skillNameToken.formatting = formatting; skillNameToken.text = DaggerfallUnity.Instance.TextProvider.GetSkillName(skill); TextFile.Token skillValueToken = new TextFile.Token(); skillValueToken.formatting = formatting; skillValueToken.text = string.Format("{0}%", playerEntity.Skills.GetLiveSkillValue(skill)); DFCareer.Stats primaryStat = DaggerfallSkills.GetPrimaryStat(skill); TextFile.Token skillPrimaryStatToken = new TextFile.Token(); skillPrimaryStatToken.formatting = formatting; skillPrimaryStatToken.text = DaggerfallUnity.Instance.TextProvider.GetAbbreviatedStatName(primaryStat); TextFile.Token positioningToken = new TextFile.Token(); positioningToken.formatting = TextFile.Formatting.PositionPrefix; TextFile.Token tabToken = new TextFile.Token(); tabToken.formatting = TextFile.Formatting.PositionPrefix; // Add tokens in order if (!twoColumn) { tokens.Add(skillNameToken); tokens.Add(tabToken); tokens.Add(tabToken); tokens.Add(tabToken); tokens.Add(skillValueToken); tokens.Add(tabToken); tokens.Add(skillPrimaryStatToken); } else // miscellaneous skills { if (startPosition != 0) // if this is the second column { positioningToken.x = startPosition; tokens.Add(positioningToken); } tokens.Add(skillNameToken); positioningToken.x = startPosition + 85; tokens.Add(positioningToken); tokens.Add(skillValueToken); positioningToken.x = startPosition + 112; tokens.Add(positioningToken); tokens.Add(skillPrimaryStatToken); } return(tokens.ToArray()); }
public TextFile.Token[] GetSkillSummary(DFCareer.Skills skill, int startPosition) { PlayerEntity playerEntity = GameManager.Instance.PlayerEntity; bool highlight = playerEntity.GetSkillRecentlyIncreased(skill); List <TextFile.Token> tokens = new List <TextFile.Token>(); TextFile.Formatting formatting = highlight ? TextFile.Formatting.TextHighlight : TextFile.Formatting.Text; TextFile.Token skillNameToken = new TextFile.Token(); skillNameToken.formatting = formatting; skillNameToken.text = DaggerfallUnity.Instance.TextProvider.GetSkillName(skill); TextFile.Token skillValueToken = new TextFile.Token(); skillValueToken.formatting = formatting; skillValueToken.text = string.Format("{0}%", playerEntity.Skills.GetLiveSkillValue(skill)); DFCareer.Stats primaryStat = DaggerfallSkills.GetPrimaryStat(skill); TextFile.Token skillPrimaryStatToken = new TextFile.Token(); skillPrimaryStatToken.formatting = formatting; skillPrimaryStatToken.text = DaggerfallUnity.Instance.TextProvider.GetAbbreviatedStatName(primaryStat); TextFile.Token positioningToken = new TextFile.Token(); positioningToken.formatting = TextFile.Formatting.PositionPrefix; TextFile.Token tabToken = new TextFile.Token(); tabToken.formatting = TextFile.Formatting.PositionPrefix; if (startPosition != 0) // if this is the second column { positioningToken.x = startPosition; tokens.Add(positioningToken); } tokens.Add(skillNameToken); positioningToken.x = startPosition + 85; tokens.Add(positioningToken); tokens.Add(skillValueToken); positioningToken.x = startPosition + 112; tokens.Add(positioningToken); tokens.Add(skillPrimaryStatToken); return(tokens.ToArray()); }