Пример #1
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            if (!Settings.ShowText)
            {
                return;
            }
            Rect rect          = model.Window.ClientRect();
            int  xScreenCenter = rect.W / 2 + rect.X;
            int  yPos          = rect.H / 5 + rect.Y;

            var  playerPos      = model.Player.GetComponent <Positioned>().GridPos;
            int  fontSize       = Settings.TextFontSize;
            bool first          = true;
            Rect rectBackground = new Rect();

            foreach (var alert in alertTexts)
            {
                if (!alert.Key.IsAlive)
                {
                    continue;
                }

                Vec2   delta = alert.Key.GetComponent <Positioned>().GridPos - playerPos;
                double phi;
                var    distance = delta.GetPolarCoordinates(out phi);
                RectUV uv       = GetDirectionsUv(phi, distance);

                Vec2 textSize = rc.AddTextWithHeight(new Vec2(xScreenCenter, yPos), alert.Value, Color.Red, fontSize, DrawTextFormat.Center);

                rectBackground    = new Rect(xScreenCenter - textSize.X / 2 - 6, yPos, textSize.X + 12, textSize.Y);
                rectBackground.X -= textSize.Y + 3;
                rectBackground.W += textSize.Y;

                Rect rectDirection = new Rect(rectBackground.X + 3, rectBackground.Y, rectBackground.H, rectBackground.H);

                if (first)                 // vertical padding above
                {
                    rectBackground.Y -= 5;
                    rectBackground.H += 5;
                    first             = false;
                }
                rc.AddBox(rectBackground, Color.FromArgb(Settings.TextBgAlpha, 1, 1, 1));
                rc.AddSprite("directions.png", rectDirection, uv, Color.Red);
                yPos += textSize.Y;
            }
            if (!first)              // vertical padding below
            {
                rectBackground.Y = rectBackground.Y + rectBackground.H;
                rectBackground.H = 5;
                rc.AddBox(rectBackground, Color.FromArgb(Settings.TextBgAlpha, 1, 1, 1));
            }
        }
Пример #2
0
 private void DrawEntityHealthbar(Color color, Color outline, Rect bg, float hpWidth, float esWidth, RenderingContext rc)
 {
     if (outline.ToArgb() != 0)
     {
         Rect rect = new Rect(bg.X - 2, bg.Y - 2, bg.W + 4, bg.H + 4);
         rc.AddBox(rect, outline);
     }
     if (Settings.GetBool("Healthbars.ShowIncrements"))
     {
         rc.AddTexture("healthbar_increment.png", bg, color);
     }
     else
     {
         rc.AddTexture("healthbar.png", bg, color);
     }
     if ((int)hpWidth < bg.W)
     {
         Rect rect2 = new Rect(bg.X + (int)hpWidth, bg.Y, bg.W - (int)hpWidth, bg.H);
         rc.AddTexture("healthbar_bg.png", rect2, color);
     }
     if (Settings.GetBool("Healthbars.ShowES"))
     {
         bg.W = (int)esWidth;
         rc.AddTexture("esbar.png", bg, Color.White);
     }
 }
Пример #3
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            if (!hasStarted)
            {
                watch = new Stopwatch();
                watch.Start();
                hasStarted = true;
                return;
            }


            Vec2  mapWithOffset = mountPoints[UiMountPoint.LeftOfMinimap];
            float ms            = watch.ElapsedMilliseconds;

            watch.Restart();

            var textSize = rc.AddTextWithHeight(mapWithOffset, ms + " ms/frame", Color.White, Settings.DpsFontSize, DrawTextFormat.Right);


            int  width = textSize.X;
            Rect rect  = new Rect(mapWithOffset.X - 5 - width, mapWithOffset.Y - 5, width + 10, textSize.Y + 10);

            rc.AddBox(rect, Color.FromArgb(160, Color.Black));

            mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(mapWithOffset.X, mapWithOffset.Y + 5 + rect.H);
        }
Пример #4
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            Vec2 pos = mountPoints[UiMountPoint.LeftOfMinimap];

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("Player = {0:X8}\r\n", model.Player.Address);
            sb.AppendFormat("TheGame = {0:X8}\r\n", model.Internal.Address);
            sb.AppendFormat("IngameState = {0:X8}\r\n", model.Internal.IngameState.Address);
            sb.AppendFormat("IngameData = {0:X8}\r\n", model.Internal.IngameState.Data.Address);
            sb.AppendFormat("InventoryFrame = {0:X8}\r\n", model.Internal.IngameState.IngameUi.InventoryPanel.Address);

            var w1 = model.Internal.IngameState.IngameUi.InventoryPanel.MainWeaponSlot.GetItemAt();

            //var flasks = model.Internal.IngameState.IngameUi.InventoryPanel.FlasksFrame;
            //for (int i = 0; i < 5; i++)
            //{
            //	var f1 = flasks.GetItemAt(i);
            //	if (f1 != null)
            //		sb.AppendFormat("F{1} = {0}\r\n",String.Join("; ", f1.EnumComponents().Select(kv => String.Format("{0}: {1:X8}", kv.Key, kv.Value))), i + 1);
            //}

            var  szText = rc.AddTextWithHeight(pos, sb.ToString(), Color.White, 11, DrawTextFormat.Right);
            Rect box    = new Rect(pos.X - szText.X - 5, pos.Y - 5, szText.X + 10, szText.Y + 10);

            rc.AddBox(box, Color.FromArgb(160, 0, 0, 0));

            mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(pos.X, pos.Y + szText.Y + 10 + 5);
        }
Пример #5
0
        private static Vec2 drawItem(RenderingContext rc, AlertDrawStyle drawStyle, int x, int y, Vec2 vPadding, string text,
                                     int fontSize)
        {
            // collapse padding when there's a frame
            vPadding.X -= drawStyle.FrameWidth;
            vPadding.Y -= drawStyle.FrameWidth;
            // item will appear to have equal size

            Vec2 textPos   = new Vec2(x - vPadding.X, y + vPadding.Y);
            Vec2 vTextSize = rc.AddTextWithHeight(textPos, text, drawStyle.color, fontSize, DrawTextFormat.Right);

            int iconSize = drawStyle.IconIndex >= 0 ? vTextSize.Y : 0;

            int fullHeight = vTextSize.Y + 2 * vPadding.Y + 2 * drawStyle.FrameWidth;
            int fullWidth  = vTextSize.X + 2 * vPadding.X + iconSize + 2 * drawStyle.FrameWidth;

            rc.AddBox(new Rect(x - fullWidth, y, fullWidth, fullHeight), Color.FromArgb(180, 0, 0, 0));

            if (iconSize > 0)
            {
                const float iconsInSprite = 4;

                Rect   iconPos = new Rect(textPos.X - iconSize - vTextSize.X, textPos.Y, iconSize, iconSize);
                RectUV uv      = new RectUV(drawStyle.IconIndex / iconsInSprite, 0, (drawStyle.IconIndex + 1) / iconsInSprite, 1);
                rc.AddSprite("item_icons.png", iconPos, uv);
            }
            if (drawStyle.FrameWidth > 0)
            {
                Rect frame = new Rect(x - fullWidth, y, fullWidth, fullHeight);
                rc.AddFrame(frame, drawStyle.color, drawStyle.FrameWidth);
            }
            return(new Vec2(fullWidth, fullHeight));
        }
Пример #6
0
        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            Vec2 pos = mountPoints[UiMountPoint.LeftOfMinimap];

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Player = {0:X8}\r\n", model.Player.Address);
            sb.AppendFormat("TheGame = {0:X8}\r\n", model.Internal.Address);
            sb.AppendFormat("IngameState = {0:X8}\r\n", model.Internal.IngameState.Address);
            sb.AppendFormat("IngameData = {0:X8}\r\n", model.Internal.IngameState.Data.Address);
            sb.AppendFormat("InventoryFrame = {0:X8}\r\n", model.Internal.IngameState.IngameUi.InventoryPanel.Address);

            var w1 = model.Internal.IngameState.IngameUi.InventoryPanel.MainWeaponSlot.GetItemAt();

            //var flasks = model.Internal.IngameState.IngameUi.InventoryPanel.FlasksFrame;
            //for (int i = 0; i < 5; i++)
            //{
            //	var f1 = flasks.GetItemAt(i);
            //	if (f1 != null)
            //		sb.AppendFormat("F{1} = {0}\r\n",String.Join("; ", f1.EnumComponents().Select(kv => String.Format("{0}: {1:X8}", kv.Key, kv.Value))), i + 1);
            //}

            var szText = rc.AddTextWithHeight(pos, sb.ToString(), Color.White, 11, DrawTextFormat.Right);
            Rect box = new Rect(pos.X - szText.X - 5, pos.Y - 5, szText.X + 10, szText.Y + 10);
            rc.AddBox(box, Color.FromArgb(160, 0, 0, 0));

            mountPoints[UiMountPoint.LeftOfMinimap]  = new Vec2(pos.X, pos.Y + szText.Y + 10 + 5);
        }
Пример #7
0
        private void RenderRolls(RenderingContext rc, Rect clientRect)
        {
            int yPosTooltil = clientRect.Y + clientRect.H + 5;
            int i           = yPosTooltil + 4;

            // Implicit mods
            if (Settings.ShowImplicitMod)
            {
                foreach (RollValue mod in this._implicitMods)
                {
                    i  = drawStatLine(rc, mod, clientRect, i, true);
                    i += 6;
                }
            }

            if (Settings.ShowItemMods)
            {
                foreach (RollValue item in this._explicitMods)
                {
                    i  = drawStatLine(rc, item, clientRect, i);
                    i += 4;
                }
            }

            if (i > yPosTooltil + 4)
            {
                Rect helpRect = new Rect(clientRect.X + 1, yPosTooltil, clientRect.W, i - yPosTooltil);
                rc.AddBox(helpRect, Color.FromArgb(220, Color.Black));
            }
        }
Пример #8
0
        public override void Render(RenderingContext rc)
        {
            if (!this.isVisible)
            {
                return;
            }
            Color gray = Color.Gray;

            rc.AddTextWithHeight(new Vec2(base.Bounds.X + base.Bounds.W / 2, base.Bounds.Y + base.Bounds.H / 3), this.text + ": " + this.value, Color.White, 11, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
            rc.AddBox(base.Bounds, Color.Black);
            rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), gray);
            rc.AddBox(new Rect(base.Bounds.X + 5, base.Bounds.Y + 3 * base.Bounds.H / 4, base.Bounds.W - 10, 5), Color.Black);
            float num  = (float)(this.value - this.min) / (float)(this.max - this.min);
            int   num2 = (int)((float)(base.Bounds.W - 10) * num);

            rc.AddBox(new Rect(base.Bounds.X + 5 + num2 - 2, base.Bounds.Y + 3 * base.Bounds.H / 4 - 4, 4, 8), Color.White);
        }
Пример #9
0
 public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
 {
     int alpha = this.menuVisible ? 255 : 100;
     rc.AddBox(this.bounds, Color.FromArgb(alpha, Color.Gray));
     rc.AddTextWithHeight(new Vec2(Settings.PositionWidth + Settings.AnchorWidth / 2, Settings.PositionHeight + Settings.AnchorHeight / 2), "Menu", Color.Gray, 10, DrawTextFormat.Center | DrawTextFormat.VerticalCenter);
     foreach (BooleanButton current in this.buttons)
         current.Render(rc);
 }
Пример #10
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("ItemAlert") || !Settings.GetBool("ItemAlert.ShowText"))
            {
                return;
            }
            Rect clientRect     = this.poe.Internal.game.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
            Vec2 rightTopAnchor = new Vec2(clientRect.X + clientRect.W, clientRect.Y + clientRect.H + 5);

            int y        = rightTopAnchor.Y;
            int fontSize = Settings.GetInt("ItemAlert.ShowText.FontSize");

            foreach (KeyValuePair <ExileBot.Entity, AlertDrawStyle> kv in this.currentAlerts)
            {
                if (!kv.Key.IsValid)
                {
                    continue;
                }

                string text = GetItemName(kv);
                if (null == text)
                {
                    continue;
                }

                AlertDrawStyle drawStyle   = kv.Value;
                int            frameWidth  = drawStyle.FrameWidth;
                Vec2           vPadding    = new Vec2(frameWidth + 5, frameWidth);
                int            frameMargin = frameWidth + 2;

                Vec2 textPos = new Vec2(rightTopAnchor.X - vPadding.X, y + vPadding.Y);

                var  vTextFrame = rc.AddTextWithHeight(textPos, text, drawStyle.color, fontSize, DrawTextFormat.Right);
                int  iconSize   = vTextFrame.Y;
                bool hasIcon    = drawStyle.IconIndex >= 0;

                int maxHeight = vTextFrame.Y + 2 * vPadding.Y + frameMargin;
                int maxWidth  = vTextFrame.X + 2 * vPadding.X + (hasIcon ? iconSize : 0);
                rc.AddBox(new Rect(rightTopAnchor.X - maxWidth, y, maxWidth, maxHeight), Color.FromArgb(180, 0, 0, 0));

                if (hasIcon)
                {
                    const float iconsInSprite = 4;

                    Rect   iconPos = new Rect(textPos.X - iconSize - vTextFrame.X, textPos.Y, iconSize, iconSize);
                    RectUV uv      = new RectUV(drawStyle.IconIndex / iconsInSprite, 0, (drawStyle.IconIndex + 1) / iconsInSprite, 1);
                    rc.AddSprite("item_icons.png", iconPos, uv);
                }
                if (frameWidth > 0)
                {
                    Rect frame = new Rect(rightTopAnchor.X - vTextFrame.X - 2 * vPadding.X, y, vTextFrame.X + 2 * vPadding.X, vTextFrame.Y + 2 * vPadding.Y);
                    rc.AddFrame(frame, kv.Value.color, frameWidth);
                }
                y += vTextFrame.Y + 2 * vPadding.Y + frameMargin;
            }
        }
Пример #11
0
        public override void Render(RenderingContext rc)
        {
            int alpha = this.menuVisible ? 255 : 100;

            rc.AddBox(this.bounds, Color.FromArgb(alpha, Color.Gray));
            rc.AddTextWithHeight(new Vec2(Settings.GetInt("Menu.PositionWidth") + 25, Settings.GetInt("Menu.PositionHeight") + 12), "Menu", Color.Gray, 10, DrawTextFormat.VerticalCenter | DrawTextFormat.Center); foreach (BooleanButton current in this.buttons)
            {
                current.Render(rc);
            }
        }
Пример #12
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("XphDisplay") || (this.poe.Player != null && this.poe.Player.GetComponent <Player>().Level >= 100))
            {
                return;
            }
            if (!this.hasStarted)
            {
                this.startXp      = this.poe.Player.GetComponent <Player>().XP;
                this.startTime    = DateTime.Now;
                this.lastCalcTime = DateTime.Now;
                this.hasStarted   = true;
                return;
            }
            DateTime dtNow = DateTime.Now;
            TimeSpan delta = dtNow - this.lastCalcTime;

            if (delta.TotalSeconds > 1.0)
            {
                this.poe.Area.CurrentArea.AddTimeSpent(delta);
                calculateRemainingExp(dtNow);
                this.lastCalcTime = dtNow;
            }

            int fontSize = Settings.GetInt("XphDisplay.FontSize");
            int bgAlpha  = Settings.GetInt("XphDisplay.BgAlpha");

            Rect clientRect    = this.poe.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
            Vec2 mapWithOffset = new Vec2(clientRect.X - 10, clientRect.Y + 5);
            int  yCursor       = 0;
            Vec2 rateTextSize  = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y), this.curDisplayString, Color.White, fontSize, DrawTextFormat.Right);

            yCursor += rateTextSize.Y;
            Vec2 remainingTextSize = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + yCursor), this.curTimeLeftString, Color.White, fontSize, DrawTextFormat.Right);

            yCursor += remainingTextSize.Y;
            int    thirdLine     = mapWithOffset.Y + yCursor;
            Vec2   areaLevelNote = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, thirdLine), this.poe.Area.CurrentArea.DisplayName, Color.White, fontSize, DrawTextFormat.Right);
            string strTimer      = this.poe.Area.CurrentArea.TimeString;
            Vec2   timerSize     = rc.MeasureString(strTimer, fontSize, DrawTextFormat.Left);

            yCursor += areaLevelNote.Y;


            int  textWidth = Math.Max(Math.Max(rateTextSize.X, remainingTextSize.X), areaLevelNote.X + timerSize.X + 20) + 10;
            int  width     = Math.Max(textWidth, Math.Max(clientRect.W, this.overlay.PreloadAlert.Bounds.W));
            Rect rect      = new Rect(mapWithOffset.X - width + 5, mapWithOffset.Y - 5, width, yCursor + 10);

            this.Bounds = rect;

            rc.AddTextWithHeight(new Vec2(rect.X + 5, mapWithOffset.Y), dtNow.ToShortTimeString(), Color.White, fontSize, DrawTextFormat.Left);
            rc.AddTextWithHeight(new Vec2(rect.X + 5, thirdLine), strTimer, Color.White, fontSize, DrawTextFormat.Left);

            rc.AddBox(rect, Color.FromArgb(bgAlpha, 1, 1, 1));
        }
Пример #13
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            int alpha = this.menuVisible ? 255 : 100;

            rc.AddBox(this.bounds, Color.FromArgb(alpha, Color.Gray));
            rc.AddTextWithHeight(new Vec2(Settings.PositionWidth + Settings.AnchorWidth / 2, Settings.PositionHeight + Settings.AnchorHeight / 2), "Menu", Color.Gray, 10, DrawTextFormat.Center | DrawTextFormat.VerticalCenter);
            foreach (BooleanButton current in this.buttons)
            {
                current.Render(rc);
            }
        }
Пример #14
0
        public override void Render(RenderingContext rc)
        {
            int alpha = this.menuVisible ? 255 : 50;

            rc.AddBox(this.bounds, Color.FromArgb(alpha, Color.Gray));
            rc.AddTextWithHeight(new Vec2(128, 16), "Menu", Color.White, 16, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
            foreach (BooleanButton current in this.buttons)
            {
                current.Render(rc);
            }
        }
Пример #15
0
 public override void Render(RenderingContext rc)
 {
     if (!this.isVisible)
     {
         return;
     }
     Color color = this.isEnabled ? Color.Gray : Color.Crimson;
     rc.AddTextWithHeight(new Vec2(base.Bounds.X + base.Bounds.W / 2, base.Bounds.Y + base.Bounds.H / 2), this.text, Color.White, 12, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
     rc.AddBox(base.Bounds, Color.Black);
     rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), color);
     if (this.children.Count > 0)
     {
         int num = (int)((float)(base.Bounds.W - 2) * 0.05f);
         int num2 = (base.Bounds.H - 2) / 2;
         rc.AddTexture("menu_submenu.png", new Rect(base.Bounds.X + base.Bounds.W - 1 - num, base.Bounds.Y + 1 + num2 - num2 / 2, num, num2));
     }
     foreach (MenuItem current in this.children)
     {
         current.Render(rc);
     }
 }
Пример #16
0
        public override void Render(RenderingContext rc)
        {
            if (!this.isVisible)
            {
                return;
            }
            Color color = this.isEnabled ? Color.Gray : Color.Crimson;

            rc.AddTextWithHeight(new Vec2(base.Bounds.X + base.Bounds.W / 2, base.Bounds.Y + base.Bounds.H / 2), this.text, Color.White, 12, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
            rc.AddBox(base.Bounds, Color.Black);
            rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), color);
            if (this.children.Count > 0)
            {
                int num  = (int)((float)(base.Bounds.W - 2) * 0.05f);
                int num2 = (base.Bounds.H - 2) / 2;
                rc.AddTexture("menu_submenu.png", new Rect(base.Bounds.X + base.Bounds.W - 1 - num, base.Bounds.Y + 1 + num2 - num2 / 2, num, num2));
            }
            foreach (MenuItem current in this.children)
            {
                current.Render(rc);
            }
        }
Пример #17
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("ItemAlert") || !Settings.GetBool("ItemAlert.ShowText"))
            {
                return;
            }
            Rect clientRect = this.poe.Internal.game.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
            Vec2 rightTopAnchor = new Vec2(clientRect.X + clientRect.W, clientRect.Y + clientRect.H + 5);

            int y = rightTopAnchor.Y;
            int fontSize = Settings.GetInt("ItemAlert.ShowText.FontSize");

            foreach (KeyValuePair<ExileBot.Entity, AlertDrawStyle> kv in this.currentAlerts)
            {
                if (!kv.Key.IsValid) continue;

                string text = GetItemName(kv);
                if( null == text ) continue;

                AlertDrawStyle drawStyle = kv.Value;
                int frameWidth = drawStyle.FrameWidth;
                Vec2 vPadding = new Vec2(frameWidth + 5, frameWidth);
                int frameMargin = frameWidth + 2;

                Vec2 textPos = new Vec2(rightTopAnchor.X - vPadding.X, y + vPadding.Y);

                var vTextFrame = rc.AddTextWithHeight(textPos, text, drawStyle.color, fontSize, DrawTextFormat.Right);
                int iconSize = vTextFrame.Y;
                bool hasIcon = drawStyle.IconIndex >= 0;

                int maxHeight = vTextFrame.Y + 2*vPadding.Y + frameMargin;
                int maxWidth = vTextFrame.X + 2 * vPadding.X + (hasIcon ? iconSize : 0);
                rc.AddBox(new Rect(rightTopAnchor.X - maxWidth, y, maxWidth, maxHeight), Color.FromArgb(180, 0, 0, 0));

                if (hasIcon)
                {
                    const float iconsInSprite = 4;

                    Rect iconPos = new Rect(textPos.X - iconSize - vTextFrame.X, textPos.Y, iconSize, iconSize);
                    RectUV uv = new RectUV(drawStyle.IconIndex / iconsInSprite, 0, (drawStyle.IconIndex + 1) / iconsInSprite, 1);
                    rc.AddSprite("item_icons.png", iconPos, uv);
                }
                if( frameWidth > 0) {
                    Rect frame = new Rect(rightTopAnchor.X - vTextFrame.X - 2*vPadding.X, y, vTextFrame.X + 2*vPadding.X, vTextFrame.Y + 2*vPadding.Y);
                    rc.AddFrame(frame, kv.Value.color, frameWidth);
                }
                y += vTextFrame.Y + 2 * vPadding.Y + frameMargin;
            }
        }
Пример #18
0
        private static Vec2 drawItem(RenderingContext rc, AlertDrawStyle drawStyle, Vec2 delta, int x, int y, Vec2 vPadding, string text,
                                     int fontSize)
        {
            // collapse padding when there's a frame
            vPadding.X -= drawStyle.FrameWidth;
            vPadding.Y -= drawStyle.FrameWidth;
            // item will appear to have equal size

            double phi;
            var    distance = delta.GetPolarCoordinates(out phi);


            //text = text + " @ " + (int)distance + " : " + (int)(phi / Math.PI * 180)  + " : " + xSprite;

            int  compassOffset = fontSize + 8;
            Vec2 textPos       = new Vec2(x - vPadding.X - compassOffset, y + vPadding.Y);
            Vec2 vTextSize     = rc.AddTextWithHeight(textPos, text, drawStyle.color, fontSize, DrawTextFormat.Right);

            int iconSize = drawStyle.IconIndex >= 0 ? vTextSize.Y : 0;

            int fullHeight = vTextSize.Y + 2 * vPadding.Y + 2 * drawStyle.FrameWidth;
            int fullWidth  = vTextSize.X + 2 * vPadding.X + iconSize + 2 * drawStyle.FrameWidth + compassOffset;

            rc.AddBox(new Rect(x - fullWidth, y, fullWidth - compassOffset, fullHeight), Color.FromArgb(180, 0, 0, 0));

            var rectUV = GetDirectionsUv(phi, distance);

            rc.AddSprite("directions.png", new Rect(x - vPadding.X - compassOffset + 6, y + vPadding.Y, vTextSize.Y, vTextSize.Y), rectUV);

            if (iconSize > 0)
            {
                const float iconsInSprite = 6;

                Rect   iconPos = new Rect(textPos.X - iconSize - vTextSize.X, textPos.Y, iconSize, iconSize);
                RectUV uv      = new RectUV(drawStyle.IconIndex / iconsInSprite, 0, (drawStyle.IconIndex + 1) / iconsInSprite, 1);
                rc.AddSprite("item_icons.png", iconPos, uv);
            }
            if (drawStyle.FrameWidth > 0)
            {
                Rect frame = new Rect(x - fullWidth, y, fullWidth - compassOffset, fullHeight);
                rc.AddFrame(frame, drawStyle.color, drawStyle.FrameWidth);
            }
            return(new Vec2(fullWidth, fullHeight));
        }
Пример #19
0
        private void DrawEntityHealthbar(Color color, Color outline, Rect bg, float hpWidth, float esWidth, RenderingContext rc)
        {
            if (outline.ToArgb() != 0)
            {
                Rect rect = new Rect(bg.X - 2, bg.Y - 2, bg.W + 4, bg.H + 4);
                rc.AddBox(rect, outline);
            }
            rc.AddTexture(Settings.GetBool("Healthbars.ShowIncrements") ? "healthbar_increment.png" : "healthbar.png", bg, color);

            if ((int)hpWidth < bg.W)
            {
                Rect rect2 = new Rect(bg.X + (int)hpWidth, bg.Y, bg.W - (int)hpWidth, bg.H);
                rc.AddTexture("healthbar_bg.png", rect2, color);
            }
            if (Settings.GetBool("Healthbars.ShowES"))
            {
                bg.W = (int)esWidth;
                rc.AddTexture("esbar.png", bg, Color.White);
            }
        }
Пример #20
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            if (!hasStarted)
            {
                lastCalcTime = DateTime.Now;
                hasStarted   = true;
                return;
            }

            DateTime dtNow = DateTime.Now;
            TimeSpan delta = dtNow - lastCalcTime;

            if (delta.TotalSeconds > dps_period)
            {
                ixDamageMemory++;
                if (ixDamageMemory >= damageMemory.Length)
                {
                    ixDamageMemory = 0;
                }
                damageMemory[ixDamageMemory] = CalculateDps(delta);
                lastCalcTime = dtNow;
            }

            Vec2 mapWithOffset = mountPoints[UiMountPoint.LeftOfMinimap];
            int  dps           = ((int)damageMemory.Average());

            if (maxDps < dps)
            {
                maxDps = dps;
            }

            var textSize = rc.AddTextWithHeight(mapWithOffset, dps + " DPS", Color.White, Settings.DpsFontSize, DrawTextFormat.Right);
            var tx2      = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + textSize.Y), maxDps + " peak DPS", Color.White, Settings.PeakFontSize, DrawTextFormat.Right);

            int  width = Math.Max(tx2.X, textSize.X);
            Rect rect  = new Rect(mapWithOffset.X - 5 - width, mapWithOffset.Y - 5, width + 10, textSize.Y + tx2.Y + 10);

            rc.AddBox(rect, Color.FromArgb(160, Color.Black));

            mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(mapWithOffset.X, mapWithOffset.Y + 5 + rect.H);
        }
Пример #21
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("PreloadAlert"))
            {
                return;
            }
            int num = this.poe.Memory.ReadInt(this.poe.Memory.BaseAddress + Offsets.FileRoot, new int[]
            {
                12
            });

            if (num != this.lastCount)
            {
                this.lastCount = num;
                this.Parse();
            }
            if (this.disp.Count > 0)
            {
                Rect clientRect = this.poe.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
                Rect rect       = this.overlay.XphRenderer.Bounds;
                Vec2 vec        = new Vec2(clientRect.X - 10, rect.Y + rect.H + 10);
                int  num2       = vec.Y;
                int  num3       = clientRect.W;
                int  @int       = Settings.GetInt("PreloadAlert.FontSize");
                int  int2       = Settings.GetInt("PreloadAlert.BgAlpha");
                foreach (string current in this.disp)
                {
                    Vec2 vec2 = rc.AddTextWithHeight(new Vec2(vec.X, num2), current, Color.White, @int, DrawTextFormat.Right);
                    if (vec2.X + 10 > num3)
                    {
                        num3 = vec2.X + 10;
                    }
                    num2 += vec2.Y;
                }
                if (num3 > 0 && int2 > 0)
                {
                    this.bounds = new Rect(vec.X - num3 + 5, vec.Y - 5, num3, num2 - vec.Y + 10);
                    rc.AddBox(this.bounds, Color.FromArgb(int2, 1, 1, 1));
                }
            }
        }
Пример #22
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("DangerAlert.ShowText"))
            {
                return;
            }
            Rect             rect    = this.poe.Window.ClientRect();
            int              num     = rect.W / 2 + rect.X;
            int              num2    = (int)((float)rect.H * 0.2f) + rect.Y;
            int              num3    = 0;
            int              num4    = 0;
            HashSet <string> hashSet = new HashSet <string>();

            foreach (KeyValuePair <Entity, string> current in this.currentAlerts)
            {
                if (current.Key.IsAlive && !hashSet.Contains(current.Value))
                {
                    hashSet.Add(current.Value);
                }
            }
            int @int = Settings.GetInt("DangerAlert.ShowText.FontSize");

            foreach (string current2 in hashSet)
            {
                Vec2 vec = rc.AddTextWithHeight(new Vec2(num, num2), current2, Color.Red, @int, DrawTextFormat.Center);
                if (vec.X > num3)
                {
                    num3 = vec.X;
                }
                num2 += vec.Y;
                num4 += vec.Y;
            }
            if (num3 > 0)
            {
                Rect rect2 = new Rect(num - num3 / 2 - 5, (int)((float)rect.H * 0.2f) + rect.Y - 5, num3 + 10, num4 + 10);
                rc.AddBox(rect2, Color.FromArgb(Settings.GetInt("DangerAlert.ShowText.BgAlpha"), 1, 1, 1));
            }
        }
Пример #23
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            if (!Settings.Enabled)
            {
                return;
            }
            int num = this.model.Memory.ReadInt(this.model.Memory.BaseAddress + model.Memory.offsets.FileRoot, new int[]
            {
                12
            });

            if (num != this.lastCount)
            {
                this.lastCount = num;
                this.Parse();
            }
            if (this.disp.Count > 0)
            {
                Vec2 vec      = mountPoints[UiMountPoint.LeftOfMinimap];
                int  num2     = vec.Y;
                int  maxWidth = 0;
                foreach (string current in this.disp)
                {
                    Vec2 vec2 = rc.AddTextWithHeight(new Vec2(vec.X, num2), current, Color.White, Settings.FontSize, DrawTextFormat.Right);
                    if (vec2.X + 10 > maxWidth)
                    {
                        maxWidth = vec2.X + 10;
                    }
                    num2 += vec2.Y;
                }
                if (maxWidth > 0 && Settings.BgAlpha > 0)
                {
                    Rect bounds = new Rect(vec.X - maxWidth + 5, vec.Y - 5, maxWidth, num2 - vec.Y + 10);
                    rc.AddBox(bounds, Color.FromArgb(Settings.BgAlpha, 1, 1, 1));
                    mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(vec.X, vec.Y + 5 + bounds.H);
                }
            }
        }
Пример #24
0
 public override void Render(RenderingContext rc)
 {
     if (!Settings.GetBool("DangerAlert.ShowText"))
     {
         return;
     }
     Rect rect = this.poe.Window.ClientRect();
     int num = rect.W / 2 + rect.X;
     int num2 = (int)((float)rect.H * 0.2f) + rect.Y;
     int num3 = 0;
     int num4 = 0;
     HashSet<string> hashSet = new HashSet<string>();
     foreach (KeyValuePair<Entity, string> current in this.currentAlerts)
     {
         if (current.Key.IsAlive && !hashSet.Contains(current.Value))
         {
             hashSet.Add(current.Value);
         }
     }
     int @int = Settings.GetInt("DangerAlert.ShowText.FontSize");
     foreach (string current2 in hashSet)
     {
         Vec2 vec = rc.AddTextWithHeight(new Vec2(num, num2), current2, Color.Red, @int, DrawTextFormat.Center);
         if (vec.X > num3)
         {
             num3 = vec.X;
         }
         num2 += vec.Y;
         num4 += vec.Y;
     }
     if (num3 > 0)
     {
         Rect rect2 = new Rect(num - num3 / 2 - 5, (int)((float)rect.H * 0.2f) + rect.Y - 5, num3 + 10, num4 + 10);
         rc.AddBox(rect2, Color.FromArgb(Settings.GetInt("DangerAlert.ShowText.BgAlpha"), 1, 1, 1));
     }
 }
Пример #25
0
        private void RenderRolls(RenderingContext rc, Rect clientRect)
        {
            int yPosTooltil = clientRect.Y + clientRect.H + 5;
            int i           = yPosTooltil + 4;

            // Implicit mods
            //foreach (Poe_ItemMod item in impMods)
            //{
            //    rc.AddTextWithHeight(new Vec2(clientRect.X, yPos), item.Name, Color.Yellow, 9, DrawTextFormat.Left);
            //    rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 10, yPos), item.Level.ToString(), Color.White, 6, DrawTextFormat.Left);
            //    yPos += 20;
            //}

            foreach (RollValue item in this._mods)
            {
                i  = drawStatLine(rc, item, clientRect, i);
                i += 4;
            }
            if (i > yPosTooltil + 4)
            {
                Rect helpRect = new Rect(clientRect.X + 1, yPosTooltil, clientRect.W, i - yPosTooltil);
                rc.AddBox(helpRect, Color.FromArgb(220, Color.Black));
            }
        }
Пример #26
0
        public override void Render(RenderingContext rc)
        {
            if (!this.isVisible)
            {
                return;
            }

            rc.AddBox(base.Bounds, Color.Black);
            rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), Color.Gray);

            for (int c = 0; c < 3; c++ )
            {
                Rect barBounds = new Rect(base.Bounds.X, base.Bounds.Y + (base.Bounds.H / 3 * c), base.Bounds.W - 15, base.Bounds.H / 3);
                rc.AddTextWithHeight(new Vec2(barBounds.X + barBounds.W / 2, barBounds.Y + barBounds.H / 3), bars[c].Name + ": " + this.value.PrimaryColorValue(bars[c]), Color.White, 11, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
                rc.AddBox(new Rect(barBounds.X + 5, barBounds.Y + (3 * barBounds.H / 4), barBounds.W - 10, 4), bars[c]);
                rc.AddBox(new Rect(barBounds.X + 5 + ((barBounds.W - 10) * this.value.PrimaryColorValue(bars[c]) / 255) - 2, barBounds.Y + (3 * barBounds.H / 4) - 2, 4, 8), Color.White);
            }

            Rect preview = new Rect(base.Bounds.X + base.Bounds.W - 12, base.Bounds.Y + 2, 10, base.Bounds.H - 4);
            rc.AddBox(preview, Color.Black);
            rc.AddBox(new Rect(preview.X + 1, preview.Y + 1, preview.W - 2, preview.H - 2), this.value);
        }
Пример #27
0
        public override void Render(RenderingContext rc)
        {
            if (!this.isVisible)
            {
                return;
            }

            rc.AddBox(base.Bounds, Color.Black);
            rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), Color.Gray);

            for (int c = 0; c < 3; c++)
            {
                Rect barBounds = new Rect(base.Bounds.X, base.Bounds.Y + (base.Bounds.H / 3 * c), base.Bounds.W - 15, base.Bounds.H / 3);
                rc.AddTextWithHeight(new Vec2(barBounds.X + barBounds.W / 2, barBounds.Y + barBounds.H / 3), bars[c].Name + ": " + this.value.PrimaryColorValue(bars[c]), Color.White, 11, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
                rc.AddBox(new Rect(barBounds.X + 5, barBounds.Y + (3 * barBounds.H / 4), barBounds.W - 10, 4), bars[c]);
                rc.AddBox(new Rect(barBounds.X + 5 + ((barBounds.W - 10) * this.value.PrimaryColorValue(bars[c]) / 255) - 2, barBounds.Y + (3 * barBounds.H / 4) - 2, 4, 8), Color.White);
            }

            Rect preview = new Rect(base.Bounds.X + base.Bounds.W - 12, base.Bounds.Y + 2, 10, base.Bounds.H - 4);

            rc.AddBox(preview, Color.Black);
            rc.AddBox(new Rect(preview.X + 1, preview.Y + 1, preview.W - 2, preview.H - 2), this.value);
        }
Пример #28
0
 public override void Render(RenderingContext rc)
 {
     if (!Settings.GetBool("PreloadAlert"))
     {
         return;
     }
     int num = this.poe.Memory.ReadInt(this.poe.Memory.BaseAddress + poe.Memory.offsets.FileRoot, new int[]
     {
         12
     });
     if (num != this.lastCount)
     {
         this.lastCount = num;
         this.Parse();
     }
     if (this.disp.Count > 0)
     {
         Rect clientRect = this.poe.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
         Rect rect = this.overlay.XphRenderer.Bounds;
         Vec2 vec = new Vec2(clientRect.X - 10, rect.Y + rect.H + 10);
         int num2 = vec.Y;
         int num3 = clientRect.W;
         int @int = Settings.GetInt("PreloadAlert.FontSize");
         int int2 = Settings.GetInt("PreloadAlert.BgAlpha");
         foreach (string current in this.disp)
         {
             Vec2 vec2 = rc.AddTextWithHeight(new Vec2(vec.X, num2), current, Color.White, @int, DrawTextFormat.Right);
             if (vec2.X + 10 > num3)
             {
                 num3 = vec2.X + 10;
             }
             num2 += vec2.Y;
         }
         if (num3 > 0 && int2 > 0)
         {
             this.bounds = new Rect(vec.X - num3 + 5, vec.Y - 5, num3, num2 - vec.Y + 10);
             rc.AddBox(this.bounds, Color.FromArgb(int2, 1, 1, 1));
         }
     }
 }
Пример #29
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("Tooltip") || !Settings.GetBool("Tooltip.ShowItemMods"))
            {
                return;
            }
            Element uiHover   = this.poe.Internal.IngameState.UIHover;
            Entity  poeEntity = uiHover.AsObject <InventoryItemIcon>().Item;

            if (poeEntity.address == 0 || !poeEntity.IsValid)
            {
                return;
            }
            Tooltip tooltip = uiHover.AsObject <InventoryItemIcon>().Tooltip;

            if (tooltip == null)
            {
                return;
            }
            Element childAtIndex1 = tooltip.GetChildAtIndex(0);

            if (childAtIndex1 == null)
            {
                return;
            }
            Element childAtIndex2 = childAtIndex1.GetChildAtIndex(1);

            if (childAtIndex2 == null)
            {
                return;
            }
            Rect clientRect = childAtIndex2.GetClientRect();
            Rect headerRect = childAtIndex1.GetChildAtIndex(0).GetClientRect();

            if (this.poeEntity == null || this.poeEntity.ID != poeEntity.ID)
            {
                this.mods = new List <MaxRolls_Current>();
                //List<Poe_ItemMod> impMods = poeEntity.GetComponent<Mods>().ImplicitMods;
                List <ItemMod> expMods = poeEntity.GetComponent <Mods>().ItemMods;
                int            ilvl    = poeEntity.GetComponent <Mods>().ItemLevel;
                foreach (ItemMod item in expMods)
                {
                    this.mods.Add(new MaxRolls_Current(item.Name, item.Level, ilvl));
                }
                this.poeEntity = poeEntity;
            }
            int tooltipBotY = clientRect.Y + clientRect.H;
            int i           = tooltipBotY;

            // Implicit mods
            //foreach (Poe_ItemMod item in impMods)
            //{
            //    rc.AddTextWithHeight(new Vec2(clientRect.X, i), item.Name, Color.Yellow, 9, DrawTextFormat.Left);
            //    rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 10, i), item.Level.ToString(), Color.White, 6, DrawTextFormat.Left);
            //    i += 20;
            //}
            foreach (MaxRolls_Current item in this.mods)
            {
                rc.AddTextWithHeight(new Vec2(clientRect.X, i), item.name, item.color, 8, DrawTextFormat.Left);
                i += 20;
                rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 100, i), item.max, Color.White, 8, DrawTextFormat.Left);
                rc.AddTextWithHeight(new Vec2(clientRect.X + 30, i), item.curr, Color.White, 8, DrawTextFormat.Left);
                i += 20;
                if (item.curr2 != null && item.max2 != null)
                {
                    rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 100, i), item.max2, Color.White, 8, DrawTextFormat.Left);
                    rc.AddTextWithHeight(new Vec2(clientRect.X + 30, i), item.curr2, Color.White, 8, DrawTextFormat.Left);
                    i += 20;
                }
            }
            if (i > tooltipBotY)
            {
                Rect helpRect = new Rect(clientRect.X + 1, tooltipBotY, clientRect.W, i - tooltipBotY);
                rc.AddBox(helpRect, Color.FromArgb(220, Color.Black));
            }
        }
Пример #30
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            if (!Settings.GetBool("Tooltip") || !Settings.GetBool("Tooltip.ShowItemMods"))
            {
                return;
            }
            Element uiHover = this.model.Internal.IngameState.UIHover;

            Tooltip tooltip = uiHover.AsObject <InventoryItemIcon>().Tooltip;

            if (tooltip == null)
            {
                return;
            }
            Element childAtIndex1 = tooltip.GetChildAtIndex(0);

            if (childAtIndex1 == null)
            {
                return;
            }
            Element childAtIndex2 = childAtIndex1.GetChildAtIndex(1);

            if (childAtIndex2 == null)
            {
                return;
            }
            Rect clientRect = childAtIndex2.GetClientRect();

            Entity poeEntity = uiHover.AsObject <InventoryItemIcon>().Item;

            if (poeEntity.address == 0 || !poeEntity.IsValid)
            {
                return;
            }
            if (this.poeEntity == null || this.poeEntity.ID != poeEntity.ID)
            {
                this.mods = new List <RollValue>();
                //List<Poe_ItemMod> impMods = poeEntity.GetComponent<Mods>().ImplicitMods;
                List <ItemMod> expMods = poeEntity.GetComponent <Mods>().ItemMods;
                int            ilvl    = poeEntity.GetComponent <Mods>().ItemLevel;
                foreach (ItemMod item in expMods)
                {
                    this.mods.Add(new RollValue(item, model.Files, ilvl));
                }
                this.poeEntity = poeEntity;
            }
            int yPosTooltil = clientRect.Y + clientRect.H + 5;
            int i           = yPosTooltil + 4;

            // Implicit mods
            //foreach (Poe_ItemMod item in impMods)
            //{
            //    rc.AddTextWithHeight(new Vec2(clientRect.X, yPos), item.Name, Color.Yellow, 9, DrawTextFormat.Left);
            //    rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 10, yPos), item.Level.ToString(), Color.White, 6, DrawTextFormat.Left);
            //    yPos += 20;
            //}

            foreach (RollValue item in this.mods)
            {
                i = drawStatLine(rc, item, clientRect, i);

                i += 4;
                //if (item.curr2 != null && item.max2 != null)
                //{
                //	rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 100, yPos), item.AllTiersRange2.ToString(), Color.White, 8, DrawTextFormat.Left);
                //	rc.AddTextWithHeight(new Vec2(clientRect.X + 30, yPos), item.curr2, Color.White, 8, DrawTextFormat.Left);
                //	yPos += 20;
                //}
            }
            if (i > yPosTooltil + 4)
            {
                Rect helpRect = new Rect(clientRect.X + 1, yPosTooltil, clientRect.W, i - yPosTooltil);
                rc.AddBox(helpRect, Color.FromArgb(220, Color.Black));
            }
        }
Пример #31
0
        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            if (!Settings.ShowText || !alertsText.Any())
            {
                return;
            }

            Rect rect = model.Window.ClientRect();
            int xScreenCenter = rect.W / 2 + rect.X;
            int yPos = rect.H * Settings.YPosition / 100 + rect.Y;

            var playerPos = model.Player.GetComponent<Positioned>().GridPos;
            int fontSize = Settings.TextFontSize;
            bool first = true;
            Rect rectBackground = new Rect();
            foreach (var alert in alertsText)
            {
                int cntAlive = alert.Value.Count(c => c.IsAlive);
                if (cntAlive == 0)
                    continue;

                Vec2 textSize = rc.MeasureString(alert.Key, fontSize, DrawTextFormat.Center);

                int iconSize = 3 + textSize.Y;

                int xPos = xScreenCenter - textSize.X / 2 - 6;
                rc.AddTextWithHeight(new Vec2(xPos + 6, yPos), alert.Key, Color.Red, fontSize, DrawTextFormat.Left);

                int cntArrows = 1;
                rectBackground = new Rect(xPos - cntAlive * iconSize, yPos, textSize.X + 12 + cntAlive * iconSize, textSize.Y);
                if (first) // vertical padding above
                {
                    if( !Settings.StackUp)
                        rectBackground.Y -= 5;
                    rectBackground.H += 5;
                    first = false;
                }
                rc.AddBox(rectBackground, Color.FromArgb(Settings.TextBgAlpha, 1, 1, 1));

                foreach (EntityWrapper mob in alert.Value)
                {
                    if (!mob.IsAlive)
                        continue;
                    Vec2 delta = mob.GetComponent<Positioned>().GridPos - playerPos;
                    double phi;
                    double distance = delta.GetPolarCoordinates(out phi);
                    RectUV uv = GetDirectionsUv(phi, distance);

                    Rect rectDirection = new Rect(xPos - cntArrows * iconSize, yPos, rectBackground.H, rectBackground.H);
                    cntArrows++;
                    rc.AddSprite("directions.png", rectDirection, uv, Color.Red);
                }

                yPos += Settings.StackUp ? -textSize.Y : textSize.Y;
            }

            if (!first)  // vertical padding below
            {
                rectBackground.Y = rectBackground.Y + (Settings.StackUp ? - rectBackground.H - 5: rectBackground.H);
                rectBackground.H = 5;
                rc.AddBox(rectBackground, Color.FromArgb(Settings.TextBgAlpha, 1, 1, 1));
            }
        }
Пример #32
0
        private static Vec2 drawItem(RenderingContext rc, AlertDrawStyle drawStyle, Vec2 delta, int x, int y, Vec2 vPadding, string text,
			int fontSize)
        {
            // collapse padding when there's a frame
            vPadding.X -= drawStyle.FrameWidth;
            vPadding.Y -= drawStyle.FrameWidth;
            // item will appear to have equal size

            double phi;
            var distance = delta.GetPolarCoordinates(out phi);

            //text = text + " @ " + (int)distance + " : " + (int)(phi / Math.PI * 180)  + " : " + xSprite;

            int compassOffset = fontSize + 8;
            Vec2 textPos = new Vec2(x - vPadding.X - compassOffset, y + vPadding.Y);
            Vec2 vTextSize = rc.AddTextWithHeight(textPos, text, drawStyle.color, fontSize, DrawTextFormat.Right);

            int iconSize =  drawStyle.IconIndex >= 0 ? vTextSize.Y : 0;

            int fullHeight = vTextSize.Y + 2 * vPadding.Y + 2 * drawStyle.FrameWidth;
            int fullWidth = vTextSize.X + 2 * vPadding.X + iconSize + 2 * drawStyle.FrameWidth + compassOffset;
            rc.AddBox(new Rect(x - fullWidth, y, fullWidth - compassOffset, fullHeight), Color.FromArgb(180, 0, 0, 0));

            var rectUV = GetDirectionsUv(phi, distance);
            rc.AddSprite("directions.png", new Rect(x - vPadding.X - compassOffset + 6, y + vPadding.Y, vTextSize.Y, vTextSize.Y), rectUV);

            if (iconSize > 0)
            {
                const float iconsInSprite = 6;

                Rect iconPos = new Rect(textPos.X - iconSize - vTextSize.X, textPos.Y, iconSize, iconSize);
                RectUV uv = new RectUV(drawStyle.IconIndex/iconsInSprite, 0, (drawStyle.IconIndex + 1)/iconsInSprite, 1);
                rc.AddSprite("item_icons.png", iconPos, uv);
            }
            if (drawStyle.FrameWidth > 0)
            {
                Rect frame = new Rect(x - fullWidth, y, fullWidth - compassOffset , fullHeight);
                rc.AddFrame(frame, drawStyle.color, drawStyle.FrameWidth);
            }
            return new Vec2(fullWidth, fullHeight);
        }
Пример #33
0
        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            if (this.model.Player != null && this.model.Player.GetComponent<Player>().Level >= 100)
            {
                return;
            }
            if (!this.hasStarted)
            {
                this.startXp = this.model.Player.GetComponent<Player>().XP;
                this.startTime = DateTime.Now;
                this.lastCalcTime = DateTime.Now;
                this.hasStarted = true;
                return;
            }
            DateTime dtNow = DateTime.Now;
            TimeSpan delta = dtNow - this.lastCalcTime;

            if (delta.TotalSeconds > 1)
            {
                calculateRemainingExp(dtNow);
                this.lastCalcTime = dtNow;
            }

            int fontSize = Settings.FontSize;
            int bgAlpha = Settings.BgAlpha;

            Vec2 mapWithOffset = mountPoints[UiMountPoint.LeftOfMinimap];

            int yCursor = 0;
            Vec2 rateTextSize = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y), this.curDisplayString, Color.White, fontSize, DrawTextFormat.Right);
            yCursor += rateTextSize.Y;
            Vec2 remainingTextSize = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + yCursor), this.curTimeLeftString, Color.White, fontSize, DrawTextFormat.Right);
            yCursor += remainingTextSize.Y;

            int thirdLine = mapWithOffset.Y + yCursor;

            int textWidth = Math.Max(rateTextSize.X, remainingTextSize.X) + 10;
            string strTimer = null;

            if (Settings.ShowZoneAndTimeSpent)
            {
                Vec2 areaLevelNote = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, thirdLine), this.model.Area.CurrentArea.DisplayName, Color.White, fontSize, DrawTextFormat.Right);

                strTimer = AreaInstance.GetTimeString(dtNow - this.model.Area.CurrentArea.TimeEntered);
                Vec2 timerSize = rc.MeasureString(strTimer, fontSize, DrawTextFormat.Left);
                yCursor += areaLevelNote.Y;
                textWidth = Math.Max(textWidth, areaLevelNote.X + timerSize.X + 20 + 10);
            }

            Rect clientRect = model.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();

            int width = Math.Max(textWidth, Math.Max(clientRect.W, 0/*this.overlay.PreloadAlert.Bounds.W*/));
            Rect rect = new Rect(mapWithOffset.X - width + 5, mapWithOffset.Y - 5, width, yCursor + 10);

            if( Settings.ShowClock)
                rc.AddTextWithHeight(new Vec2(rect.X + 5, mapWithOffset.Y), dtNow.ToShortTimeString(), Color.White, fontSize, DrawTextFormat.Left);

            if( Settings.ShowZoneAndTimeSpent)
                rc.AddTextWithHeight(new Vec2(rect.X + 5, thirdLine), strTimer, Color.White, fontSize, DrawTextFormat.Left);

            rc.AddBox(rect, Color.FromArgb(bgAlpha, 1, 1, 1));

            mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(mapWithOffset.X, mapWithOffset.Y + 5 + rect.H);
        }
Пример #34
0
        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            if (!Settings.Enabled)
            {
                return;
            }
            int num = this.model.Memory.ReadInt(this.model.Memory.BaseAddress + model.Memory.offsets.FileRoot, new int[]
            {
                12
            });
            if (num != this.lastCount)
            {
                this.lastCount = num;
                this.Parse();
            }
            if (this.disp.Count > 0)
            {

                Vec2 vec = mountPoints[UiMountPoint.LeftOfMinimap];
                int num2 = vec.Y;
                int maxWidth = 0;
                foreach (string current in this.disp)
                {
                    Vec2 vec2 = rc.AddTextWithHeight(new Vec2(vec.X, num2), current, Color.White, Settings.FontSize, DrawTextFormat.Right);
                    if (vec2.X + 10 > maxWidth)
                    {
                        maxWidth = vec2.X + 10;
                    }
                    num2 += vec2.Y;
                }
                if (maxWidth > 0 && Settings.BgAlpha > 0)
                {
                    Rect bounds = new Rect(vec.X - maxWidth + 5, vec.Y - 5, maxWidth, num2 - vec.Y + 10);
                    rc.AddBox(bounds, Color.FromArgb(Settings.BgAlpha, 1, 1, 1));
                    mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(vec.X, vec.Y + 5 + bounds.H);
                }

            }
        }
Пример #35
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            if (this.model.Player != null && this.model.Player.GetComponent <Player>().Level >= 100)
            {
                return;
            }
            if (!this.hasStarted)
            {
                this.startXp      = this.model.Player.GetComponent <Player>().XP;
                this.startTime    = DateTime.Now;
                this.lastCalcTime = DateTime.Now;
                this.hasStarted   = true;
                return;
            }
            DateTime dtNow = DateTime.Now;
            TimeSpan delta = dtNow - this.lastCalcTime;

            if (delta.TotalSeconds > 1)
            {
                calculateRemainingExp(dtNow);
                this.lastCalcTime = dtNow;
            }

            int fontSize = Settings.FontSize;
            int bgAlpha  = Settings.BgAlpha;

            Vec2 mapWithOffset = mountPoints[UiMountPoint.LeftOfMinimap];

            int  yCursor      = 0;
            Vec2 rateTextSize = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y), this.curDisplayString, Color.White, fontSize, DrawTextFormat.Right);

            yCursor += rateTextSize.Y;
            Vec2 remainingTextSize = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + yCursor), this.curTimeLeftString, Color.White, fontSize, DrawTextFormat.Right);

            yCursor += remainingTextSize.Y;

            int thirdLine = mapWithOffset.Y + yCursor;

            int    textWidth = Math.Max(rateTextSize.X, remainingTextSize.X) + 10;
            string strTimer  = null;

            if (Settings.ShowZoneAndTimeSpent)
            {
                Vec2 areaLevelNote = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, thirdLine), this.model.Area.CurrentArea.DisplayName, Color.White, fontSize, DrawTextFormat.Right);

                strTimer = AreaInstance.GetTimeString(dtNow - this.model.Area.CurrentArea.TimeEntered);
                Vec2 timerSize = rc.MeasureString(strTimer, fontSize, DrawTextFormat.Left);
                yCursor  += areaLevelNote.Y;
                textWidth = Math.Max(textWidth, areaLevelNote.X + timerSize.X + 20 + 10);
            }

            Rect clientRect = model.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();

            int  width = Math.Max(textWidth, Math.Max(clientRect.W, 0 /*this.overlay.PreloadAlert.Bounds.W*/));
            Rect rect  = new Rect(mapWithOffset.X - width + 5, mapWithOffset.Y - 5, width, yCursor + 10);

            if (Settings.ShowClock)
            {
                rc.AddTextWithHeight(new Vec2(rect.X + 5, mapWithOffset.Y), dtNow.ToShortTimeString(), Color.White, fontSize, DrawTextFormat.Left);
            }

            if (Settings.ShowZoneAndTimeSpent)
            {
                rc.AddTextWithHeight(new Vec2(rect.X + 5, thirdLine), strTimer, Color.White, fontSize, DrawTextFormat.Left);
            }

            rc.AddBox(rect, Color.FromArgb(bgAlpha, 1, 1, 1));

            mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(mapWithOffset.X, mapWithOffset.Y + 5 + rect.H);
        }
Пример #36
0
 public override void Render(RenderingContext rc)
 {
     if (!Settings.GetBool("Tooltip") || !Settings.GetBool("Tooltip.ShowItemMods"))
         return;
     Element uiHover = this.poe.Internal.IngameState.UIHover;
     Entity poeEntity = uiHover.AsObject<InventoryItemIcon>().Item;
     if (poeEntity.address == 0 || !poeEntity.IsValid)
         return;
     Tooltip tooltip = uiHover.AsObject<InventoryItemIcon>().Tooltip;
     if (tooltip == null)
         return;
     Element childAtIndex1 = tooltip.GetChildAtIndex(0);
     if (childAtIndex1 == null)
         return;
     Element childAtIndex2 = childAtIndex1.GetChildAtIndex(1);
     if (childAtIndex2 == null)
         return;
     Rect clientRect = childAtIndex2.GetClientRect();
     Rect headerRect = childAtIndex1.GetChildAtIndex(0).GetClientRect();
     if (this.poeEntity == null || this.poeEntity.ID != poeEntity.ID) {
         this.mods = new List<MaxRolls_Current>();
         //List<Poe_ItemMod> impMods = poeEntity.GetComponent<Mods>().ImplicitMods;
         List<ItemMod> expMods = poeEntity.GetComponent<Mods>().ItemMods;
         int ilvl = poeEntity.GetComponent<Mods>().ItemLevel;
         foreach (ItemMod item in expMods)
         {
             this.mods.Add(new MaxRolls_Current(item.Name, item.Level, ilvl));
         }
         this.poeEntity = poeEntity;
     }
     int tooltipBotY=clientRect.Y + clientRect.H;
     int i = tooltipBotY;
     // Implicit mods
     //foreach (Poe_ItemMod item in impMods)
     //{
     //    rc.AddTextWithHeight(new Vec2(clientRect.X, i), item.Name, Color.Yellow, 9, DrawTextFormat.Left);
     //    rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 10, i), item.Level.ToString(), Color.White, 6, DrawTextFormat.Left);
     //    i += 20;
     //}
     foreach (MaxRolls_Current item in this.mods)
     {
         rc.AddTextWithHeight(new Vec2(clientRect.X, i), item.name, item.color, 8, DrawTextFormat.Left);
         i += 20;
         rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 100, i), item.max, Color.White, 8, DrawTextFormat.Left);
         rc.AddTextWithHeight(new Vec2(clientRect.X + 30, i), item.curr, Color.White, 8, DrawTextFormat.Left);
         i += 20;
         if (item.curr2 != null && item.max2 != null)
         {
             rc.AddTextWithHeight(new Vec2(clientRect.X + clientRect.W - 100, i), item.max2, Color.White, 8, DrawTextFormat.Left);
             rc.AddTextWithHeight(new Vec2(clientRect.X + 30, i), item.curr2, Color.White, 8, DrawTextFormat.Left);
             i += 20;
         }
     }
     if (i > tooltipBotY)
     {
         Rect helpRect = new Rect(clientRect.X + 1, tooltipBotY, clientRect.W, i - tooltipBotY);
         rc.AddBox(helpRect, Color.FromArgb(220, Color.Black));
     }
 }
Пример #37
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("XphDisplay") || (this.poe.Player != null && this.poe.Player.GetComponent <Player>().Level >= 100))
            {
                return;
            }
            if (!this.hasStarted)
            {
                this.startXp      = this.poe.Player.GetComponent <Player>().XP;
                this.startTime    = DateTime.Now;
                this.lastCalcTime = DateTime.Now;
                this.hasStarted   = true;
                return;
            }
            DateTime dtNow = DateTime.Now;

            if ((dtNow - this.lastCalcTime).TotalSeconds > 1.0)
            {
                long  currentExp = this.poe.Player.GetComponent <Player>().XP - this.startXp;
                float expRate    = (float)((double)currentExp / (dtNow - this.startTime).TotalHours);
                if ((double)expRate > 1000000.0)
                {
                    this.curDisplayString = ((double)expRate / 1000000.0).ToString("0.00") + "M XP/h";
                }
                else
                {
                    if ((double)expRate > 1000.0)
                    {
                        this.curDisplayString = ((double)expRate / 1000.0).ToString("0.00") + "K XP/h";
                    }
                    else
                    {
                        this.curDisplayString = expRate.ToString("0.00") + " XP/h";
                    }
                }
                int level = this.poe.Player.GetComponent <Player>().Level;
                if (level + 1 >= Constants.PlayerXpLevels.Length)
                {
                    return;
                }
                ulong expRemaining = (ulong)Constants.PlayerXpLevels[level + 1] - (ulong)this.poe.Player.GetComponent <Player>().XP;
                if (expRate > 1f)
                {
                    int num4 = (int)((float)expRemaining / expRate * 3600f);
                    int num5 = num4 / 60;
                    int num6 = num5 / 60;
                    this.curTimeLeftString = string.Concat(num6, "h ", num5 % 60, "m ", num4 % 60, "s until level up");
                }
                this.lastCalcTime = dtNow;
            }

            int fontSize = Settings.GetInt("XphDisplay.FontSize");
            int bgAlpha  = Settings.GetInt("XphDisplay.BgAlpha");

            Rect clientRect    = this.poe.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
            Vec2 mapWithOffset = new Vec2(clientRect.X - 10, clientRect.Y + 5);
            int  num7          = 0;
            Vec2 vec2          = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y), this.curDisplayString, Color.White, fontSize, DrawTextFormat.Right);

            num7 += vec2.Y;
            Vec2 vec3 = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + num7), this.curTimeLeftString, Color.White, fontSize, DrawTextFormat.Right);

            num7 += vec3.Y;
            int  val  = Math.Max(vec2.X, vec3.X) + 10;
            int  num8 = Math.Max(val, Math.Max(clientRect.W, this.overlay.PreloadAlert.Bounds.W));
            Rect rect = new Rect(mapWithOffset.X - num8 + 5, mapWithOffset.Y - 5, num8, num7 + 10);

            this.Bounds = rect;

            rc.AddTextWithHeight(new Vec2(rect.X + 5, mapWithOffset.Y), dtNow.ToShortTimeString(), Color.White, fontSize, DrawTextFormat.Left);
            rc.AddBox(rect, Color.FromArgb(bgAlpha, 1, 1, 1));
        }
Пример #38
0
        private void RenderRolls(RenderingContext rc, Rect clientRect)
        {
            int yPosTooltil = clientRect.Y + clientRect.H + 5;
            int i = yPosTooltil + 4;

            // Implicit mods
            if( Settings.ShowImplicitMod)
                foreach (RollValue mod in this._implicitMods)
                {
                    i = drawStatLine(rc, mod, clientRect, i, true);
                    i += 6;
                }

            if (Settings.ShowItemMods)
                foreach (RollValue item in this._explicitMods)
                {
                    i = drawStatLine(rc, item, clientRect, i);
                    i += 4;
                }

            if (i > yPosTooltil + 4)
            {
                Rect helpRect = new Rect(clientRect.X + 1, yPosTooltil, clientRect.W, i - yPosTooltil);
                rc.AddBox(helpRect, Color.FromArgb(220, Color.Black));
            }
        }
Пример #39
0
        public override void Render(RenderingContext rc, Dictionary<UiMountPoint, Vec2> mountPoints)
        {
            if (!hasStarted)
            {
                lastCalcTime = DateTime.Now;
                hasStarted = true;
                return;
            }

            DateTime dtNow = DateTime.Now;
            TimeSpan delta = dtNow - lastCalcTime;

            if (delta.TotalSeconds > dps_period)
            {
                ixDamageMemory++;
                if (ixDamageMemory >= damageMemory.Length)
                    ixDamageMemory = 0;
                damageMemory[ixDamageMemory] = CalculateDps(delta);
                lastCalcTime = dtNow;
            }

            Vec2 mapWithOffset = mountPoints[UiMountPoint.LeftOfMinimap];
            int dps = ((int)damageMemory.Average());
            if (maxDps < dps)
                maxDps = dps;

            var textSize = rc.AddTextWithHeight(mapWithOffset,  dps + " DPS", Color.White, Settings.DpsFontSize, DrawTextFormat.Right);
            var tx2 = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + textSize.Y), maxDps + " peak DPS", Color.White, Settings.PeakFontSize, DrawTextFormat.Right);

            int width = Math.Max(tx2.X, textSize.X);
            Rect rect = new Rect(mapWithOffset.X - 5 - width, mapWithOffset.Y - 5, width + 10, textSize.Y + tx2.Y + 10);

            rc.AddBox(rect, Color.FromArgb(160, Color.Black));

            mountPoints[UiMountPoint.LeftOfMinimap] = new Vec2(mapWithOffset.X, mapWithOffset.Y + 5 + rect.H);
        }
Пример #40
0
        public override void Render(RenderingContext rc, Dictionary <UiMountPoint, Vec2> mountPoints)
        {
            if (!Settings.ShowText || !alertsText.Any())
            {
                return;
            }

            Rect rect          = model.Window.ClientRect();
            int  xScreenCenter = rect.W / 2 + rect.X;
            int  yPos          = rect.H * Settings.YPosition / 100 + rect.Y;

            var  playerPos      = model.Player.GetComponent <Positioned>().GridPos;
            int  fontSize       = Settings.TextFontSize;
            bool first          = true;
            Rect rectBackground = new Rect();

            foreach (var alert in alertsText)
            {
                int cntAlive = alert.Value.Count(c => c.IsAlive);
                if (cntAlive == 0)
                {
                    continue;
                }

                Vec2 textSize = rc.MeasureString(alert.Key, fontSize, DrawTextFormat.Center);

                int iconSize = 3 + textSize.Y;

                int xPos = xScreenCenter - textSize.X / 2 - 6;
                rc.AddTextWithHeight(new Vec2(xPos + 6, yPos), alert.Key, Color.Red, fontSize, DrawTextFormat.Left);


                int cntArrows = 1;
                rectBackground = new Rect(xPos - cntAlive * iconSize, yPos, textSize.X + 12 + cntAlive * iconSize, textSize.Y);
                if (first)                 // vertical padding above
                {
                    if (!Settings.StackUp)
                    {
                        rectBackground.Y -= 5;
                    }
                    rectBackground.H += 5;
                    first             = false;
                }
                rc.AddBox(rectBackground, Color.FromArgb(Settings.TextBgAlpha, 1, 1, 1));

                foreach (EntityWrapper mob in alert.Value)
                {
                    if (!mob.IsAlive)
                    {
                        continue;
                    }
                    Vec2   delta = mob.GetComponent <Positioned>().GridPos - playerPos;
                    double phi;
                    double distance = delta.GetPolarCoordinates(out phi);
                    RectUV uv       = GetDirectionsUv(phi, distance);

                    Rect rectDirection = new Rect(xPos - cntArrows * iconSize, yPos, rectBackground.H, rectBackground.H);
                    cntArrows++;
                    rc.AddSprite("directions.png", rectDirection, uv, Color.Red);
                }



                yPos += Settings.StackUp ? -textSize.Y : textSize.Y;
            }

            if (!first)              // vertical padding below
            {
                rectBackground.Y = rectBackground.Y + (Settings.StackUp ? -rectBackground.H - 5: rectBackground.H);
                rectBackground.H = 5;
                rc.AddBox(rectBackground, Color.FromArgb(Settings.TextBgAlpha, 1, 1, 1));
            }
        }
Пример #41
0
        public override void Render(RenderingContext rc)
        {
            if (!Settings.GetBool("XphDisplay") || (this.poe.Player != null && this.poe.Player.GetComponent<Player>().Level >= 100))
            {
                return;
            }
            if (!this.hasStarted)
            {
                this.startXp = this.poe.Player.GetComponent<Player>().XP;
                this.startTime = DateTime.Now;
                this.lastCalcTime = DateTime.Now;
                this.hasStarted = true;
                return;
            }
            DateTime dtNow = DateTime.Now;
            TimeSpan delta = dtNow - this.lastCalcTime;

            if (delta.TotalSeconds > 1.0)
            {
                this.poe.Area.CurrentArea.AddTimeSpent(delta);
                calculateRemainingExp(dtNow);
                this.lastCalcTime = dtNow;
            }

            int fontSize = Settings.GetInt("XphDisplay.FontSize");
            int bgAlpha = Settings.GetInt("XphDisplay.BgAlpha");

            Rect clientRect = this.poe.Internal.IngameState.IngameUi.Minimap.SmallMinimap.GetClientRect();
            Vec2 mapWithOffset = new Vec2(clientRect.X - 10, clientRect.Y + 5);
            int yCursor = 0;
            Vec2 rateTextSize = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y), this.curDisplayString, Color.White, fontSize, DrawTextFormat.Right);
            yCursor += rateTextSize.Y;
            Vec2 remainingTextSize = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, mapWithOffset.Y + yCursor), this.curTimeLeftString, Color.White, fontSize, DrawTextFormat.Right);
            yCursor += remainingTextSize.Y;
            int thirdLine = mapWithOffset.Y + yCursor;
            Vec2 areaLevelNote = rc.AddTextWithHeight(new Vec2(mapWithOffset.X, thirdLine), this.poe.Area.CurrentArea.DisplayName, Color.White, fontSize, DrawTextFormat.Right);
            string strTimer = this.poe.Area.CurrentArea.TimeString;
            Vec2 timerSize = rc.MeasureString(strTimer, fontSize, DrawTextFormat.Left);
            yCursor += areaLevelNote.Y;

            int textWidth = Math.Max( Math.Max(rateTextSize.X, remainingTextSize.X), areaLevelNote.X + timerSize.X + 20 ) + 10;
            int width = Math.Max(textWidth, Math.Max(clientRect.W, this.overlay.PreloadAlert.Bounds.W));
            Rect rect = new Rect(mapWithOffset.X - width + 5, mapWithOffset.Y - 5, width, yCursor + 10);
            this.Bounds = rect;

            rc.AddTextWithHeight(new Vec2(rect.X + 5, mapWithOffset.Y), dtNow.ToShortTimeString(), Color.White, fontSize, DrawTextFormat.Left);
            rc.AddTextWithHeight(new Vec2(rect.X + 5, thirdLine), strTimer, Color.White, fontSize, DrawTextFormat.Left);

            rc.AddBox(rect, Color.FromArgb(bgAlpha, 1, 1, 1));
        }