public override void DoWindowContents(Rect inRect) { if (resizeDirtyFlag) { Resize(); } GUI.color = Color.white; Text.Font = GameFont.Medium; if (HeaderLabel != null) { Widgets.Label(HeaderRect, HeaderLabel); } Text.Font = GameFont.Small; GUI.BeginGroup(ContentRect); try { if (RowGroups != null) { table.Draw(RowGroups); } else { table.Draw(Pawns); } } finally { GUI.EndGroup(); GUI.color = Color.white; } GUI.BeginGroup(FooterRect); try { Rect buttonRect = SingleButtonRect; if (CancelButtonLabel != null) { if (Widgets.ButtonText(CancelButtonRect, CancelButtonLabel.Translate(), true, true, true)) { this.Close(true); } buttonRect = ConfirmButtonRect; } if (Widgets.ButtonText(buttonRect, ConfirmButtonLabel.Translate(), true, true, true)) { string validationMessage = ConfirmValidation(); if (validationMessage != null) { Messages.Message(validationMessage.Translate(), MessageTypeDefOf.RejectInput); } else { this.Confirm(); } } } finally { GUI.EndGroup(); } }
protected override void DrawPanelContent(State state) { base.DrawPanelContent(state); IEnumerable <EquipmentSelection> entries = PrepareCarefully.Instance.Equipment.Select((EquipmentSelection equipment) => { return(FindEntry(equipment)); }).Where((EquipmentSelection equipment) => { return(equipment != null); }); if (table.Selected == null) { table.Selected = entries.FirstOrDefault(); } table.Draw(entries); if (ScrollToEntry != null) { ScrollTo(ScrollToEntry); ScrollToEntry = null; } if (Widgets.ButtonText(RectRemoveButton, "EdB.PC.Panel.SelectedEquipment.Remove".Translate(), true, false, table.Selected != null)) { SoundDefOf.TickHigh.PlayOneShotOnCamera(); EquipmentRemoved(table.Selected); table.Selected = null; } }
protected override void DrawPanelContent(State state) { base.DrawPanelContent(state); IEnumerable <EquipmentSelection> entries = SelectedEquipment; if (table.Selected == null) { table.Selected = entries.FirstOrDefault(); } table.Draw(entries); if (ScrollToEntry != null) { ScrollTo(ScrollToEntry); ScrollToEntry = null; } if (Widgets.ButtonText(RectRemoveButton, "EdB.PC.Panel.SelectedEquipment.Remove".Translate(), true, false, table.Selected != null)) { SoundDefOf.Tick_High.PlayOneShotOnCamera(); EquipmentRemoved(table.Selected); table.Selected = null; } }
public override void DoWindowContents(Rect inRect) { if (resizeDirtyFlag) { Resize(); } EvaluateDisabledOptionsDirtyState(); GUI.color = Color.white; Text.Font = GameFont.Medium; if (HeaderLabel != null) { Rect headerRect = HeaderRect; if (cachedBlockedSelectionAlert != null) { Rect alertRect = new Rect(headerRect.xMin, headerRect.yMin + 5, 20, 20); GUI.DrawTexture(alertRect, Textures.TextureAlertSmall); TooltipHandler.TipRegion(alertRect, cachedBlockedSelectionAlert); headerRect = headerRect.InsetBy(26, 0, 0, 0); } Widgets.Label(headerRect, HeaderLabel); } Text.Font = GameFont.Small; GUI.BeginGroup(ContentRect); try { table.Draw(this.recipes); } finally { GUI.EndGroup(); GUI.color = Color.white; } GUI.BeginGroup(FooterRect); try { Rect buttonRect = SingleButtonRect; if (CancelButtonLabel != null) { if (Widgets.ButtonText(CancelButtonRect, CancelButtonLabel.Translate(), true, true, true)) { this.Close(true); } buttonRect = ConfirmButtonRect; } if (Widgets.ButtonText(buttonRect, ConfirmButtonLabel.Translate(), true, true, true)) { string validationMessage = ConfirmValidation(); if (validationMessage != null) { Messages.Message(validationMessage.Translate(), MessageTypeDefOf.RejectInput); } else { this.Confirm(); } } } finally { GUI.EndGroup(); } }