Exemple #1
0
 public void AddImageTiledButton(int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type,
                                 int itemID, int hue, int width, int height, GumpResponse callback,
                                 int param = 0, int localizedTooltip = -1, string name = "")
 {
     this.Add(new GumpImageTileButton(x, y, normalID, pressedID, this.NewID(), type, param, itemID, hue, width,
                                      height, callback, localizedTooltip, name));
 }
Exemple #2
0
 public void AddImageTiledButton(int x, int y, int normalID, int pressedID, int buttonID, GumpButtonType type,
                                    int itemID, int hue, int width, int height, GumpResponse callback,
                                    int param = 0, int localizedTooltip = -1, string name = "")
 {
     this.Add(new GumpImageTileButton(x, y, normalID, pressedID, this.NewID(), type, param, itemID, hue, width,
                                      height, callback, localizedTooltip, name));
 }
Exemple #3
0
        //AutoDoc concatenates description coming from Overloaded methods
        /// <summary>
        /// This method can also be used only Switches, without Text fileds.
        /// </summary>
        public static void SendAdvancedAction(uint gumpid, int buttonid, List <int> switchs)
        {
            GumpTextEntry[] entries = new GumpTextEntry[0];

            if (gumpid == 0)
            {
                Assistant.Client.Instance.SendToClientWait(new CloseGump(World.Player.CurrentGumpI));
                Assistant.Client.Instance.SendToServerWait(new GumpResponse(World.Player.CurrentGumpS, World.Player.CurrentGumpI, buttonid, switchs.ToArray(), entries));
            }
            else
            {
                Assistant.Client.Instance.SendToClientWait(new CloseGump(gumpid));
                GumpResponse gumpResp = new GumpResponse(World.Player.CurrentGumpS, gumpid, buttonid, switchs.ToArray(), entries);
                if (m_gumpData.ContainsKey(gumpid))
                {
                    PacketReader           p    = new PacketReader(gumpResp.ToArray(), false);
                    PacketHandlerEventArgs args = new PacketHandlerEventArgs();
                    p.ReadByte();  // through away the packet id
                    p.ReadInt16(); // throw away the packet length
                    Assistant.PacketHandlers.ClientGumpResponse(p, args);
                }
                else
                {
                    Assistant.Client.Instance.SendToServerWait(gumpResp);
                }
            }

            World.Player.HasGump = false;
            World.Player.CurrentGumpStrings.Clear();
            World.Player.CurrentGumpTile.Clear();
        }
Exemple #4
0
 public ElementProperty(string display, GumpResponse callback, string text, InputType elementInputType, bool isChecked = false, UpdateString bookTextCallback = null)
 {
     Display          = display;
     Callback         = callback;
     Text             = text;
     ElementInputType = elementInputType;
     Checked          = isChecked;
     BookCallback     = bookTextCallback;
 }
Exemple #5
0
 public void AddButton(
     int x,
     int y,
     int normalID,
     int pressedID,
     GumpButtonType type,
     GumpResponse callback,
     int param   = 0,
     string name = "")
 {
     Add(new GumpButton(x, y, normalID, pressedID, NewID(), type, param, callback, name));
 }
Exemple #6
0
		public void AddButton(
			int x,
			int y,
			int normalID,
			int pressedID,
			GumpButtonType type,
			GumpResponse callback,
			int param = 0,
			string name = "")
		{
			Add(new GumpButton(x, y, normalID, pressedID, NewID(), type, param, callback, name));
		}
Exemple #7
0
 public void AddButton(
     int x,
     int y,
     int normalID,
     int pressedID,
     int buttonID,
     GumpButtonType type,
     int param,
     GumpResponse callback,
     string name = "")
 {
     Add(new GumpButton(x, y, normalID, pressedID, buttonID, type, param, callback));
 }
Exemple #8
0
		public void AddButton(
			int x,
			int y,
			int normalID,
			int pressedID,
			int buttonID,
			GumpButtonType type,
			int param,
			GumpResponse callback,
			string name = "")
		{
			Add(new GumpButton(x, y, normalID, pressedID, buttonID, type, param, callback));
		}
Exemple #9
0
        /// <summary>
        /// Send a Gump response, with gumpid and buttonid and advanced switch in gumps.
        /// This function is intended for more complex Gumps, with not only Buttons, but also Switches, CheckBoxes and Text fileds.
        /// </summary>
        /// <param name="gumpid">ID of the gump.</param>
        /// <param name="buttonid">ID of the Button.</param>
        /// <param name="switchlist_id">List of ID of ON/Active switches. (empty: all Switches OFF)</param>
        /// <param name="textlist_id">List of ID of Text fileds. (empty: all text fileds empty )</param>
        /// <param name="textlist_str">List of the contents of the Text fields, provided in the same order as textlist_id.</param>
        public static void SendAdvancedAction(uint gumpid, int buttonid, List <int> switchlist_id, List <int> textlist_id, List <string> textlist_str)
        {
            if (textlist_id.Count == textlist_str.Count)
            {
                int             i       = 0;
                GumpTextEntry[] entries = new GumpTextEntry[textlist_id.Count];

                foreach (int entry in textlist_id)
                {
                    GumpTextEntry entrie = new GumpTextEntry(0, string.Empty)
                    {
                        EntryID = (ushort)entry,
                        Text    = textlist_str[i]
                    };
                    entries[i] = entrie;
                    i++;
                }

                if (gumpid == 0)
                {
                    Assistant.Client.Instance.SendToClientWait(new CloseGump(World.Player.CurrentGumpI));
                    Assistant.Client.Instance.SendToServerWait(new GumpResponse(World.Player.CurrentGumpS, World.Player.CurrentGumpI, buttonid, switchlist_id.ToArray(), entries));
                }
                else
                {
                    Assistant.Client.Instance.SendToClientWait(new CloseGump(gumpid));
                    GumpResponse gumpResp = new GumpResponse(World.Player.CurrentGumpS, gumpid, buttonid, switchlist_id.ToArray(), entries);
                    if (m_gumpData.ContainsKey(gumpid))
                    {
                        PacketReader           p    = new PacketReader(gumpResp.ToArray(), false);
                        PacketHandlerEventArgs args = new PacketHandlerEventArgs();
                        p.ReadByte();  // through away the packet id
                        p.ReadInt16(); // throw away the packet length
                        Assistant.PacketHandlers.ClientGumpResponse(p, args);
                    }
                    else
                    {
                        Assistant.Client.Instance.SendToServerWait(gumpResp);
                    }
                }

                World.Player.HasGump = false;
                World.Player.CurrentGumpStrings.Clear();
            }
            else
            {
                Scripts.SendMessageScriptError("Script Error: SendAdvancedAction: entryID and entryS lenght not match");
            }
        }
Exemple #10
0
		public void AddCheck(
			int x, int y, int inactiveID, int activeID, bool initialState, GumpResponse callback, string name = "")
		{
			Add(new GumpCheck(x, y, inactiveID, activeID, initialState, NewID(), callback, name));
		}
Exemple #11
0
 public void AddCheck(
     int x, int y, int inactiveID, int activeID, bool initialState, GumpResponse callback, string name = "")
 {
     Add(new GumpCheck(x, y, inactiveID, activeID, initialState, NewID(), callback, name));
 }
 public ElementProperty(string display, GumpResponse callback, string text, InputType elementInputType, bool isChecked = false, UpdateString bookTextCallback = null)
 {
     Display = display;
     Callback = callback;
     Text = text;
     ElementInputType = elementInputType;
     Checked = isChecked;
     BookCallback = bookTextCallback;
 }
Exemple #13
0
 public void AddCheck(int x, int y, int inactiveID, int activeID, bool initialState, int switchID,
                      GumpResponse callback, string name = "")
 {
     this.Add(new GumpCheck(x, y, inactiveID, activeID, initialState, switchID, callback, name));
 }