public static bool HandleChatCommand(ChatClickInterceptEventArgs e) { if (e.Text == mChatActionCommand) { QueuedAction action; if (mChatActions.TryGetValue(e.Id, out action)) { action(); } else { Util.Error("Invalid chat action ID. Only " + MaxChatActions + " chat actions can be active at once"); } return(true); } return(false); }
public static void HandleChatCommand(object sender, ChatClickInterceptEventArgs e) { try { if (e.Text == ChatActionCommand) { e.Eat = true; QueuedAction action; if (mChatActions.TryGetValue(e.Id, out action)) { action(); } else { Error("Invalid chat action ID. Only " + MaxChatActions + " chat actions can be active at once"); } } else if (e.Id == ChatLinkId) { if (e.Text == mOpenErrorsTxtCommand) { e.Eat = true; if (!File.Exists(FullPath("errors.txt"))) { Warning("File does not exist: errors.txt"); } else { Message("Opening errors.txt in Notepad..."); Process.Start(FullPath("errors.txt")); } } else if (e.Text == mOpenPluginFolderCommand) { e.Eat = true; Message("Opening " + PluginName + " folder in Windows..."); Process.Start(new ProcessStartInfo("explorer.exe", "/select," + FullPath("errors.txt"))); } } } catch (Exception ex) { HandleException(ex); } }
private void Core_ChatNameClicked(object sender, ChatClickInterceptEventArgs e) { try { if (e.Id == 110011) { if (e.Text == "GoArrow_Example") { Util.Message("That was just an example."); e.Eat = true; } else { Coordinates coords; if (Coordinates.TryParse(e.Text, out coords)) { e.Eat = true; if (Util.IsControlDown()) { SetRouteEnd(coords); } else if (Util.IsShiftDown()) { SetRouteStart(coords); } else { Location loc = mLocDb.GetLocationAt(coords); if (loc != null) mArrowHud.DestinationLocation = loc; else mArrowHud.DestinationCoords = coords; mArrowHud.Visible = true; } } } } else if (e.Text == SelectItemCommand) { Host.Actions.SelectItem(e.Id); e.Eat = true; } else if (e.Text == AttachArrowCommand) { AttachCommand(e.Id, false); e.Eat = true; } Util.HandleChatCommand(sender, e); } catch (Exception ex) { Util.HandleException(ex); } }
private static void a(object A_0, ChatClickInterceptEventArgs A_1) { A_1.set_Eat(c(A_1.get_Text())); }