コード例 #1
0
ファイル: GWindowsForm.cs プロジェクト: NaphalAXT/WarUOSallos
 public GWindowsForm(int x, int y, int width, int height)
     : base(x, y)
 {
     this.m_CanDrag      = true;
     this.m_QuickDrag    = true;
     this.m_Width        = width;
     this.m_Height       = height;
     this.m_CaptionLabel = new GLabel("Form", (IFont)Engine.GetUniFont(1), Hues.Default, 7, 3);
     this.m_Children.Add((Gump)this.m_CaptionLabel);
     this.m_Client = (Gump) new GEmpty(0, 0, 0, 0);
     this.m_Children.Add(this.m_Client);
     this.m_CloseButton            = new GWindowsButton("", 0, 0, 16, 14);
     this.m_CloseButton.ImageColor = 0;
     this.m_CloseButton.Image      = Engine.m_FormX;
     this.m_CloseButton.Clicked   += new EventHandler(this.CloseButton_Clicked);
     this.m_Children.Add((Gump)this.m_CloseButton);
     this.ResizeClient();
 }
コード例 #2
0
ファイル: GContainer.cs プロジェクト: NaphalAXT/WarUOSallos
 public GContainer(Item container, int gumpID, IHue hue)
     : base(0.25f, 0.25f, 0.6f, gumpID, 50, 50, hue)
 {
     this.m_Item    = container;
     this.m_CanDrop = true;
     this.GetBounds(gumpID);
     this.m_NonRestrictivePicking = true;
     foreach (Item obj in container.Items)
     {
         if (this.m_GumpID != 9 || (obj.ID & 16383) < 8198 || (obj.ID & 16383) > 8272)
         {
             Gump ToAdd = (Gump) new GContainerItem(obj, this.m_Item);
             this.m_Hash[(object)obj] = (object)ToAdd;
             ToAdd.m_CanDrag          = !this.m_TradeContainer;
             this.m_Children.Add(ToAdd);
         }
     }
 }
コード例 #3
0
 public virtual Gump FindChild(Predicate <Gump> predicate)
 {
     if (predicate(this))
     {
         return(this);
     }
     if (this.m_Children != null)
     {
         foreach (Gump mChild in this.m_Children)
         {
             Gump child = mChild.FindChild(predicate);
             if (child != null)
             {
                 return(child);
             }
         }
     }
     return((Gump)null);
 }
コード例 #4
0
        private static void ChangeCircle_OnClick(Gump sender)
        {
            Gump   parent    = sender.Parent;
            Item   container = (Item)parent.GetTag("Container");
            object tag       = sender.GetTag("Circle");

            if (container == null)
            {
                return;
            }
            int circle = tag == null ? 0 : (int)tag;
            int x      = parent.X;
            int y      = parent.Y;

            Gumps.Destroy(parent);
            Gump ToAdd = Spells.OpenSpellbook(circle, container.LastSpell, container);

            ToAdd.X = x;
            ToAdd.Y = y;
            Gumps.Desktop.Children.Add(ToAdd);
        }
コード例 #5
0
ファイル: GDragAmount.cs プロジェクト: NaphalAXT/WarUOSallos
 private void TextBox_OnTextChange(string text, Gump g)
 {
     try
     {
         int int32 = Convert.ToInt32(text);
         if (int32 < 0)
         {
             this.m_Slider.SetValue(0.0, true);
         }
         else if (int32 > this.m_Amount)
         {
             this.m_Slider.SetValue((double)this.m_Amount, true);
         }
         else
         {
             this.m_Slider.SetValue((double)int32, false);
         }
     }
     catch
     {
     }
 }
コード例 #6
0
        protected internal override void Draw(int x, int y)
        {
            Gump[] array = Gumps.Desktop.Children.ToArray();
            float  num   = 1f;

            for (int index = Array.IndexOf <Gump>(array, (Gump)this) + 1; index < array.Length; ++index)
            {
                Gump gump = array[index];
                if (gump is IMessage)
                {
                    IMessage message = (IMessage)gump;
                    if (message.Visible && message.ImageRect.IntersectsWith(this.m_ImageRect))
                    {
                        num += message.Alpha;
                    }
                }
            }
            float alpha = this.Alpha;

            this.Alpha = 1f / num * alpha;
            base.Draw(x, y);
            this.Alpha = alpha;
        }
コード例 #7
0
 protected internal virtual void OnFocusChanged(Gump Focused)
 {
 }
コード例 #8
0
 protected internal override void OnDragLeave(Gump g)
 {
     this._dragPreview = (Item)null;
 }
コード例 #9
0
ファイル: GumpList.cs プロジェクト: NaphalAXT/WarUOSallos
 public GumpList(Gump Owner)
 {
     this.m_List  = new ArrayList(0);
     this.m_Owner = Owner;
     this.m_Array = GumpList.m_Empty;
 }
コード例 #10
0
ファイル: GumpList.cs プロジェクト: NaphalAXT/WarUOSallos
 public int IndexOf(Gump Child)
 {
     return(this.m_List.IndexOf((object)Child));
 }
コード例 #11
0
 protected internal virtual void OnDragDrop(Gump g)
 {
 }
コード例 #12
0
 private void Shift_OnClick(Gump g)
 {
     this.m_Macro.Shift = !this.m_Macro.Shift;
     this.UpdateModifier(this.m_Shift, "Shift", this.m_Macro.Shift);
     this.NotifyParent();
 }
コード例 #13
0
ファイル: GDragAmount.cs プロジェクト: NaphalAXT/WarUOSallos
 private void Slider_OnValueChange(double v, double old, Gump g)
 {
     this.m_TextBox.String = ((int)v).ToString();
 }
コード例 #14
0
 private void All_OnClick(Gump g)
 {
     this.Mods ^= MacroModifiers.All;
 }
コード例 #15
0
ファイル: GServerGump.cs プロジェクト: NaphalAXT/WarUOSallos
 protected internal override void Render(int X, int Y)
 {
     if (this.m_AlphaRegions.Count == 0)
     {
         base.Render(X, Y);
     }
     else
     {
         if (!this.m_Visible)
         {
             return;
         }
         int X1 = X + this.X;
         int Y1 = Y + this.Y;
         this.Draw(X1, Y1);
         Gump[]        array          = this.m_Children.ToArray();
         RectangleList rectangleList1 = new RectangleList();
         RectangleList rectangleList2 = new RectangleList();
         int           num            = 0;
         for (int index1 = 0; index1 < array.Length; ++index1)
         {
             Gump gump1 = array[index1];
             if (gump1 is GTransparentRegion)
             {
                 ++num;
             }
             else if (num >= this.m_AlphaRegions.Count)
             {
                 gump1.Render(X1, Y1);
             }
             else
             {
                 RectangleList rectangleList3 = rectangleList1;
                 Rectangle     b     = new Rectangle(gump1.X, gump1.Y, gump1.Width, gump1.Height);
                 Rectangle     rect1 = b;
                 rectangleList3.Add(rect1);
                 for (int index2 = num; index2 < this.m_AlphaRegions.Count; ++index2)
                 {
                     Gump gump2 = (Gump)this.m_AlphaRegions[index2];
                     if (gump2 is GTransparentRegion)
                     {
                         Rectangle rect2 = Rectangle.Intersect(new Rectangle(gump2.X, gump2.Y, gump2.Width, gump2.Height), b);
                         rectangleList1.Remove(rect2);
                         rectangleList2.Add(rect2);
                     }
                 }
                 if (rectangleList2.Count > 0)
                 {
                     for (int index2 = index1 + 1; index2 < array.Length; ++index2)
                     {
                         Gump gump2 = array[index2];
                         if (gump2 is GServerBackground)
                         {
                             GServerBackground gserverBackground = (GServerBackground)gump2;
                             Rectangle         rect2             = new Rectangle(gserverBackground.X + gserverBackground.OffsetX, gserverBackground.Y + gserverBackground.OffsetY, gserverBackground.UseWidth, gserverBackground.UseHeight);
                             rectangleList1.Remove(rect2);
                             rectangleList2.Remove(rect2);
                         }
                         else if (gump2 == this.m_AlphaRegions[this.m_AlphaRegions.Count - 1])
                         {
                             break;
                         }
                     }
                     if (rectangleList2.Count == 1 && rectangleList1.Count == 0)
                     {
                         Renderer.PushAlpha(0.5f);
                         gump1.Render(X1, Y1);
                         Renderer.PopAlpha();
                     }
                     else
                     {
                         for (int index2 = 0; index2 < rectangleList1.Count; ++index2)
                         {
                             Rectangle rectangle = rectangleList1[index2];
                             if (Renderer.SetViewport(X1 + rectangle.X, Y1 + rectangle.Y, rectangle.Width, rectangle.Height))
                             {
                                 gump1.Render(X1, Y1);
                             }
                         }
                         for (int index2 = 0; index2 < rectangleList2.Count; ++index2)
                         {
                             Rectangle rectangle = rectangleList2[index2];
                             if (Renderer.SetViewport(X1 + rectangle.X, Y1 + rectangle.Y, rectangle.Width, rectangle.Height))
                             {
                                 Renderer.PushAlpha(0.5f);
                                 gump1.Render(X1, Y1);
                                 Renderer.PopAlpha();
                             }
                         }
                         if (rectangleList1.Count > 0 || rectangleList2.Count > 0)
                         {
                             Renderer.SetViewport(0, 0, Engine.ScreenWidth, Engine.ScreenHeight);
                         }
                     }
                     rectangleList1.Clear();
                     rectangleList2.Clear();
                 }
                 else
                 {
                     gump1.Render(X1, Y1);
                 }
             }
         }
     }
 }
コード例 #16
0
        public void Layout()
        {
            int num1 = 0;

            Gump[] array = this.m_Children.ToArray();
            for (int index = 0; index < array.Length; ++index)
            {
                if (array[index] is GMenuItem)
                {
                    ++num1;
                }
            }
            int num2;
            int num3;

            if (this.m_DropDown)
            {
                num2 = 0;
                num3 = this.Height - 1;
            }
            else
            {
                Gump desktop = Gumps.Desktop;
                num2 = 124;
                num3 = 0;
                if (desktop != null)
                {
                    Point screen = this.PointToScreen(new Point(0, 0));
                    int   y      = desktop.PointToClient(screen).Y;
                    int   num4   = (desktop.Height - y - 1) / 23;
                    if (num4 < 1)
                    {
                        num4 = 1;
                    }
                    if (num4 < num1)
                    {
                        num3 = this.Height - (num1 - num4 + 1) * 23 - 1;
                    }
                    if (y + num3 < 0)
                    {
                        num3 = -y;
                    }
                }
            }
            for (int index = 0; index < array.Length; ++index)
            {
                GMenuItem gmenuItem = array[index] as GMenuItem;
                if (gmenuItem != null)
                {
                    if (gmenuItem.X != num2)
                    {
                        gmenuItem.X = num2;
                    }
                    if (gmenuItem.Y != num3)
                    {
                        gmenuItem.Y = num3;
                    }
                    num3 += 23;
                }
            }
        }
コード例 #17
0
 private void Entry_OnClick(Gump Sender)
 {
     Network.Send((Packet) new PPopupResponse(this.m_Owner, (int)Sender.GetTag("EntryID")));
     Gumps.Destroy((Gump)this);
 }
コード例 #18
0
 protected internal virtual void OnDragLeave(Gump g)
 {
 }
コード例 #19
0
 protected internal virtual void OnDragEnter(Gump g)
 {
 }
コード例 #20
0
ファイル: GBackground.cs プロジェクト: NaphalAXT/WarUOSallos
 public void SetMouseOverride(Gump g)
 {
     this.m_Override  = g;
     this.m_QuickDrag = this.m_CanDrag = g != null && g.m_CanDrag && g.m_QuickDrag;
 }
コード例 #21
0
ファイル: GMouseRouter.cs プロジェクト: NaphalAXT/WarUOSallos
 public GMouseRouter(int GumpID, int X, int Y, Gump Target)
     : this(GumpID, Hues.Default, X, Y, Target)
 {
 }
コード例 #22
0
 private void KeyboardFlipper_OnClick(Gump g)
 {
     this.ShowKeyboard = !this.ShowKeyboard;
 }
コード例 #23
0
ファイル: GHyperLink.cs プロジェクト: NaphalAXT/WarUOSallos
 private void Button_OnClick(Gump g)
 {
     Engine.OpenBrowser(this.m_Url);
     GHyperLink.m_Visited[(object)this.m_Url] = (object)true;
     this.DefaultHue = this.FocusHue = GHyperLink.VisitedHue;
 }
コード例 #24
0
 private void Ctrl_OnClick(Gump g)
 {
     this.m_Macro.Control = !this.m_Macro.Control;
     this.UpdateModifier(this.m_Ctrl, "Ctrl", this.m_Macro.Control);
     this.NotifyParent();
 }
コード例 #25
0
 private void Alt_OnClick(Gump g)
 {
     this.m_Macro.Alt = !this.m_Macro.Alt;
     this.UpdateModifier(this.m_Alt, "Alt", this.m_Macro.Alt);
     this.NotifyParent();
 }
コード例 #26
0
ファイル: ClientFormat.cs プロジェクト: NaphalAXT/WarUOSallos
 public ClientFormat(string prepend, string prefix, string format, byte messageType, SpeechType speechType)
     : base(prepend, prefix, format, messageType, speechType)
 {
     this.Register("Disturb", new CommandCallback(this.Disturb_OnCommand));
     this.Register("LeaveHouse", new CommandCallback(this.LeaveHouse_OnCommand));
     this.Register("OpenRunebooks", new CommandCallback(this.OpenRunebooks));
     this.Register("Dress", (CommandCallback)(args => Engine.Dress()));
     this.Register("Recall", new CommandCallback(this.Recall_OnCommand));
     this.Register("Gate", new CommandCallback(this.Gate_OnCommand));
     this.Register("Target", new CommandCallback(this.Target_OnCommand));
     this.Register("Acquire", new CommandCallback(this.Acquire_OnCommand));
     this.Register("AlwaysRun", new CommandCallback(this.AlwaysRun_OnCommand));
     this.Register("SmoothWalk", new CommandCallback(this.SmoothWalk_OnCommand));
     this.Register("Footsteps", new CommandCallback(this.Footsteps_OnCommand));
     this.Register("Sound", new CommandCallback(this.Sound_OnCommand));
     this.Register("Music", new CommandCallback(this.Music_OnCommand));
     this.Register("QueueTargets", new CommandCallback(this.QueueTargets_OnCommand));
     this.Register("Remove", new CommandCallback(this.Remove_OnCommand));
     this.Register("UseGate", new CommandCallback(this.UseGate_OnCommand));
     this.Register("Friend", new CommandCallback(this.Friend_OnCommand));
     this.Register("Ignore", new CommandCallback(this.Ignore_OnCommand));
     this.Register("Scavenge", new CommandCallback(this.Scavenge_OnCommand));
     this.Register("RegDrop", new CommandCallback(this.RegDrop_OnCommand));
     this.Register("PotDrop", new CommandCallback(this.PotDrop_OnCommand));
     this.Register("DragToBag", new CommandCallback(this.DragToBag_OnCommand));
     this.Register("Move", new CommandCallback(this.Move_OnCommand));
     this.Register("Stack", new CommandCallback(this.Stack_OnCommand));
     this.Register("BringTo", new CommandCallback(this.BringTo_OnCommand));
     this.Register("TurnTo", new CommandCallback(this.TurnTo_OnCommand));
     this.Register("Disarm", new CommandCallback(this.Disarm_OnCommand));
     this.Register("Stun", new CommandCallback(this.Stun_OnCommand));
     this.Register("Noto", new CommandCallback(this.NotoQuery_OnCommand));
     this.Register("NotoQuery", new CommandCallback(this.NotoQuery_OnCommand));
     this.Register("HouseLevel", new CommandCallback(this.HouseLevel_OnCommand));
     this.Register("AutoPickup", new CommandCallback(this.AutoPickup_OnCommand));
     this.Register("Speed", new CommandCallback(this.Speed_OnCommand));
     this.Register("RunSpeed", new CommandCallback(this.RunSpeed_OnCommand));
     this.Register("WalkSpeed", new CommandCallback(this.WalkSpeed_OnCommand));
     this.Register("DropTarg", new CommandCallback(this.DropTarg_OnCommand));
     this.Register("CancelStealth", new CommandCallback(this.CancelStealth_OnCommand));
     this.Register("Give", new CommandCallback(this.Give_OnCommand));
     this.Register("FPS", new CommandCallback(this.FPS_OnCommand));
     this.Register("Restock", (CommandCallback)(args => Player.Current.RestockAgent.Invoke()));
     this.Register("Lootbag", (CommandCallback)(args =>
     {
         TargetManager.Client = (ClientTargetHandler) new SetRestockTargetTargetHandler(false);
         Engine.AddTextMessage("Target your lootbag.");
     }));
     this.Register("ClearMoves", (CommandCallback)(args =>
     {
         if (ActionContext.Queued.Count > 0)
         {
             ActionContext.Clear();
             Engine.AddTextMessage("Action queue cleared.");
         }
         else
         {
             Engine.AddTextMessage("Action queue is already empty.");
         }
     }));
     this.Register("Organize", (CommandCallback)(args => Player.Current.OrganizeAgent.Invoke()));
     this.Register("SetOrganize", (CommandCallback)(args =>
     {
         TargetManager.Client = (ClientTargetHandler) new SetOrganizeTemplateTargetHandler(false);
         Engine.AddTextMessage("Target your template lootbag.");
     }));
     this.Register("LeapFrog", (CommandCallback)(args =>
     {
         Gump drag = Gumps.Drag;
         if (drag is GDraggedItem)
         {
             Engine.m_LeapFrog = ((GDraggedItem)drag).Item;
             Engine.AddTextMessage("Leapfrog item set.");
         }
         else
         {
             Engine.m_LeapFrog = (Item)null;
             Engine.AddTextMessage("You are not holding an item. Leapfrog item cleared.");
         }
     }));
 }
コード例 #27
0
        public GSecureTrade(int serial, Gump container, string myName, string theirName)
            : base(50, 50, 281, 116)
        {
            this.m_Serial    = serial;
            this.m_Container = container;
            this.m_CanDrop   = true;
            this.FillAlpha   = 0.5f;
            this.FillColor   = 6324479;
            GBorder3D gborder3D1 = new GBorder3D(false, 0, 0, this.Width, this.Height);

            gborder3D1.FillAlpha     = 0.0f;
            gborder3D1.ShouldHitTest = false;
            this.m_Children.Add((Gump)gborder3D1);
            GBorder3D gborder3D2 = new GBorder3D(true, 6, 6, 132, 104);

            gborder3D2.FillAlpha     = 0.0f;
            gborder3D2.ShouldHitTest = false;
            this.m_Children.Add((Gump)gborder3D2);
            GBorder3D gborder3D3 = new GBorder3D(false, 7, 7, 130, 20);

            gborder3D3.ShouldHitTest = false;
            GLabel glabel1 = new GLabel(this.Truncate(myName, (IFont)Engine.GetUniFont(1), gborder3D3.Width - 28), (IFont)Engine.GetUniFont(1), Hues.Load(1), 0, 0);

            gborder3D3.Children.Add((Gump)glabel1);
            glabel1.Center();
            glabel1.X = 28 - glabel1.Image.xMin;
            this.m_Children.Add((Gump)gborder3D3);
            GBorder3D gborder3D4 = new GBorder3D(true, 143, 6, 132, 104);

            gborder3D4.FillAlpha     = 0.0f;
            gborder3D4.ShouldHitTest = false;
            this.m_Children.Add((Gump)gborder3D4);
            GBorder3D gborder3D5 = new GBorder3D(false, 144, 7, 130, 20);

            gborder3D5.ShouldHitTest = false;
            GLabel glabel2 = new GLabel(this.Truncate(theirName, (IFont)Engine.GetUniFont(1), gborder3D5.Width - 28), (IFont)Engine.GetUniFont(1), Hues.Load(1), 0, 0);

            gborder3D5.Children.Add((Gump)glabel2);
            glabel2.Center();
            glabel2.X = gborder3D5.Width - 28 - glabel2.Image.xMax;
            this.m_Children.Add((Gump)gborder3D5);
            this.m_Children.Add((Gump) new GAlphaBackground(1, 1, 5, 114)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(275, 1, 5, 114)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(6, 1, 269, 5)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(6, 110, 269, 5)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
            this.m_Children.Add((Gump) new GAlphaBackground(138, 6, 5, 104)
            {
                ShouldHitTest = false,
                BorderColor   = 12632256,
                FillColor     = 12632256,
                FillAlpha     = 1f
            });
        }