コード例 #1
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            var skill = Hud.Game.Me.Powers.UsedSkills.Where(x => x.SnoPower.Sno == 454174 || x.SnoPower.Sno == 461650 || x.SnoPower.Sno == 460757 || x.SnoPower.Sno == 462239).FirstOrDefault();

            if (skill != null)
            {
                var DeadBody = Hud.Game.Actors.Where(d => d.SnoActor.Sno == 454066 && d.IsOnScreen);
                int Count    = 0;
                var uiRect   = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_progressBar_manaBall").Rectangle;
                var w        = uiRect.Width / 1.6f;
                var h        = uiRect.Height * 0.15f;
                var x        = uiRect.Left + w * 0.28f;
                var y        = uiRect.Top - uiRect.Height * 0.17f;
                if (DeadBodyCount == true)
                {
                    foreach (var actor in DeadBody)
                    {
                        Count++;
                    }
                    if (Count > 0)
                    {
                        switch (Hud.Game.Me.HeroClassDefinition.HeroClass)
                        {
                        case HeroClass.Necromancer:
                            DeadBodyCountDecorator.Paint(x, y, w, h, "尸骸:" + Count);
                            break;
                        }
                    }
                }
            }
        }
コード例 #2
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (!Hud.Game.IsInGame)
            {
                return;
            }

            //Removed the early-return check for in-town, because in the original, being in town would mean no
            //rectangle gets drawn. But in our version, the registry key will persist regardless (where there used to
            //be a temporary rectangle).

            bool near = Hud.Game.Players.Where(p => !p.IsMe &&
                                               p.HasValidActor &&
                                               p.HeroClassDefinition.HeroClass == Heroclass &&
                                               p.CentralXyDistanceToMe <= Distance).Any();

            RegistryKey rkey = null;

            try
            {
                rkey = Registry.CurrentUser.OpenSubKey(ROOT_KEY, true).OpenSubKey(SUB_KEY, true);
                rkey.SetValue(REGISTRY_ENTRY_NAME, near);
                rkey.SetValue(IN_TOWN_FLAG, Hud.Game.IsInTown);
                rkey.SetValue(UPDATE_FIELD, System.DateTime.Now.ToString());
            }
            finally
            {
                //Even if something went wrong, try to close the registry key between uses.
                rkey?.Close();
            }
        }
コード例 #3
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.AfterClip)
            {
                return;
            }
            if (!_IsStoryMode)
            {
                return;
            }
            var TotaltextLayout = "总耗时 :" + GLQ_BasePluginCN.ValueToString((long)TotalTimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A1textLayout    = "A1耗时:" + GLQ_BasePluginCN.ValueToString((long)A1TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A2textLayout    = "A2耗时:" + GLQ_BasePluginCN.ValueToString((long)A2TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A3textLayout    = "A3耗时:" + GLQ_BasePluginCN.ValueToString((long)A3TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A4textLayout    = "A4耗时:" + GLQ_BasePluginCN.ValueToString((long)A4TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A5textLayout    = "A5耗时:" + GLQ_BasePluginCN.ValueToString((long)A5TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var x = Hud.Window.Size.Width / 1.18f;
            var y = Hud.Window.Size.Height / 1.15f;
            var h = Hud.Window.Size.Height * 0.018f;

            TotalTimerFont.DrawText(TotaltextLayout, x, y);
            A1TimerFont.DrawText(A1textLayout, x, y + h);
            A2TimerFont.DrawText(A2textLayout, x, y + h * 2);
            A3TimerFont.DrawText(A3textLayout, x, y + h * 3);
            A4TimerFont.DrawText(A4textLayout, x, y + h * 4);
            A5TimerFont.DrawText(A5textLayout, x, y + h * 5);
        }
コード例 #4
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (!Hud.Game.Quests.Any(q => q.SnoQuest.Sno == 337492 && q.QuestStepId == 34))
            {
                return;
            }

            var outMSG = "";

            foreach (var player in Hud.Game.Players)
            {
                var reminder = player.GetAttributeValueAsInt(Hud.Sno.Attributes.Jewel_Upgrades_Bonus, 2147483647, 0) + player.GetAttributeValueAsInt(Hud.Sno.Attributes.Jewel_Upgrades_Max, 2147483647, 0) - player.GetAttributeValueAsInt(Hud.Sno.Attributes.Jewel_Upgrades_Used, 2147483647, 0);
                if (reminder > 0)
                {
                    outMSG += (showCount ? (reminder.ToString() + " x ") : "") + player.BattleTagAbovePortrait + "\n";
                }
            }

            gemIcon?.Draw(xPos, yPos, iconSize, iconSize);
            textFont.DrawText(outMSG, xPos + iconSize, yPos);
        }
コード例 #5
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (!Hud.Game.IsInTown)
            {
                return;
            }
            if (clipState != ClipState.AfterClip)
            {
                return;
            }

            var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.minimap_dialog_backgroundScreen.minimap_dialog_pve.BoostWrapper.BoostsDifficultyStackPanel.clock");

            if (!Hud.Window.CursorInsideRect(uiRect.Rectangle.X, uiRect.Rectangle.Y, uiRect.Rectangle.Width, uiRect.Rectangle.Height))
            {
                return;
            }
            // if (!Hud.Window.CursorInsideRect(Hud.Window.Size.Width * 0.9f, Hud.Window.Size.Height * 0.02f, Hud.Window.Size.Width * 0.1f, Hud.Window.Size.Height * 0.02f)) return;

            if (Table == null)
            {
                InitTable();
            }
            else
            {
                Table.Paint();
            }
        }
コード例 #6
0
ファイル: CloudofBatsPlugin.cs プロジェクト: steathy/Resu
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Game.Me.HeroClassDefinition.HeroClass != HeroClass.WitchDoctor)
            {
                return;
            }

            var Skills = Hud.Game.Me.Powers.CurrentSkills;

            if (Skills == null)
            {
                return;
            }
            foreach (var skill in Skills)
            {
                if (skill.RuneNameEnglish == "Cloud of Bats")
                {
                    if (!Hud.Game.Me.InCombat)
                    {
                        return;
                    }
                    OutlineBrush.DrawWorldEllipse(15, -1, Hud.Game.Me.FloorCoordinate);
                }
            }
        }
コード例 #7
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState == ClipState.Inventory)
            {
                stashTabAbs = Hud.Inventory.SelectedStashTabIndex + Hud.Inventory.SelectedStashPageIndex * Hud.Inventory.MaxStashTabCountPerPage;

                foreach (var item in Hud.Game.Items)
                {
                    if (item.SnoItem.MainGroupCode != "potion")
                    {
                        continue;
                    }
                    if (item.Location == ItemLocation.Stash)
                    {
                        if ((item.InventoryY / 10) != stashTabAbs)
                        {
                            continue;
                        }
                    }
                    if ((item.InventoryX < 0) || (item.InventoryY < 0))
                    {
                        continue;
                    }

                    var rect = Hud.Inventory.GetItemRect(item);
                    if (rect == System.Drawing.RectangleF.Empty)
                    {
                        continue;
                    }

                    DrawPotionPerfection(item, rect);
                }
            }
        }
コード例 #8
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            var x = Hud.Window.Size.Width * 0.7f;
            var y = Hud.Window.Size.Height * 0.01f;

            double boneringer = 0;
            var    actors     = Hud.Game.Actors.Where(a => a.SnoActor.Sno == ActorSnoEnum._p6_necro_commandskeletons_d);

            if (actors.Count() > 0)
            {
                boneringer = actors.First().GetAttributeValue(Hud.Sno.Attributes.Multiplicative_Damage_Percent_Bonus, uint.MaxValue);
            }
            if (boneringer >= 2.4)
            {
                textBuilder.Clear();

                var BoneRingerCalc1 = boneringer / 1.5f;      // Command Multiplier
                var BoneRingerCalc2 = BoneRingerCalc1 / 1.6f; // Enforcer Multiplier
                var BoneRingerCalc3 = BoneRingerCalc2 - 1f;
                var BoneRingerTime  = BoneRingerCalc3 * 100f / 30.0;

                textBuilder.AppendFormat("{0:0.00}", BoneRingerTime);
                textBuilder.AppendLine();

                var layout = GreenFont.GetTextLayout(textBuilder.ToString());
                GreenFont.DrawText(layout, x, y);
            }
        }
コード例 #9
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (!Hud.Render.UiHidden)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            var size = 55f / 1200.0f * Hud.Window.Size.Height * Ratio;

            foreach (var player in Hud.Game.Players)
            {
                var portraitRect = player.PortraitUiElement.Rectangle;
                foreach (var skill in player.Powers.UsedSkills)
                {
                    var index = skill.Key <= ActionKey.RightSkill ? (int)skill.Key + 4 : (int)skill.Key - 2;

                    var x = portraitRect.Right + size * index;
                    var y = portraitRect.Top + portraitRect.Height * 0.21f;

                    var rect = new RectangleF(x, y, size, size);

                    SkillPainter.Paint(skill, rect);
                }
            }
        }
コード例 #10
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.AfterClip)
            {
                return;
            }

            if ((Hud.Game.SpecialArea != SpecialArea.Rift) && (Hud.Game.SpecialArea != SpecialArea.GreaterRift))
            {
                return;
            }

            if (Hud.Game.RiftPercentage < DisplayLimit)
            {
                return;
            }
            if (Hud.Game.RiftPercentage >= 100)
            {
                return;
            }

            var text  = Hud.Game.RiftPercentage.ToString("F1", CultureInfo.InvariantCulture) + "%";
            var title = "Rift Completion";

            var w = Hud.Window.Size.Height * 0.1f;
            var h = Hud.Window.Size.Height * 0.04f;

            LabelDecorator.Paint(Hud.Window.Size.Width * 0.5f - w / 2, Hud.Window.Size.Height * 0.18f - h / 2, w, h, text, title);
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.Inventory)
            {
                return;
            }

            var uiInv = Hud.Inventory.InventoryMainUiElement;

            if (!uiInv.Visible)
            {
                return;
            }

            var annIds   = Hud.Game.Items.Where(i => i.Location >= ItemLocation.Head && i.Location <= ItemLocation.Neck).Select(i => i.AnnId).ToList();
            var setNames = Hud.Game.Me.ArmorySets.Where(set => set.ItemAnnIds.Any() && set.ItemAnnIds.All(id => annIds.Contains(id))).Select(set => set.Name).ToList();

            if (setNames.Count == 0)
            {
                return;
            }

            var text = FirstSetOnly ? setNames.First() : string.Join("\n", setNames);

            var layout = ArmorySetFont.GetTextLayout(text);
            var x      = uiInv.Rectangle.Left + (uiInv.Rectangle.Width * 0.75f) - (layout.Metrics.Width / 2);
            var y      = uiInv.Rectangle.Top + (uiInv.Rectangle.Width * 0.21f) - layout.Metrics.Height;

            ArmorySetFont.DrawText(layout, x, y);
        }
コード例 #12
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap) || (Hud.Game.MapMode == MapMode.Map))
            {
                return;
            }

            var uiRect = Hud.Render.InGameBottomHudUiElement.Rectangle;

            var bonusRemaining = Hud.Game.Me.BonusPoolRemaining;

            (bonusRemaining > 0 ? OrangeThisLevelValueDecorator : BlueThisLevelValueDecorator).Paint(uiRect.Left + (uiRect.Width * 0.42f), uiRect.Top + (uiRect.Height * 0.470f), uiRect.Width * 0.075f, uiRect.Height * 0.07f, HorizontalAlign.Right);
            (bonusRemaining > 0 ? OrangeNextLevelValueDecorator : BlueNextLevelValueDecorator).Paint(uiRect.Left + (uiRect.Width * 0.505f), uiRect.Top + (uiRect.Height * 0.470f), uiRect.Width * 0.075f, uiRect.Height * 0.07f, HorizontalAlign.Left);

            if (bonusRemaining > 0)
            {
                BonusValueDecorator.Paint(uiRect.Left + (uiRect.Width * 0.651f), uiRect.Top + (uiRect.Height * 0.470f), uiRect.Width * 0.075f, uiRect.Height * 0.07f, HorizontalAlign.Right);
            }
        }
コード例 #13
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.AfterClip)
            {
                return;
            }
            if (!Hud.Input.IsKeyDown(Keys.V))
            {
                return;
            }

            var s = Hud.Window.Size;

            var text = string.Format(
                CultureInfo.InvariantCulture,
                "{0}x{1}\nX: {2,4}\nY: {3,4}",
                s.Width,
                s.Height,
                string.Format(CultureInfo.InvariantCulture, "{0} px | % : {1}f", Hud.Window.CursorX, Hud.Window.CursorX / (float)s.Width),
                string.Format(CultureInfo.InvariantCulture, "{0} px | % : {1}f", Hud.Window.CursorY, Hud.Window.CursorY / (float)s.Height));

            var layout = TextFont.GetTextLayout(text);
            var h      = layout.Metrics.Height;
            var w      = layout.Metrics.Width;

            var offsetX = Hud.Window.CursorX + (int)(s.Width / 2 > Hud.Window.CursorX ? Offset : -w - Offset);
            var offsetY = Hud.Window.CursorY + (int)(s.Height / 2 > Hud.Window.CursorY ? Offset : -h - Offset);

            BackgroundBrush.DrawRectangle(offsetX - Padding, offsetY - Padding, w + (Padding * 2), h + (Padding * 2));
            TextFont.DrawText(layout, offsetX, offsetY);
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (HideWhenUiIsHidden && Hud.Render.UiHidden)
            {
                return;
            }
            if (!Enabled)
            {
                return;
            }
            var paintInfoList = GeneratePaintList();

            if (paintInfoList == null || paintInfoList.Count == 0)
            {
                return;
            }

            var x = 0;
            var y = Hud.Window.Size.Height * 0.25f - Hud.Window.Size.Height * PositionOffset;

            BuffPainter.PaintHorizontalCenter(paintInfoList, x, y, Hud.Window.Size.Width, ruleCalculatorCoE.StandardIconSize, ruleCalculatorCoE.StandardIconSpacing);
        }
コード例 #15
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Game.Me.CurrentLevelNormal != 70 && Hud.Game.Me.CurrentLevelNormal > 0)
            {
                return;
            }
            if (Hud.Game.Me.HighestSoloRiftLevel < 70 && Hud.Game.Me.HighestSoloRiftLevel > 0)
            {
                return;
            }

            long   PrimalAncientTotal = Hud.Tracker.CurrentAccountTotal.DropPrimalAncient;
            long   AncientTotal       = Hud.Tracker.CurrentAccountTotal.DropAncient;
            long   LegendariesTotal   = Hud.Tracker.CurrentAccountTotal.DropLegendary;
            string TotalPercPrimal    = ((float)PrimalAncientTotal / (float)LegendariesTotal).ToString("0.00%");
            string TotalPercAncient   = ((float)AncientTotal / (float)LegendariesTotal).ToString("0.00%");

            ancientDecorator = new TopLabelDecorator(Hud)
            {
                TextFont        = Hud.Render.CreateFont("arial", 7, 220, 227, 153, 25, true, false, 255, 0, 0, 0, true),
                TextFunc        = () => ancientText,
                HintFunc        = () => "Chance for the next Legendary drop to be Ancient." + Environment.NewLine + "Total Ancient drops : " + AncientTotal + " (" + TotalPercAncient + ") of Legendary drops",
                BackgroundBrush = Hud.Render.CreateBrush(50, 0, 0, 0, 0),
            };

            primalDecorator = new TopLabelDecorator(Hud)
            {
                TextFont        = Hud.Render.CreateFont("arial", 7, 180, 255, 64, 64, true, false, 255, 0, 0, 0, true),
                TextFunc        = () => primalText,
                HintFunc        = () => "Chance for the next Legendary drop to be Primal Ancient." + Environment.NewLine + "Total Primal Ancient drops : " + PrimalAncientTotal + " (" + TotalPercPrimal + ") of Legendary drops",
                BackgroundBrush = Hud.Render.CreateBrush(50, 0, 0, 0, 0),
            };


            double RNGprobaAncient  = 9.7753333;
            double RNGprobaPrimal   = 0.2246666;
            double probaAncient     = ((float)(AncientTotal) / (float)(LegendariesTotal)) * 100;
            double probaPrimal      = ((float)(PrimalAncientTotal) / (float)(LegendariesTotal)) * 100;
            double DiffProbaAncient = (RNGprobaAncient - probaAncient);
            double DiffProbaPrimal  = (RNGprobaPrimal - probaPrimal);

            probaAncient += (DiffProbaAncient * 2);
            probaPrimal  += (DiffProbaPrimal * 2);

            probaAncient = Math.Round(probaAncient, 4);
            probaPrimal  = Math.Round(probaPrimal, 5);


            ancientText = "A: " + probaAncient + "%";
            primalText  = "P: " + probaPrimal + "%";

            var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_progressBar_healthBall").Rectangle;

            ancientDecorator.Paint(uiRect.Right - (uiRect.Width / 0.35f), uiRect.Top + (uiRect.Height / 1.168f), 75f, 25f, HorizontalAlign.Left);

            if (Hud.Game.Me.HighestSoloRiftLevel >= 70)
            {
                primalDecorator.Paint(uiRect.Right - (uiRect.Width / 0.42f), uiRect.Top + (uiRect.Height / 1.168f), 75f, 25f, HorizontalAlign.Left);
            }
        }
コード例 #16
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }

            if (clipState == ClipState.BeforeClip)
            {
                var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_window_hud_overlay").Rectangle;

                var w1 = Hud.Window.Size.Height * 0.12f;
                var h1 = Hud.Window.Size.Height * 0.02f;
                var w2 = Hud.Window.Size.Height * 0.08f;
                var h2 = Hud.Window.Size.Height * 0.02f;
                var w3 = Hud.Window.Size.Height * 0.04f;
                var h3 = Hud.Window.Size.Height * 0.02f;

                var x1 = uiRect.Left + uiRect.Width * 0.74f;
                var y1 = uiRect.Bottom - h1 - h2 - (Hud.Window.Size.Height / 600);
                var x2 = uiRect.Left + uiRect.Width * 0.77f;
                var y2 = uiRect.Bottom - h2 - (Hud.Window.Size.Height / 600);
                var x3 = uiRect.Left + uiRect.Width * 0.86f;
                var y3 = uiRect.Bottom - h3 - (Hud.Window.Size.Height / 600);

                logo1Decorator.Paint(x1 + w1 * 1, y1, w1, h1, "TurboHUD中文版");
                logo2Decorator.Paint(x2 + w2 * 1, y2, w2, h2, "插件管理器");
                logo3Decorator.Paint(x3 + w3 * 1, y3, w3, h3, "v3.59");
            }
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.Inventory)
            {
                return;
            }

            if (Hud.Game.Me.CubeSnoItem1 != null)
            {
                DrawKanaiItem(Hud.Game.Me.CubeSnoItem1, 0);
            }

            if (Hud.Game.Me.CubeSnoItem2 != null)
            {
                DrawKanaiItem(Hud.Game.Me.CubeSnoItem2, 1);
            }

            if (Hud.Game.Me.CubeSnoItem3 != null)
            {
                DrawKanaiItem(Hud.Game.Me.CubeSnoItem3, 2);
            }

            if (Hud.Game.Me.CubeSnoItem4 != null)
            {
                DrawKanaiItem(Hud.Game.Me.CubeSnoItem4, 3);
            }
        }
コード例 #18
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (!Enabled)
            {
                return;
            }
            if (clipState != ClipState.Inventory)
            {
                return;
            }
            if (Hud.Game.Me.CurrentLevelNormalCap != 70)
            {
                return;
            }

            var uiInv = Hud.Inventory.InventoryMainUiElement;

            if (!uiInv.Visible)
            {
                return;
            }

            var y = uiInv.Rectangle.Top + (uiInv.Rectangle.Height * 0.825f);

            y += DrawItemBar(_materialItems, y);
            y += DrawItemBar(_legendaryMaterials, y);
            DrawItemBar(_otherStuff, y);
        }
コード例 #19
0
ファイル: ClipTool.cs プロジェクト: NCC-Lykos/Chisel
 public ClipTool()
 {
     Usage            = ToolUsage.Both;
     _clipPlanePoint1 = _clipPlanePoint2 = _clipPlanePoint3 = _drawingPoint = null;
     _state           = _prevState = ClipState.None;
     _side            = ClipSide.Both;
 }
コード例 #20
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if ((Hud.Game.SpecialArea != SpecialArea.Rift) && (Hud.Game.SpecialArea != SpecialArea.GreaterRift) && (Hud.Game.SpecialArea != SpecialArea.ChallengeRift))
            {
                return;
            }
            if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap) || (Hud.Game.MapMode == MapMode.Map))
            {
                return;
            }

            if (Hud.Game.SpecialArea == SpecialArea.Rift)
            {
                DrawRift();
            }

            if (Hud.Game.SpecialArea == SpecialArea.GreaterRift)
            {
                DrawGreaterRift();
            }

            if (Hud.Game.SpecialArea == SpecialArea.ChallengeRift)
            {
                DrawChallengeRift();
            }
        }
コード例 #21
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            double Cooldown;
            bool   IsOnCooldown;
            var    ui = Hud.Render.GetPlayerSkillUiElement(ActionKey.Heal);

            // var rect = new RectangleF((float)Math.Round(ui.Rectangle.X) + 0.5f, (float)Math.Round(ui.Rectangle.Y) + 0.5f, (float)Math.Round(ui.Rectangle.Width), (float)Math.Round(ui.Rectangle.Height));
            var rect = new RectangleF((float)Math.Round(ui.Rectangle.X) - 105f, (float)Math.Round(ui.Rectangle.Y) - 350f, (float)Math.Round(ui.Rectangle.Width), (float)Math.Round(ui.Rectangle.Height));

            if (Hud.Game.Me.Powers.HealthPotionSkill.IsOnCooldown)
            {
                Cooldown     = (Hud.Game.Me.Powers.HealthPotionSkill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60d;
                IsOnCooldown = Cooldown <= 30 && Cooldown >= 0 ? true : false;
                if (IsOnCooldown)
                {
                    Decorator.TextFunc = () => Cooldown < 1 ? Cooldown.ToString("f1") : Cooldown.ToString("f0");
                    Decorator.Paint(rect.X, rect.Y, rect.Width, rect.Height, HorizontalAlign.Center);
                }
            }
        }
コード例 #22
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            foreach (var player in Hud.Game.Players)
            {
                if (!player.Powers.BuffIsActive(Hud.Sno.SnoPowers.NemesisBracers.Sno))
                {
                    continue;
                }

                var item  = Hud.Sno.SnoItems.Unique_Bracer_106_x1;
                var tex   = Hud.Texture.GetItemTexture(item);
                var bgTex = Hud.Texture.GetTexture(3166997520);

                var portrait = player.PortraitUiElement.Rectangle;
                var width    = portrait.Left * 1.2f;
                var rect     = new RectangleF(0, portrait.Top, width, width * 2);

                bgBrush.DrawRectangle(rect);
                bgTex.Draw(rect.Left, rect.Top, rect.Width, rect.Height);
                tex.Draw(rect.Left, rect.Top, rect.Width, rect.Height);
            }
        }
コード例 #23
0
ファイル: ClipTool.cs プロジェクト: silky/sledge
 public ClipTool()
 {
     Usage = ToolUsage.Both;
     _clipPlanePoint1 = _clipPlanePoint2 = _clipPlanePoint3 = _drawingPoint = null;
     _state = _prevState = ClipState.None;
     _side = ClipSide.Both;
 }
コード例 #24
0
ファイル: PartyInspector.cs プロジェクト: prrovoss/THUD
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (Show)
            {
                var x = Hud.Window.Size.Width * XOffset;
                currY = Hud.Window.Size.Width * YOffset;
                gap   = Hud.Window.Size.Width * GapRatio;

                foreach (IPlayer player in Hud.Game.Players)
                {
                    currentX = x;

                    foreach (int element in ElementOrder)
                    {
                        switch (element)
                        {
                        case 0:
                            if (DrawKanai)
                            {
                                DrawKanaiItems(player);
                            }
                            break;

                        case 1:
                            if (DrawGems)
                            {
                                DrawLegendaryGems(player);
                            }
                            break;

                        case 2:
                            if (DrawSkills)
                            {
                                DrawPlayerSkills(player);
                            }
                            break;

                        case 3:
                            if (DrawLegendaryItems)
                            {
                                DrawBuffs(player);
                            }
                            break;

                        case 4:
                            if (DrawMetaInformations)
                            {
                                DrawMeta(player);
                            }
                            break;
                        }
                    }
                }
            }
        }
コード例 #25
0
 public void PaintTopInGame(ClipState clipState)
 {
     if (Hud.Render.UiHidden)
     {
         return;
     }
     if (clipState != ClipState.BeforeClip)
     {
         return;
     }
     if (OnHealthBarEnabled)
     {
         foreach (var player in Hud.Game.Players)
         {
             var pct = Hud.Game.Me.Defense.CurShield / Hud.Game.Me.Defense.HealthMax;
             if (pct > 1)
             {
                 pct = 1;
             }
             var portrait = player.PortraitUiElement.Rectangle;
             var w_max    = portrait.Width * 0.67f;
             var w_cur    = portrait.Width * 0.67f * pct;
             var h        = portrait.Height * 0.05f;
             var x        = portrait.Left + portrait.Width * 0.16f;
             var y        = portrait.Top + portrait.Height * 0.725f;
             PlayerShieldMaxDecorator.HintFunc = () => "生命值:" + Hud.Game.Me.Defense.HealthCur.ToString("#,0", CultureInfo.InvariantCulture) + " / " + Hud.Game.Me.Defense.HealthMax.ToString("#,0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Defense.HealthPct.ToString("#,0", CultureInfo.InvariantCulture) + "%" + ")" + "\n" + "护盾值:" + Hud.Game.Me.Defense.CurShield.ToString("#,0", CultureInfo.InvariantCulture);
             PlayerShieldMaxDecorator.Paint(x, y, w_max, h, HorizontalAlign.Center);
             if (pct == 0)
             {
                 continue;
             }
             PlayerShieldCurDecorator.HintFunc = () => "护盾值:" + Hud.Game.Me.Defense.CurShield.ToString("#,0", CultureInfo.InvariantCulture);
             PlayerShieldCurDecorator.Paint(x, y, w_cur, h, HorizontalAlign.Center);
         }
     }
     if (OnHealthBallEnabled)
     {
         var pct = Hud.Game.Me.Defense.CurShield / Hud.Game.Me.Defense.HealthMax;
         if (pct > 1)
         {
             pct = 1;
         }
         if (pct == 0)
         {
             return;
         }
         var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_progressBar_healthBall").Rectangle;
         var w      = uiRect.Width * 0.05f;
         var h_max  = uiRect.Height;
         var h_cur  = uiRect.Height * pct;
         var x      = uiRect.Left + uiRect.Width / 2;
         var y_max  = uiRect.Top;
         var y_cur  = uiRect.Top + uiRect.Height * (1 - pct);
         MeShieldMaxDecorator.HintFunc = () => "护盾值:" + Hud.Game.Me.Defense.CurShield.ToString("#,0", CultureInfo.InvariantCulture);
         MeShieldCurDecorator.HintFunc = () => "护盾值:" + Hud.Game.Me.Defense.CurShield.ToString("#,0", CultureInfo.InvariantCulture);
         MeShieldMaxDecorator.Paint(x + w * 0, y_max, w, h_max, HorizontalAlign.Center);
         MeShieldCurDecorator.Paint(x + w * 0, y_cur, w, h_cur, HorizontalAlign.Center);
     }
 }
コード例 #26
0
 public void SetClipState(ClipState state)
 {
     if (state == ClipState.IS_PLAYING)
     {
         m_owner.SetPlayingClip(this);
     }
     m_clipState = state;
 }
コード例 #27
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.AfterClip)
            {
                return;
            }
            var items = Hud.Game.Items.Where(item => item.Location == ItemLocation.Floor && !OnlyUnidentified && item.IsLegendary || item.Location == ItemLocation.Floor && OnlyUnidentified && item.Unidentified && item.IsLegendary);
            int Total = items.Count();

            if (Total == 0)
            {
                return;
            }
            int Normal  = 0;
            int Ancient = 0;
            int Primal  = 0;

            foreach (var item in items)
            {
                if (item.AncientRank == 0)
                {
                    Normal++;
                }
                if (item.AncientRank == 1)
                {
                    Ancient++;
                }
                if (item.AncientRank == 2)
                {
                    Primal++;
                }
            }
            var TotaltextLayout   = "地面传奇物品统计\n总数:" + Total;
            var NormaltextLayout  = "普通:" + Normal;
            var AncienttextLayout = "远古:" + Ancient;
            var PrimaltextLayout  = "太古:" + Primal;
            var x = Hud.Window.Size.Width / 1.18f;
            var y = Hud.Window.Size.Height / 1.15f;
            var h = Hud.Window.Size.Height * 0.018f;

            TotaltextFont.DrawText(TotaltextLayout, x, y);
            y = y + h;
            if (Normal != 0)
            {
                y = y + h;
                NormaltextFont.DrawText(NormaltextLayout, x, y);
            }
            if (Ancient != 0)
            {
                y = y + h;
                AncienttextFont.DrawText(AncienttextLayout, x, y);
            }
            if (Primal != 0)
            {
                y = y + h;
                PrimaltextFont.DrawText(PrimaltextLayout, x, y);
            }
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.AfterClip)
            {
                return;
            }

            var item = Hud.Inventory.HoveredItem;

            if (item == null)
            {
                return;
            }
            if (!item.IsLegendary)
            {
                return;
            }
            if (!item.SnoItem.HasGroupCode("weapons"))
            {
                return;
            }

            var baseMin = item.StatList.WeaponDamageBaseMin();
            var baseMax = item.StatList.WeaponDamageBaseMax();
            var weaponDamageDefinition = weaponInfo.Weapons.FirstOrDefault(w => w.BaseMin == baseMin && w.BaseMax == baseMax);

            if (weaponDamageDefinition == null)
            {
                return;
            }

            var bonusMinMax = item.AncientRank > 0 ? weaponDamageDefinition.BonusAncientMinMax : weaponDamageDefinition.BonusMinMax;
            var bonusMaxMax = item.AncientRank > 0 ? weaponDamageDefinition.BonusAncientMaxMax : weaponDamageDefinition.BonusMaxMax;

            var baseAps          = weaponDamageDefinition.Aps;
            var bonusMin         = item.StatList.WeaponDamageBonusMin();
            var bonusMax         = item.StatList.WeaponDamageBonusMax();
            var bonusDamage      = 1 + item.StatList.WeaponDamageBonusDamagePercent();
            var bonusAttackSpeed = 1 + item.StatList.WeaponDamageBonusAttackSpeedPercent();

            var userBase = (baseMin + bonusMin + baseMax + bonusMax) / 2f;
            var userRollBaseDamageRange    = (baseMin + bonusMinMax + baseMax + bonusMaxMax) / 2f * baseAps * bonusDamage * bonusAttackSpeed;
            var userRollDamagePercent      = userBase * baseAps * 1.1 * bonusAttackSpeed;
            var userRollAttackSpeedPercent = userBase * baseAps * bonusDamage * 1.07;
            var userPerfect = (baseMin + bonusMinMax + baseMax + bonusMaxMax) / 2f * baseAps * 1.1 * 1.07;

            var uicMain = Hud.Inventory.GetHoveredItemMainUiElement();
            var uicTop  = Hud.Inventory.GetHoveredItemTopUiElement();

            var x = uicMain.Rectangle.X + uicMain.Rectangle.Width * 0.69f;
            var y = uicTop.Rectangle.Bottom + (75f / 1200.0f * Hud.Window.Size.Height);

            y += DrawTextLine(item, x, y, RerollLabel, DpsLabel, true);
            y += DrawTextLine(item, x, y, RangeLabel, userRollBaseDamageRange.ToString(DpsFormat), WeaponDamageInfo.BaseDamageRangeAffixIds.Contains(item.EnchantedAffixNew));
            y += DrawTextLine(item, x, y, DamagePercentLabel, userRollDamagePercent.ToString(DpsFormat), item.EnchantedAffixNew == WeaponDamageInfo.DamageBonusPercentId, bonusDamage == 1.1f);
            y += DrawTextLine(item, x, y, AttackSpeedLabel, userRollAttackSpeedPercent.ToString(DpsFormat), item.EnchantedAffixNew == WeaponDamageInfo.AttackSpeedBonusPercentId, bonusAttackSpeed == 1.07f);
            y += DrawTextLine(item, x, y, PerfectLabel, userPerfect.ToString(DpsFormat), false);
        }
コード例 #29
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            LabelList.Paint();
        }
コード例 #30
0
ファイル: StashPreviewPlugin.cs プロジェクト: kamios/THConfig
        public override void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }

            if (clipState != ClipState.Inventory)
            {
                return;
            }

            var uiElement = Hud.Inventory.StashMainUiElement;

            if (!uiElement.Visible)
            {
                return;
            }

            var selectedPage = Hud.Inventory.SelectedStashPageIndex;
            var hoveredTab   = Hud.Inventory.HoveredStashTabIndex;

            if (hoveredTab == -1)
            {
                return;
            }

            hoveredTab += selectedPage * Hud.Inventory.MaxStashTabCountPerPage;

            var offsetX = uiElement.Rectangle.Left + uiElement.Rectangle.Width * 0.95f;
            var offsetY = 0.0f;

            var slotTexture = Hud.Texture.InventorySlotTexture;

            for (int row = 0; row < 10; row++)
            {
                for (int col = 0; col < 7; col++)
                {
                    var rect = Hud.Inventory.GetRectInStash(col, row, 1, 1);
                    slotTexture.Draw(rect.X + offsetX, rect.Y + offsetY, rect.Width, rect.Height);
                }
            }

            foreach (var item in Hud.Inventory.GetItemsInStash())
            {
                var tabIndex = item.InventoryY / 10;
                if (tabIndex != hoveredTab)
                {
                    continue;
                }

                var rect = Hud.Inventory.GetItemRect(item);
                rect.Offset(offsetX, offsetY);

                ItemRenderer.RenderItem(item, rect);
            }
        }
コード例 #31
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            CheckSize();
        }
コード例 #32
0
ファイル: ClipTool.cs プロジェクト: ChristopherHaws/sledge
 public override void KeyPress(ViewportBase viewport, ViewportEvent e)
 {
     if (e.KeyChar == 13) // Enter
     {
         if (!_clipPlanePoint1.EquivalentTo(_clipPlanePoint2)
             && !_clipPlanePoint2.EquivalentTo(_clipPlanePoint3)
             && !_clipPlanePoint1.EquivalentTo(_clipPlanePoint3)) // Don't clip if the points are too close together
         {
             PerformClip();
         }
     }
     if (e.KeyChar == 27 || e.KeyChar == 13) // Escape cancels, Enter commits and resets
     {
         _clipPlanePoint1 = _clipPlanePoint2 = _clipPlanePoint3 = _drawingPoint = null;
         _state = _prevState = ClipState.None;
     }
 }
コード例 #33
0
ファイル: ClipTool.cs プロジェクト: ChristopherHaws/sledge
        public override void MouseUp(ViewportBase vp, ViewportEvent e)
        {
            if (!(vp is Viewport2D)) return;
            var viewport = (Viewport2D)vp;

            var point = SnapIfNeeded(viewport.Expand(viewport.ScreenToWorld(e.X, viewport.Height - e.Y)));
            if (_state == ClipState.Drawing)
            {
                // Do nothing
                _state = _prevState;
            }
            else
            {
                _state = ClipState.Drawn;
            }

            Editor.Instance.CaptureAltPresses = false;
        }
コード例 #34
0
ファイル: ClipTool.cs プロジェクト: ChristopherHaws/sledge
        public override void MouseMove(ViewportBase vp, ViewportEvent e)
        {
            if (!(vp is Viewport2D)) return;
            var viewport = (Viewport2D)vp;

            var point = SnapIfNeeded(viewport.Expand(viewport.ScreenToWorld(e.X, viewport.Height - e.Y)));
            var st = GetStateAtPoint(e.X, viewport.Height - e.Y, viewport);
            if (_state == ClipState.Drawing)
            {
                _state = ClipState.MovingPoint2;
                _clipPlanePoint1 = _drawingPoint;
                _clipPlanePoint2 = point;
                _clipPlanePoint3 = _clipPlanePoint1 + SnapIfNeeded(viewport.GetUnusedCoordinate(new Coordinate(128, 128, 128)));
            }
            else if (_state == ClipState.MovingPoint1)
            {
                // Move point 1
                _clipPlanePoint1 = viewport.GetUnusedCoordinate(_clipPlanePoint1) + point;
            }
            else if (_state == ClipState.MovingPoint2)
            {
                // Move point 2
                _clipPlanePoint2 = viewport.GetUnusedCoordinate(_clipPlanePoint2) + point;
            }
            else if (_state == ClipState.MovingPoint3)
            {
                // Move point 3
                _clipPlanePoint3 = viewport.GetUnusedCoordinate(_clipPlanePoint3) + point;
            }

            Editor.Instance.CaptureAltPresses = _state != ClipState.None && _state != ClipState.Drawn;

            if (st != ClipState.None || (_state != ClipState.None && _state != ClipState.Drawn))
            {
                viewport.Cursor = Cursors.Cross;
            }
            else
            {
                viewport.Cursor = Cursors.Default;
            }
        }
コード例 #35
0
ファイル: ClipTool.cs プロジェクト: ChristopherHaws/sledge
        public override void MouseDown(ViewportBase vp, ViewportEvent e)
        {
            if (!(vp is Viewport2D)) return;
            var viewport = (Viewport2D) vp;
            _prevState = _state;

            var point = SnapIfNeeded(viewport.Expand(viewport.ScreenToWorld(e.X, viewport.Height - e.Y)));
            var st = GetStateAtPoint(e.X, viewport.Height - e.Y, viewport);
            if (_state == ClipState.None || st == ClipState.None)
            {
                _state = ClipState.Drawing;
                _drawingPoint = point;
            }
            else if (_state == ClipState.Drawn)
            {
                _state = st;
            }
        }
コード例 #36
0
        /// <summary>
        /// Pushes a clipping rectangle onto the render state stack.
        /// </summary>
        /// <param name="clipRectangle">The clipping region to push onto the render state stack.</param>
        public void PushClipRectangle(RectangleD clipRectangle)
        {
            Contract.EnsureRange(clipRectangle.Width >= 0 && clipRectangle.Height >= 0, "clipRectangle");

            var cumulativeClipRectangle = clipRectangle;

            var currentClipRectangle = ClipRectangle;
            if (currentClipRectangle != null)
            {
                cumulativeClipRectangle = RectangleD.Intersect(currentClipRectangle.Value, clipRectangle);
            }

            var state = new ClipState(clipRectangle, cumulativeClipRectangle);
            clipStack.Push(state);

            ApplyClipRectangleToDevice();
        }