/// <summary> /// Handles when a map is changed and sets the new map to daw on the <see cref="MiniMapForm"/>. /// </summary> /// <param name="map">The map the user is on.</param> public void MapChanged(Map map) { // Show the map name in the form Text = "Mini Map: " + map.Name; // Assign the new map as a new grh ScaledMapGrh.SetGrh(GrhInfo.GetData("MiniMap", map.ID.ToString())); // Resize the form to match the new scaled map grh this.ClientSize = ScaledMapGrh.Size; }
/// <summary> /// Draws the <see cref="Control"/>. /// </summary> /// <param name="spriteBatch">The <see cref="ISpriteBatch"/> to draw to.</param> protected override void DrawControl(ISpriteBatch sb) { base.DrawControl(sb); // If not visible, no point in drawing/updating anything if (!IsVisible) { return; } // Draw the scaled down version of the map ScaledMapGrh.Draw(sb, _topLeftPos); // Update the entities on the map UpdateMiniMap(); // Draw all the entities we just found foreach (var grh in _grhEntities) { grh.Item1.Draw(sb, _topLeftPos + grh.Item2); } }