Beispiel #1
0
 private void UpdateColumn(Gui.Widgets.WidgetListView ListView, List <TradeableItem> selectedResources)
 {
     for (var i = 0; i < SelectedResources.Count; ++i)
     {
         UpdateLineItemText(ListView.GetChild(i + 1), selectedResources[i]);
     }
 }
Beispiel #2
0
        public override void Render(DwarfTime gameTime)
        {
            var mouse = GuiRoot.MousePointer;

            GuiRoot.MousePointer      = null;
            GuiRoot.MouseOverlaySheet = null;

            GuiRoot.Draw();

            for (var i = 0; i < Items.Count; i++)
            {
                var item = Items[i];
                if (item.ScreenshotStatus == ChooserItem.ScreenshotStatusEnum.Unloaded)
                {
                    item.Screenshot       = (ScreenshotSource == null ? null : ScreenshotSource(item.Path));
                    item.ScreenshotStatus = (item.Screenshot == null ? ChooserItem.ScreenshotStatusEnum.NoneFound : ChooserItem.ScreenshotStatusEnum.Loaded);
                }

                if (item.ScreenshotStatus == ChooserItem.ScreenshotStatusEnum.Loaded)
                {
                    if (i < Grid.Children.Count - 1)
                    {
                        var widget = (Grid.GetChild(i + 1) as ChooserWidget);
                        var rect   = widget.ScreenshotWidget.Rect;
                        if (!widget.Hidden)
                        {
                            GuiRoot.DrawQuad(rect, item.Screenshot);
                        }
                    }
                }
            }

            GuiRoot.RedrawPopups(); // This hack sucks.
            GuiRoot.MousePointer = mouse;
            GuiRoot.DrawMouse();
            base.Render(gameTime);
        }