コード例 #1
0
ファイル: GRadar.cs プロジェクト: NaphalAXT/WarUOSallos
        private static void DrawDot(bool onScreen, int color, int xLoc, int yLoc, int x, int y, int width, int height, int xCenter, int yCenter, double xScale, double yScale, int xDotCenter, int yDotCenter, out int xDot, out int yDot)
        {
            if (!GRadar.GetDotPoint(true, xLoc, yLoc, width, height, xCenter, yCenter, xScale, yScale, xDotCenter, yDotCenter, out xDot, out yDot) && onScreen)
            {
                return;
            }
            int X = xDot + x;
            int Y = yDot + y;

            Renderer.SetTexture((Texture)null);
            Renderer.SolidRect(color, X, Y, 1, 1);
            Renderer.PushAlpha(0.5f);
            Renderer.SolidRect(color, X - 1, Y, 1, 1);
            Renderer.SolidRect(color, X + 1, Y, 1, 1);
            Renderer.SolidRect(color, X, Y - 1, 1, 1);
            Renderer.SolidRect(color, X, Y + 1, 1, 1);
            Renderer.SetAlpha(0.25f);
            Renderer.SolidRect(color, X - 2, Y, 1, 1);
            Renderer.SolidRect(color, X + 2, Y, 1, 1);
            Renderer.SolidRect(color, X, Y - 2, 1, 1);
            Renderer.SolidRect(color, X, Y + 2, 1, 1);
            Renderer.SetAlpha(0.15f);
            Renderer.SolidRect(color, X - 1, Y - 1, 1, 1);
            Renderer.SolidRect(color, X + 1, Y - 1, 1, 1);
            Renderer.SolidRect(color, X - 1, Y + 1, 1, 1);
            Renderer.SolidRect(color, X + 1, Y + 1, 1, 1);
            Renderer.PopAlpha();
            if (!onScreen)
            {
                return;
            }
            Texture travelIcon = Engine.ImageCache.TravelIcon;

            travelIcon.DrawClipped(X - travelIcon.Width / 2 - 1, Y - travelIcon.Height / 2 - 1, Clipper.TemporaryInstance(x, y, width, height));
        }
コード例 #2
0
ファイル: GRadar.cs プロジェクト: NaphalAXT/WarUOSallos
        protected internal override void OnDoubleClick(int X, int Y)
        {
            Mobile mobile = GRadar.m_FocusMob == null ? World.Player : GRadar.m_FocusMob;

            if (mobile == null)
            {
                return;
            }
            int    xCenter    = mobile.Visible || mobile.Player ? mobile.X : mobile.m_KUOC_X;
            int    yCenter    = mobile.Visible || mobile.Player ? mobile.Y : mobile.m_KUOC_Y;
            int    width      = this.m_Width - 4;
            int    height     = this.m_Height - 4;
            int    xDotCenter = (width >> 1) - 1;
            int    yDotCenter = (int)((double)((GRadar.m_Image.Height >> 1) - 16) / (double)GRadar.m_Image.Height * (double)height);
            double xScale     = (double)width / 256.0;
            double yScale     = (double)height / 256.0;

            if (Engine.GMPrivs)
            {
                int num1 = (int)((double)(X - xDotCenter) / xScale / 2.0);
                int num2 = (int)((double)(Y - yDotCenter) / yScale / 2.0);
                Engine.commandEntered(string.Format("[go {0} {1}", (object)(xCenter + (num2 + num1)), (object)(yCenter + (num2 - num1))));
            }
            else
            {
                TravelAgent  travelAgent = Player.Current.TravelAgent;
                RuneInfo     rune1       = (RuneInfo)null;
                RunebookInfo book        = (RunebookInfo)null;
                int          num1        = 0;
                foreach (RunebookInfo runebook in travelAgent.Runebooks)
                {
                    if (runebook.IsValid)
                    {
                        foreach (RuneInfo rune2 in runebook.Runes)
                        {
                            int xDot;
                            int yDot;
                            GRadar.GetDotPoint(false, rune2.Point.X, rune2.Point.Y, width, height, xCenter, yCenter, xScale, yScale, xDotCenter, yDotCenter, out xDot, out yDot);
                            xDot -= X;
                            yDot -= Y;
                            xDot += 2;
                            yDot += 2;
                            int num2 = Math.Max(Math.Abs(xDot), Math.Abs(yDot));
                            if (rune1 == null || num2 < num1)
                            {
                                rune1 = rune2;
                                book  = runebook;
                                num1  = num2;
                            }
                        }
                    }
                }
                if (rune1 == null)
                {
                    return;
                }
                Mobile player = World.Player;
                bool   flag   = Control.ModifierKeys == (Keys.Shift | Keys.Control);
                new TravelContext(book, rune1, !flag).Enqueue();
            }
        }