コード例 #1
0
ファイル: GEditorScroller.cs プロジェクト: uotools/PlayUO
        protected internal override unsafe void Draw(int X, int Y)
        {
            if (this.m_ScrollTexture == null)
            {
                this.m_ScrollTexture = new Texture(0x10, 0x10, true);
                LockData data = this.m_ScrollTexture.Lock(LockFlags.WriteOnly);
                ushort   num  = Engine.C32216(GumpColors.ControlLightLight);
                ushort   num2 = Engine.C32216(GumpColors.ScrollBar);
                for (int i = 0; i < 0x10; i++)
                {
                    ushort *numPtr = (ushort *)(data.pvSrc + (i * data.Pitch));
                    for (int j = 0; j < 0x10; j++)
                    {
                        if ((((i & 1) + j) & 1) == 0)
                        {
                            numPtr++;
                            numPtr[0] = num;
                        }
                        else
                        {
                            numPtr++;
                            numPtr[0] = num2;
                        }
                    }
                }
                this.m_ScrollTexture.Unlock();
            }
            this.m_ScrollTexture.Draw(X, Y, this.Width, this.Height);
            int barHeight = this.GetBarHeight();
            int num6      = Y + 0x10;
            int num7      = this.Height - 0x20;
            int position  = base.GetPosition(num7 - barHeight);

            Renderer.SetTexture(null);
            if (this.m_State == State.LargeScrollUp)
            {
                if (position > 0)
                {
                    Renderer.SetAlphaEnable(true);
                    Renderer.SetAlpha(0.9f);
                    Renderer.SolidRect(GumpColors.ControlDarkDark, X, Y + this.Width, this.Width, position);
                    Renderer.SetAlphaEnable(false);
                    int num9 = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)).Y - 0x10;
                    if (position > num9)
                    {
                        base.Value -= base.LargeOffset;
                    }
                    else
                    {
                        this.m_State = State.Inactive;
                    }
                }
            }
            else if ((this.m_State == State.LargeScrollDown) && (((num7 - position) - barHeight) > 0))
            {
                Renderer.SetAlphaEnable(true);
                Renderer.SetAlpha(0.9f);
                Renderer.SolidRect(GumpColors.ControlDarkDark, X, (num6 + position) + barHeight, this.Width, (num7 - position) - barHeight);
                Renderer.SetAlphaEnable(false);
                int num10 = base.PointToClient(new Point(Engine.m_xMouse, Engine.m_yMouse)).Y - 0x10;
                if ((position + barHeight) < num10)
                {
                    base.Value += base.LargeOffset;
                }
                else
                {
                    this.m_State = State.Inactive;
                }
            }
            GumpPaint.DrawRaised3D(X, num6 + position, 0x10, barHeight);
            if (this.m_State == State.SmallScrollUp)
            {
                GumpPaint.DrawFlat(X, Y, this.Width, this.Width);
                Renderer.SetAlphaEnable(true);
                Renderer.SetAlpha(1f);
                Engine.m_WinScrolls[0].Draw(X + 5, Y + 7, GumpColors.ControlText);
                Renderer.SetAlphaEnable(false);
                base.Value -= base.SmallOffset;
            }
            else
            {
                GumpPaint.DrawRaised3D(X, Y, this.Width, this.Width);
                Renderer.SetAlphaEnable(true);
                Renderer.SetAlpha(1f);
                Engine.m_WinScrolls[0].Draw(X + 4, Y + 6, GumpColors.ControlText);
                Renderer.SetAlphaEnable(false);
            }
            Renderer.SetTexture(null);
            if (this.m_State == State.SmallScrollDown)
            {
                GumpPaint.DrawFlat(X, (Y + this.Height) - this.Width, this.Width, this.Width);
                Renderer.SetAlphaEnable(true);
                Renderer.SetAlpha(1f);
                Engine.m_WinScrolls[1].Draw(X + 5, ((Y + this.Height) - this.Width) + 7, GumpColors.ControlText);
                Renderer.SetAlphaEnable(false);
                base.Value += base.SmallOffset;
            }
            else
            {
                GumpPaint.DrawRaised3D(X, (Y + this.Height) - this.Width, this.Width, this.Width);
                Renderer.SetAlphaEnable(true);
                Renderer.SetAlpha(1f);
                Engine.m_WinScrolls[1].Draw(X + 4, ((Y + this.Height) - this.Width) + 6, GumpColors.ControlText);
                Renderer.SetAlphaEnable(false);
            }
        }