public MapImageWidget(IContainer Parent) : base(Parent) { SetBackgroundColor(73, 89, 109); this.MapViewer = this.Parent.Parent.Parent as MapViewerBase; this.GridBackground = new GridBackground(this); this.GridBackground.SetVisible(Editor.GeneralSettings.ShowGrid); Sprites["dark"] = new Sprite(this.Viewport, new SolidBitmap(1, 1, new Color(0, 0, 0, 0))); Sprites["dark"].Z = 999999; SetTimer("frame", (long)Math.Round(1000 / 60d)); // 60 FPS }
public override void Update() { base.Update(); if (TimerPassed("timer")) { DestroyTimer("timer"); Queue.RemoveAt(0); if (Queue.Count > 0) { bool started = false; for (int i = 0; i < Queue.Count; i++) { if (Queue[i].Priority) // Show a priority message { SetTimer("timer", Queue[i].Time); DrawText(Queue[i].Text); started = true; break; } } if (!started) // No other priority messages queued { SetTimer("timer", Queue[0].Time); DrawText(Queue[0].Text); } } else // No other messages queued { RemoveText(); } } if (Editor.MainWindow.MapWidget != null || Editor.MainWindow.EventingWidget != null) { MapViewerBase MapViewer = Editor.MainWindow.MapWidget != null ? Editor.MainWindow.MapWidget.ActiveMapViewer : Editor.MainWindow.EventingWidget.MapViewer; if (!MapViewer.WidgetIM.Hovering || MapViewer is MapViewerConnections) { RemoveCursorText(); } else if (MapViewer.TopLeftX != DrawnX || MapViewer.TopLeftY != DrawnY || MapViewer.CursorWidth != DrawnWidth || MapViewer.CursorHeight != DrawnHeight || Sprites["cursor"].Bitmap == null) { DrawCursor(MapViewer.TopLeftX, MapViewer.TopLeftY, MapViewer.CursorWidth, MapViewer.CursorHeight); } } else { RemoveCursorText(); } }