summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ChatPart.java
blob: 1f7af6e6eb48e7a122fe022612bd4f3b1d9b2925 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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
 */