/// <summary>
        /// Tooltip
        /// </summary>
        /// <param name="texturePool"></param>
        /// <param name="farmFrameParent"></param>
        /// <param name="tooltip"></param>
        /// <param name="device"></param>
        /// <returns></returns>
        public static TooltipItem CreateTooltipFromProperty(TexturePool texturePool, WzSubProperty farmFrameParent, ToolTipInstance tooltip, GraphicsDevice device)
        {
            // Wz frames
            System.Drawing.Bitmap c     = ((WzCanvasProperty)farmFrameParent?["c"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap cover = ((WzCanvasProperty)farmFrameParent?["cover"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap e     = ((WzCanvasProperty)farmFrameParent?["e"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap n     = ((WzCanvasProperty)farmFrameParent?["n"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap s     = ((WzCanvasProperty)farmFrameParent?["s"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap w     = ((WzCanvasProperty)farmFrameParent?["w"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap ne    = ((WzCanvasProperty)farmFrameParent?["ne"])?.GetLinkedWzCanvasBitmap(); // top right
            System.Drawing.Bitmap nw    = ((WzCanvasProperty)farmFrameParent?["nw"])?.GetLinkedWzCanvasBitmap(); // top left
            System.Drawing.Bitmap se    = ((WzCanvasProperty)farmFrameParent?["se"])?.GetLinkedWzCanvasBitmap(); // bottom right
            System.Drawing.Bitmap sw    = ((WzCanvasProperty)farmFrameParent?["sw"])?.GetLinkedWzCanvasBitmap(); // bottom left


            // tooltip property
            string title = tooltip.Title;
            string desc  = tooltip.Desc;

            string renderText = string.Format("{0}{1}{2}", title, Environment.NewLine, desc);

            // Constants
            const string TOOLTIP_FONT     = "Arial";
            const float  TOOLTIP_FONTSIZE = 9.25f; // thankie willified, ya'll be remembered forever here <3

            //System.Drawing.Color color_bgFill = System.Drawing.Color.FromArgb(230, 17, 54, 82); // pre V patch (dark blue theme used post-bb), leave this here in case someone needs it
            System.Drawing.Color color_bgFill     = System.Drawing.Color.FromArgb(255, 17, 17, 17); // post V patch (dark black theme used), use color picker on paint via image extracted from WZ if you need to get it
            System.Drawing.Color color_foreGround = System.Drawing.Color.White;
            const int            WIDTH_PADDING    = 10;
            const int            HEIGHT_PADDING   = 6;

            // Create
            using (System.Drawing.Font font = new System.Drawing.Font(TOOLTIP_FONT, TOOLTIP_FONTSIZE))
            {
                System.Drawing.Graphics graphics_dummy = System.Drawing.Graphics.FromImage(new System.Drawing.Bitmap(1, 1)); // dummy image just to get the Graphics object for measuring string
                System.Drawing.SizeF    tooltipSize    = graphics_dummy.MeasureString(renderText, font);

                int effective_width  = (int)tooltipSize.Width + WIDTH_PADDING;
                int effective_height = (int)tooltipSize.Height + HEIGHT_PADDING;

                System.Drawing.Bitmap bmp_tooltip = new System.Drawing.Bitmap(effective_width, effective_height);
                using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bmp_tooltip))
                {
                    // Frames and background
                    UIFrameHelper.DrawUIFrame(graphics, color_bgFill, ne, nw, se, sw, e, w, n, s, c, effective_width, effective_height);

                    // Text
                    graphics.DrawString(renderText, font, new System.Drawing.SolidBrush(color_foreGround), WIDTH_PADDING / 2, HEIGHT_PADDING / 2);
                    graphics.Flush();
                }
                IDXObject   dxObj = new DXObject(tooltip.X, tooltip.Y, bmp_tooltip.ToTexture2D(device), 0);
                TooltipItem item  = new TooltipItem(tooltip, dxObj);

                return(item);
            }
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="minimapFrameProperty">UI.wz/UIWindow2.img/MiniMap</param>
        /// <param name="mapBoard"></param>
        /// <param name="device"></param>
        /// <param name="MapName">The map name. i.e The Hill North</param>
        /// <param name="StreetName">The street name. i.e Hidden street</param>
        /// <returns></returns>
        public static MinimapItem CreateMinimapFromProperty(WzSubProperty minimapFrameProperty, Board mapBoard, GraphicsDevice device, string MapName, string StreetName)
        {
            if (mapBoard.MiniMap == null)
            {
                return(null);
            }

            WzSubProperty maxMapProperty        = (WzSubProperty)minimapFrameProperty["MaxMap"];
            WzSubProperty miniMapProperty       = (WzSubProperty)minimapFrameProperty["MinMap"];
            WzSubProperty maxMapMirrorProperty  = (WzSubProperty)minimapFrameProperty["MaxMapMirror"]; // for Zero maps
            WzSubProperty miniMapMirrorProperty = (WzSubProperty)minimapFrameProperty["MinMapMirror"]; // for Zero maps

            WzSubProperty useFrame;

            if (mapBoard.MapInfo.zeroSideOnly || MapConstants.IsZerosTemple(mapBoard.MapInfo.id)) // zero's temple
            {
                useFrame = maxMapMirrorProperty;
            }
            else
            {
                useFrame = maxMapProperty;
            }

            // Wz frames
            System.Drawing.Bitmap c  = ((WzCanvasProperty)useFrame?["c"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap e  = ((WzCanvasProperty)useFrame?["e"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap n  = ((WzCanvasProperty)useFrame?["n"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap s  = ((WzCanvasProperty)useFrame?["s"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap w  = ((WzCanvasProperty)useFrame?["w"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap ne = ((WzCanvasProperty)useFrame?["ne"])?.GetLinkedWzCanvasBitmap(); // top right
            System.Drawing.Bitmap nw = ((WzCanvasProperty)useFrame?["nw"])?.GetLinkedWzCanvasBitmap(); // top left
            System.Drawing.Bitmap se = ((WzCanvasProperty)useFrame?["se"])?.GetLinkedWzCanvasBitmap(); // bottom right
            System.Drawing.Bitmap sw = ((WzCanvasProperty)useFrame?["sw"])?.GetLinkedWzCanvasBitmap(); // bottom left

            // Constants
            const float TOOLTIP_FONTSIZE = 10f;

            System.Drawing.Color color_bgFill     = System.Drawing.Color.Transparent;
            System.Drawing.Color color_foreGround = System.Drawing.Color.White;

            string renderText = string.Format("{0}{1}{2}", StreetName, Environment.NewLine, MapName);


            // Map background image
            System.Drawing.Bitmap miniMapImage = mapBoard.MiniMap; // the original minimap image without UI frame overlay
            int effective_width  = miniMapImage.Width + e.Width + w.Width;
            int effective_height = miniMapImage.Height + n.Height + s.Height;

            using (System.Drawing.Font font = new System.Drawing.Font(GLOBAL_FONT, TOOLTIP_FONTSIZE))
            {
                // Get the width of the 'streetName' or 'mapName'
                System.Drawing.Graphics graphics_dummy = System.Drawing.Graphics.FromImage(new System.Drawing.Bitmap(1, 1)); // dummy image just to get the Graphics object for measuring string
                System.Drawing.SizeF    tooltipSize    = graphics_dummy.MeasureString(renderText, font);

                effective_width = Math.Max((int)tooltipSize.Width + nw.Width, effective_width); // set new width

                System.Drawing.Bitmap miniMapUIImage = new System.Drawing.Bitmap(effective_width, effective_height);

                int mapDrawPositionX = (effective_width / 2) - nw.Width;  // map is on the center. The position relative to the UI

                using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(miniMapUIImage))
                {
                    // Frames and background
                    UIFrameHelper.DrawUIFrame(graphics, color_bgFill, ne, nw, se, sw, e, w, n, s, null, effective_width, effective_height);

                    graphics.DrawString(
                        renderText,
                        font, new System.Drawing.SolidBrush(color_foreGround), 50, 20);

                    // Map mark
                    if (Program.InfoManager.MapMarks.ContainsKey(mapBoard.MapInfo.mapMark))
                    {
                        System.Drawing.Bitmap mapMark = Program.InfoManager.MapMarks[mapBoard.MapInfo.mapMark];
                        graphics.DrawImage(mapMark.ToImage(), 7, 17);
                    }

                    // Map image
                    graphics.DrawImage(miniMapImage,
                                       mapDrawPositionX, // map is on the center
                                       n.Height);

                    graphics.Flush();
                }

                // Dots pixel
                System.Drawing.Bitmap bmp_DotPixel = new System.Drawing.Bitmap(2, 4);
                using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bmp_DotPixel))
                {
                    graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Yellow), new System.Drawing.RectangleF(0, 0, bmp_DotPixel.Width, bmp_DotPixel.Height));
                    graphics.Flush();
                }
                IDXObject          dxObj_miniMapPixel = new DXObject(0, n.Height, bmp_DotPixel.ToTexture2D(device), 0);
                BaseDXDrawableItem item_pixelDot      = new BaseDXDrawableItem(dxObj_miniMapPixel, false)
                {
                    Position = new Point(
                        mapDrawPositionX, // map is on the center
                        0)
                };

                // Map
                Texture2D texturer_miniMap = miniMapUIImage.ToTexture2D(device);

                IDXObject   dxObj = new DXObject(0, 0, texturer_miniMap, 0);
                MinimapItem item  = new MinimapItem(dxObj, item_pixelDot);

                return(item);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="minimapFrameProperty">UI.wz/UIWindow2.img/MiniMap</param>
        /// <param name="mapBoard"></param>
        /// <param name="device"></param>
        /// <param name="MapName">The map name. i.e The Hill North</param>
        /// <param name="StreetName">The street name. i.e Hidden street</param>
        /// <returns></returns>
        public static MinimapItem CreateMinimapFromProperty(WzSubProperty minimapFrameProperty, Board mapBoard, GraphicsDevice device, string MapName, string StreetName)
        {
            WzSubProperty maxMapProperty        = (WzSubProperty)minimapFrameProperty["MaxMap"];
            WzSubProperty miniMapProperty       = (WzSubProperty)minimapFrameProperty["MinMap"];
            WzSubProperty maxMapMirrorProperty  = (WzSubProperty)minimapFrameProperty["MaxMapMirror"]; // for Zero maps
            WzSubProperty miniMapMirrorProperty = (WzSubProperty)minimapFrameProperty["MinMapMirror"]; // for Zero maps

            WzSubProperty useFrame;

            if (mapBoard.MapInfo.zeroSideOnly || MapConstants.IsZerosTemple(mapBoard.MapInfo.id)) // zero's temple
            {
                useFrame = maxMapMirrorProperty;
            }
            else
            {
                useFrame = maxMapProperty;
            }

            // Wz frames
            System.Drawing.Bitmap c  = ((WzCanvasProperty)useFrame?["c"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap e  = ((WzCanvasProperty)useFrame?["e"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap n  = ((WzCanvasProperty)useFrame?["n"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap s  = ((WzCanvasProperty)useFrame?["s"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap w  = ((WzCanvasProperty)useFrame?["w"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap ne = ((WzCanvasProperty)useFrame?["ne"])?.GetLinkedWzCanvasBitmap(); // top right
            System.Drawing.Bitmap nw = ((WzCanvasProperty)useFrame?["nw"])?.GetLinkedWzCanvasBitmap(); // top left
            System.Drawing.Bitmap se = ((WzCanvasProperty)useFrame?["se"])?.GetLinkedWzCanvasBitmap(); // bottom right
            System.Drawing.Bitmap sw = ((WzCanvasProperty)useFrame?["sw"])?.GetLinkedWzCanvasBitmap(); // bottom left

            // Constants
            const string TOOLTIP_FONT     = "Arial";
            const float  TOOLTIP_FONTSIZE = 10f;

            System.Drawing.Color color_bgFill     = System.Drawing.Color.Transparent;
            System.Drawing.Color color_foreGround = System.Drawing.Color.White;

            // Dots pixel
            System.Drawing.Bitmap bmp_DotPixel = new System.Drawing.Bitmap(2, 4);
            using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bmp_DotPixel))
            {
                graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Yellow), new System.Drawing.RectangleF(0, 0, bmp_DotPixel.Width, bmp_DotPixel.Height));
                graphics.Flush();
            }
            IDXObject          dxObj_miniMapPixel = new DXObject(0, n.Height, bmp_DotPixel.ToTexture2D(device), 0);
            BaseDXDrawableItem item_pixelDot      = new BaseDXDrawableItem(dxObj_miniMapPixel, false);

            // Map background image
            System.Drawing.Bitmap miniMapImage = mapBoard.MiniMap; // the original minimap image without UI frame overlay
            int effective_width  = miniMapImage.Width + e.Width + w.Width;
            int effective_height = miniMapImage.Height + n.Height + s.Height;

            using (System.Drawing.Font font = new System.Drawing.Font(TOOLTIP_FONT, TOOLTIP_FONTSIZE))
            {
                System.Drawing.Bitmap miniMapUIImage = new System.Drawing.Bitmap(effective_width, effective_height);

                using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(miniMapUIImage))
                {
                    // Frames and background
                    UIFrameHelper.DrawUIFrame(graphics, color_bgFill, ne, nw, se, sw, e, w, n, s, null, effective_width, effective_height);

                    graphics.DrawString(
                        string.Format("{0}{1}{2}", StreetName, Environment.NewLine, MapName),
                        font, new System.Drawing.SolidBrush(color_foreGround), 50, 20);

                    // Map mark
                    if (Program.InfoManager.MapMarks.ContainsKey(mapBoard.MapInfo.mapMark))
                    {
                        System.Drawing.Bitmap mapMark = Program.InfoManager.MapMarks[mapBoard.MapInfo.mapMark];
                        graphics.DrawImage(mapMark.ToImage(), 7, 17);
                    }

                    // Map image
                    graphics.DrawImage(miniMapImage, 10, n.Height);

                    graphics.Flush();
                }
                Texture2D texturer_miniMap = miniMapUIImage.ToTexture2D(device);

                IDXObject   dxObj = new DXObject(0, 0, texturer_miniMap, 0);
                MinimapItem item  = new MinimapItem(dxObj, item_pixelDot);

                return(item);
            }
        }
Beispiel #4
0
        /// <summary>
        /// Draws the frame and the UI of the minimap.
        /// TODO: This whole thing needs to be dramatically simplified via further abstraction to keep it noob-proof :(
        /// </summary>
        /// <param name="minimapFrameProperty">UI.wz/UIWindow2.img/MiniMap</param>
        /// <param name="mapBoard"></param>
        /// <param name="device"></param>
        /// <param name="MapName">The map name. i.e The Hill North</param>
        /// <param name="StreetName">The street name. i.e Hidden street</param>
        /// <returns></returns>
        public static MinimapItem CreateMinimapFromProperty(WzSubProperty minimapFrameProperty, Board mapBoard, GraphicsDevice device, string MapName, string StreetName, WzDirectory SoundWZFile)
        {
            if (mapBoard.MiniMap == null)
            {
                return(null);
            }

            WzSubProperty maxMapProperty        = (WzSubProperty)minimapFrameProperty["MaxMap"];
            WzSubProperty miniMapProperty       = (WzSubProperty)minimapFrameProperty["MinMap"];
            WzSubProperty maxMapMirrorProperty  = (WzSubProperty)minimapFrameProperty["MaxMapMirror"]; // for Zero maps
            WzSubProperty miniMapMirrorProperty = (WzSubProperty)minimapFrameProperty["MinMapMirror"]; // for Zero maps

            WzSubProperty BtNpc = (WzSubProperty)minimapFrameProperty["BtNpc"];                        // npc button
            WzSubProperty BtMin = (WzSubProperty)minimapFrameProperty["BtMin"];                        // mininise button
            WzSubProperty BtMax = (WzSubProperty)minimapFrameProperty["BtMax"];                        // maximise button
            WzSubProperty BtBig = (WzSubProperty)minimapFrameProperty["BtBig"];                        // big button
            WzSubProperty BtMap = (WzSubProperty)minimapFrameProperty["BtMap"];                        // world button

            WzSubProperty useFrame;

            if (mapBoard.MapInfo.zeroSideOnly || MapConstants.IsZerosTemple(mapBoard.MapInfo.id)) // zero's temple
            {
                useFrame = maxMapMirrorProperty;
            }
            else
            {
                useFrame = maxMapProperty;
            }

            // Wz frames
            System.Drawing.Bitmap c  = ((WzCanvasProperty)useFrame?["c"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap e  = ((WzCanvasProperty)useFrame?["e"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap n  = ((WzCanvasProperty)useFrame?["n"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap s  = ((WzCanvasProperty)useFrame?["s"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap w  = ((WzCanvasProperty)useFrame?["w"])?.GetLinkedWzCanvasBitmap();
            System.Drawing.Bitmap ne = ((WzCanvasProperty)useFrame?["ne"])?.GetLinkedWzCanvasBitmap(); // top right
            System.Drawing.Bitmap nw = ((WzCanvasProperty)useFrame?["nw"])?.GetLinkedWzCanvasBitmap(); // top left
            System.Drawing.Bitmap se = ((WzCanvasProperty)useFrame?["se"])?.GetLinkedWzCanvasBitmap(); // bottom right
            System.Drawing.Bitmap sw = ((WzCanvasProperty)useFrame?["sw"])?.GetLinkedWzCanvasBitmap(); // bottom left

            // Constants
            const float TOOLTIP_FONTSIZE         = 10f;
            const int   MAPMARK_IMAGE_ALIGN_LEFT = 7; // the number of pixels from the left to draw the map mark image
            const int   MAP_IMAGE_PADDING        = 2; // the number of pixels from the left to draw the minimap image

            System.Drawing.Color color_bgFill     = System.Drawing.Color.Transparent;
            System.Drawing.Color color_foreGround = System.Drawing.Color.White;

            string renderText = string.Format("{0}{1}{2}", StreetName, Environment.NewLine, MapName);


            // Map background image
            System.Drawing.Bitmap miniMapImage = mapBoard.MiniMap; // the original minimap image without UI frame overlay
            int effective_width  = miniMapImage.Width + e.Width + w.Width;
            int effective_height = miniMapImage.Height + n.Height + s.Height;

            using (System.Drawing.Font font = new System.Drawing.Font(GLOBAL_FONT, TOOLTIP_FONTSIZE))
            {
                // Get the width of the 'streetName' or 'mapName'
                System.Drawing.Graphics graphics_dummy = System.Drawing.Graphics.FromImage(new System.Drawing.Bitmap(1, 1)); // dummy image just to get the Graphics object for measuring string
                System.Drawing.SizeF    tooltipSize    = graphics_dummy.MeasureString(renderText, font);

                effective_width = Math.Max((int)tooltipSize.Width + nw.Width, effective_width); // set new width

                int miniMapAlignXFromLeft = MAP_IMAGE_PADDING;
                if (effective_width > miniMapImage.Width) // if minimap is smaller in size than the (text + frame), minimap will be aligned to the center instead
                {
                    miniMapAlignXFromLeft = (effective_width - miniMapImage.Width) / 2 /* - miniMapAlignXFromLeft*/;
                }

                System.Drawing.Bitmap miniMapUIImage = new System.Drawing.Bitmap(effective_width, effective_height);
                using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(miniMapUIImage))
                {
                    // Frames and background
                    UIFrameHelper.DrawUIFrame(graphics, color_bgFill, ne, nw, se, sw, e, w, n, s, null, effective_width, effective_height);

                    // Map name + street name
                    graphics.DrawString(
                        renderText,
                        font, new System.Drawing.SolidBrush(color_foreGround), 50, 20);

                    // Map mark
                    if (Program.InfoManager.MapMarks.ContainsKey(mapBoard.MapInfo.mapMark))
                    {
                        System.Drawing.Bitmap mapMark = Program.InfoManager.MapMarks[mapBoard.MapInfo.mapMark];
                        graphics.DrawImage(mapMark.ToImage(), MAPMARK_IMAGE_ALIGN_LEFT, 17);
                    }

                    // Map image
                    graphics.DrawImage(miniMapImage,
                                       miniMapAlignXFromLeft, // map is on the center
                                       n.Height);

                    graphics.Flush();
                }

                // Dots pixel
                System.Drawing.Bitmap bmp_DotPixel = new System.Drawing.Bitmap(2, 4);
                using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bmp_DotPixel))
                {
                    graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Yellow), new System.Drawing.RectangleF(0, 0, bmp_DotPixel.Width, bmp_DotPixel.Height));
                    graphics.Flush();
                }
                IDXObject          dxObj_miniMapPixel = new DXObject(0, n.Height, bmp_DotPixel.ToTexture2D(device), 0);
                BaseDXDrawableItem item_pixelDot      = new BaseDXDrawableItem(dxObj_miniMapPixel, false)
                {
                    Position = new Point(
                        miniMapAlignXFromLeft, // map is on the center
                        0)
                };

                // Map
                Texture2D texturer_miniMap = miniMapUIImage.ToTexture2D(device);

                IDXObject   dxObj       = new DXObject(0, 0, texturer_miniMap, 0);
                MinimapItem minimapItem = new MinimapItem(dxObj, item_pixelDot);

                ////////////// Minimap buttons////////////////////
                // This must be in order.
                // >>> If aligning from the left to the right. Items at the left must be at the top of the code
                // >>> If aligning from the right to the left. Items at the right must be at the top of the code with its (x position - parent width).
                // TODO: probably a wrapper class in the future, such as HorizontalAlignment and VerticalAlignment, or Grid/ StackPanel
                WzBinaryProperty BtMouseClickSoundProperty = (WzBinaryProperty)SoundWZFile["UI.img"]?["BtMouseClick"];
                WzBinaryProperty BtMouseOverSoundProperty  = (WzBinaryProperty)SoundWZFile["UI.img"]?["BtMouseOver"];

                UIObject objUIBtMap = new UIObject(BtMap, BtMouseClickSoundProperty, BtMouseOverSoundProperty,
                                                   false,
                                                   new Point(MAP_IMAGE_PADDING, MAP_IMAGE_PADDING), device);
                objUIBtMap.X = effective_width - objUIBtMap.CanvasSnapshotWidth - 8; // render at the (width of minimap - obj width)

                UIObject objUIBtBig = new UIObject(BtBig, BtMouseClickSoundProperty, BtMouseOverSoundProperty,
                                                   false,
                                                   new Point(MAP_IMAGE_PADDING, MAP_IMAGE_PADDING), device);
                objUIBtBig.X = objUIBtMap.X - objUIBtBig.CanvasSnapshotWidth; // render at the (width of minimap - obj width)

                UIObject objUIBtMax = new UIObject(BtMax, BtMouseClickSoundProperty, BtMouseOverSoundProperty,
                                                   false,
                                                   new Point(MAP_IMAGE_PADDING, MAP_IMAGE_PADDING), device);
                objUIBtMax.X = objUIBtBig.X - objUIBtMax.CanvasSnapshotWidth; // render at the (width of minimap - obj width)

                UIObject objUIBtMin = new UIObject(BtMin, BtMouseClickSoundProperty, BtMouseOverSoundProperty,
                                                   false,
                                                   new Point(MAP_IMAGE_PADDING, MAP_IMAGE_PADDING), device);
                objUIBtMin.X = objUIBtMax.X - objUIBtMin.CanvasSnapshotWidth; // render at the (width of minimap - obj width)

                // BaseClickableUIObject objUINpc = new BaseClickableUIObject(BtNpc, false, new Point(objUIBtMap.CanvasSnapshotWidth + objUIBtBig.CanvasSnapshotWidth + objUIBtMax.CanvasSnapshotWidth + objUIBtMin.CanvasSnapshotWidth, MAP_IMAGE_PADDING), device);

                minimapItem.AddUIButtons(objUIBtMin);
                minimapItem.AddUIButtons(objUIBtMax);
                minimapItem.AddUIButtons(objUIBtBig);
                minimapItem.AddUIButtons(objUIBtMap);
                //////////////////////////////////////////////////

                return(minimapItem);
            }
        }