diff options
Diffstat (limited to 'NET/worlds/console/ChatPart.java')
| -rw-r--r-- | NET/worlds/console/ChatPart.java | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/NET/worlds/console/ChatPart.java b/NET/worlds/console/ChatPart.java new file mode 100644 index 0000000..1f7af6e --- /dev/null +++ b/NET/worlds/console/ChatPart.java @@ -0,0 +1,116 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import NET.worlds.scape.FrameEvent; +/* */ import NET.worlds.scape.Pilot; +/* */ import java.awt.Container; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ChatPart +/* */ extends DuplexPart +/* */ { +/* */ private Window renderWindow; +/* */ private DefaultConsole console; +/* */ private static final String activateVCselfWhisper = "&|+debug<selfWhisperON"; +/* */ private static final String deactivateVCselfWhisper = "&|+debug<selfWhisperOFF"; +/* */ private static final String VCextraCommand = "&|+debug<VCcommand"; +/* */ +/* */ protected void sendText(String s) +/* */ { +/* 40 */ int ii = s.indexOf('\\'); +/* */ +/* 42 */ if (s.startsWith("&|+debug<")) { +/* 43 */ triggerLocalDebug(s); +/* 44 */ } else if ((ii >= 0) && (ii < s.length() - 1) && (s.charAt(ii + 1) == 'u')) { +/* 45 */ Pilot.sendText(Console.parseUnicode(s)); +/* */ } else { +/* 47 */ Pilot.sendText(s); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public void activate(Console c, Container f, Console prev) +/* */ { +/* 55 */ super.activate(c, f, prev); +/* */ +/* */ +/* 58 */ this.console = ((DefaultConsole)c); +/* */ } +/* */ +/* */ public void deactivate() +/* */ { +/* 63 */ super.deactivate(); +/* */ +/* */ +/* 66 */ this.renderWindow = null; +/* 67 */ this.console = null; +/* */ } +/* */ +/* */ public synchronized boolean handle(FrameEvent f) +/* */ { +/* 72 */ boolean ret = super.handle(f); +/* */ +/* */ +/* 75 */ if ((this.renderWindow == null) && (this.console != null)) { +/* 76 */ RenderCanvas rc = this.console.getRender(); +/* 77 */ if (rc != null) { +/* 78 */ Window w = rc.getWindow(); +/* 79 */ if (w != null) { +/* */ try { +/* 81 */ w.hookChatLine(this.line); +/* 82 */ this.renderWindow = w; +/* */ } +/* */ catch (WindowNotFoundException localWindowNotFoundException) {} +/* */ } +/* */ } +/* */ } +/* 88 */ return ret; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private void triggerLocalDebug(String s) +/* */ { +/* 100 */ if (s.startsWith("&|+debug<selfWhisperON")) { +/* 101 */ VoiceChat.activateSelfWhisper(); +/* */ } +/* 103 */ if (s.startsWith("&|+debug<selfWhisperOFF")) { +/* 104 */ VoiceChat.deactivateSelfWhisper(); +/* */ } +/* 106 */ if (s.startsWith("&|+debug<VCcommand")) { +/* 107 */ VoiceChat.setExtra(s); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\ChatPart.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |