public override void DrawContents() { if (blackOutLevel > 0) { SmartUI.DrawFillRect(Frame, Color.black.Faded(blackOutLevel)); } base.DrawContents(); }
public override void DrawContents() { base.DrawContents(); Image.Width = (int)ContentsBounds.width; Image.Height = (int)ContentsBounds.height; Image.Update(); Image.Draw(); RectOffset border = new RectOffset(2, 2, 2, 2); if (!Enabled) { SmartUI.DrawFillRect(border.Remove(Frame), new Color(0.4f, 0.4f, 0.4f, 0.66f)); } }
// ---------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------- /** Draw an item type indicator on slots that are restricted by type */ public override void DrawContents() { // Sometimes the contents is changed but no update was called inbetween so we make sure the changes // are in sync now. if (_dirty) { Apply(); } if (DataLink != null) { if ((ItemRestriction != ItemLocation.Any) && DataLink.IsEmpty) { int iconID = MDRItem.GetSpriteForItemLocation(ItemRestriction); Sprite icon = (iconID >= 0) ? CoM.Instance.ItemIconSprites[iconID] : null; if (icon) { var dp = DrawParameters.BlackAndWhite; SmartUI.Color = new Color(0.35f, 0.35f, 0.35f, 0.75f); SmartUI.Draw(6, 6, icon, dp); SmartUI.Color = Color.white; } } // draw paired item if required. if (DataLink.PairedSlot != null) { if ((!DataLink.PairedSlot.IsEmpty) && (DataLink.PairedSlot.ItemInstance.Item.Hands == 2)) { var dp = DrawParameters.BlackAndWhite; SmartUI.DrawFillRect(new Rect(3, 3, Width - 6, Height - 6), new Color(0.1f, 0.1f, 0.1f, 0.9f)); SmartUI.Color = new Color(0.35f, 0.35f, 0.35f, 0.75f); SmartUI.Draw(6, 6, DataLink.PairedSlot.ItemInstance.Item.Icon, dp); SmartUI.Color = Color.white; } } } base.DrawContents(); }
/** Draws progress indicator */ protected void DrawProgress() { int drawHeight = (int)(ContentsBounds.height * Util.Clamp(Progress, 0f, 1f)); SmartUI.DrawFillRect(new Rect(0, (int)ContentsBounds.height - drawHeight, ContentsBounds.width, (float)ContentsBounds.height * Util.Clamp(Progress, 0f, 1f)), ProgressColor); }
/** Draws progress indicator */ protected void DrawProgress() { SmartUI.DrawFillRect(new Rect(0, 0, (float)ContentsBounds.width * Util.Clamp(Progress, 0f, 1f), ContentsBounds.height), ProgressColor); }
public override void Draw() { SmartUI.DrawFillRect(Bounds, Color); }