public static float CalculateHeightOfStageModifier(IJobStageModifiers stage) { float finalHeight = 0f; /*if(stage.bodySizeModifier != 1.0f) * { * finalHeight += RowHeight; * } * if (stage.healthScaleModifier != 1.0f) * { * finalHeight += RowHeight; * }*/ finalHeight += RowHeight * stage.StatOffsets.Count(); finalHeight += RowHeight * stage.CapacityModifiers.Count(); finalHeight += RowHeight * stage.SkillMaxLevels.Count(); return(finalHeight); }
public static void FillStageModifier(Rect inRect, IJobStageModifiers stage, bool isSelected, Pawn pawn = null) { const float middle = 0.8f; bool alternateField = false; Rect rowRect = inRect; rowRect.height = RowHeight; /*if (stage.healthScaleModifier != 1.0f) * { * FillSimpleTableRow(ref alternateField, rowRect, "DivineJobs_Stage_HealthModifier".Translate(), stage.healthScaleModifier.ToStringPercent(), middle); * rowRect.y += RowHeight; * } * if (stage.bodySizeModifier != 1.0f) * { * FillSimpleTableRow(ref alternateField, rowRect, "DivineJobs_Stage_BodyModifier".Translate(), stage.bodySizeModifier.ToStringPercent(), middle); * rowRect.y += RowHeight; * }*/ if (stage.SkillMaxLevels.Count() > 0) { foreach (SkillRequirement skillMaxLevel in stage.SkillMaxLevels) { FillSimpleTableRow(ref alternateField, rowRect, "DivineJobs_Stage_MaxLevel".Translate(skillMaxLevel.skill.LabelCap), $"{skillMaxLevel.minLevel}", middle); rowRect.y += RowHeight; } } if (stage.StatOffsets.Count() > 0) { foreach (StatModifier statModifier in stage.StatOffsets) { FillSimpleTableRow(ref alternateField, rowRect, statModifier.stat.LabelCap, statModifier.ValueToStringAsOffset, middle); rowRect.y += RowHeight; } } if (stage.CapacityModifiers.Count() > 0) { foreach (PawnCapacityModifier capacityModifier in stage.CapacityModifiers) { FillSimpleTableRow(ref alternateField, rowRect, pawn == null ? capacityModifier.capacity.LabelCap : capacityModifier.capacity.GetLabelFor(pawn), capacityModifier.offset.ToStringPercent(), middle); rowRect.y += RowHeight; } } }