summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ChatPart.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/ChatPart.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/console/ChatPart.java')
-rw-r--r--NET/worlds/console/ChatPart.java116
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