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)); }
//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(); }
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; }
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)); }
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)); }
/// <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"); } }
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 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)); }