public static void DrawSkill(SkillRecord skill, Rect holdingRect, SkillDrawMode mode, string tooltipPrefix = "") { if (Mouse.IsOver(holdingRect)) { GUI.DrawTexture(holdingRect, TexUI.HighlightTex); } GUI.BeginGroup(holdingRect); Text.Anchor = TextAnchor.MiddleLeft; Rect rect = new Rect(6f, 0f, levelLabelWidth + 6f, holdingRect.height); Widgets.Label(rect, skill.def.skillLabel.CapitalizeFirst()); Rect position = new Rect(rect.xMax, 0f, 24f, 24f); if (!skill.TotallyDisabled) { if ((int)skill.passion > 0) { Texture2D image = ((skill.passion == Passion.Major) ? PassionMajorIcon : PassionMinorIcon); GUI.DrawTexture(position, image); } Rect rect2 = new Rect(position.xMax, 0f, holdingRect.width - position.xMax, holdingRect.height); float fillPercent = Mathf.Max(0.01f, (float)skill.Level / 20f); Widgets.FillableBar(rect2, fillPercent, SkillBarFillTex, null, doBorder: false); } Rect rect3 = new Rect(position.xMax + 4f, 0f, 999f, holdingRect.height); rect3.yMin += 3f; string label; if (skill.TotallyDisabled) { GUI.color = DisabledSkillColor; label = "-"; } else { label = skill.Level.ToStringCached(); } GenUI.SetLabelAlign(TextAnchor.MiddleLeft); Widgets.Label(rect3, label); GenUI.ResetLabelAlign(); GUI.color = Color.white; GUI.EndGroup(); if (Mouse.IsOver(holdingRect)) { string text = GetSkillDescription(skill); if (tooltipPrefix != "") { text = tooltipPrefix + "\n\n" + text; } TooltipHandler.TipRegion(holdingRect, new TipSignal(text, skill.def.GetHashCode() * 397945)); } }
DrawStyle getFillSytle(SkillDrawMode curr) { switch (curr) { case SkillDrawMode.Hs: return(colorScheme.Hs); case SkillDrawMode.Cs: return(colorScheme.Cs); case SkillDrawMode.Us: return(colorScheme.Us); default: return(colorScheme.Hs); } }
public static void DrawSkillsOf(Pawn p, Vector2 offset, SkillDrawMode mode) { Text.Font = GameFont.Small; List <SkillDef> allDefsListForReading = DefDatabase <SkillDef> .AllDefsListForReading; for (int i = 0; i < allDefsListForReading.Count; i++) { float x = Text.CalcSize(allDefsListForReading[i].skillLabel.CapitalizeFirst()).x; if (x > levelLabelWidth) { levelLabelWidth = x; } } for (int j = 0; j < skillDefsInListOrderCached.Count; j++) { SkillDef skillDef = skillDefsInListOrderCached[j]; float y = (float)j * 27f + offset.y; DrawSkill(p.skills.GetSkill(skillDef), new Vector2(offset.x, y), mode); } }
public static void DrawSkillsOf(Pawn p, Vector2 offset, SkillDrawMode mode) { Text.Font = GameFont.Small; List <SkillDef> allDefsListForReading = DefDatabase <SkillDef> .AllDefsListForReading; for (int i = 0; i < allDefsListForReading.Count; i++) { Vector2 vector = Text.CalcSize(allDefsListForReading[i].skillLabel.CapitalizeFirst()); float x = vector.x; if (x > SkillUI.levelLabelWidth) { SkillUI.levelLabelWidth = x; } } for (int j = 0; j < p.skills.skills.Count; j++) { float y = (float)((float)j * 27.0 + offset.y); SkillUI.DrawSkill(p.skills.skills[j], new Vector2(offset.x, y), mode, string.Empty); } }
public static void DrawSkill(SkillRecord skill, Vector2 topLeft, SkillDrawMode mode, string tooltipPrefix = "") { DrawSkill(skill, new Rect(topLeft.x, topLeft.y, 230f, 24f), mode); }
DrawStyle getFillSytle(SkillDrawMode curr) { switch (curr) { case SkillDrawMode.Hs: return colorScheme.Hs; case SkillDrawMode.Cs: return colorScheme.Cs; case SkillDrawMode.Us: return colorScheme.Us; default: return colorScheme.Hs; } }