private static void DrawBottomSlots(Rect rect, Blueprint bp, BlueprintHandlerState state) { try { GUI.BeginGroup(rect); List <object> list = new List <object>() { 1, 2, 3 }; float slotWidth = rect.width / 3; Rect armourSlotRect = new Rect(slotWidth, rect.height - TotalSlotRectHeight, slotWidth, TotalSlotRectHeight); if (bp.HasArmourPlating) { List <PartCustomisePack> armour = bp.GetPartCustomisePacks(DroidCustomiseGroupDef.Named("MD3_DroidArmourPlating"), true); var pack = armour.First(); DrawSlot(pack, armourSlotRect, bp.ChassisType, state); foreach (var p in armour) { p.Part = pack.Part; } bp.Recache(); } Rect motivator1SlotRect = new Rect(0f, armourSlotRect.y, armourSlotRect.width, armourSlotRect.height); } finally { GUI.EndGroup(); } }
private static void DrawSkillsEntry(Rect entryRect, SkillLevel skill, Blueprint bp, bool alternate, BlueprintHandlerState state) { try { if (Mouse.IsOver(entryRect)) { Widgets.DrawHighlight(entryRect); } else if (alternate) { Widgets.DrawAltRect(entryRect); } GUI.BeginGroup(entryRect); if (state == BlueprintHandlerState.New || state == BlueprintHandlerState.Edit) { Rect sliderRect = new Rect(0f, 0f, entryRect.width, entryRect.height); int prevLevel = skill.Level; skill.Level = Mathf.RoundToInt(Widgets.HorizontalSlider(sliderRect, skill.Level, 0, 20, true, $"{skill.Skill.LabelCap} ({skill.Level})", "0", "20")); if (skill.Level != prevLevel) { bp.Recache(); bp.AddSkillsToDroid(StatDummy(bp)); StatsReportUtility.Reset(); } } else { Rect skillLabelRect = new Rect(0f, 0f, (entryRect.width / 2), entryRect.height); Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(skillLabelRect, skill.Skill.LabelCap); Rect skillLevelRect = new Rect(skillLabelRect.xMax, 0f, entryRect.width / 2 - 5f, entryRect.height); Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(skillLevelRect, skill.Level.ToString()); Text.Anchor = TextAnchor.UpperLeft; } } finally { GUI.EndGroup(); } }