Don't create our own chat director, just use the one from the context.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@204 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -52,7 +52,6 @@ import com.samskivert.swing.event.AncestorAdapter;
|
|||||||
|
|
||||||
import com.threerings.util.Name;
|
import com.threerings.util.Name;
|
||||||
|
|
||||||
import com.threerings.crowd.chat.client.ChatDirector;
|
|
||||||
import com.threerings.crowd.chat.client.ChatDisplay;
|
import com.threerings.crowd.chat.client.ChatDisplay;
|
||||||
import com.threerings.crowd.chat.data.ChatCodes;
|
import com.threerings.crowd.chat.data.ChatCodes;
|
||||||
import com.threerings.crowd.chat.data.ChatMessage;
|
import com.threerings.crowd.chat.data.ChatMessage;
|
||||||
@@ -76,11 +75,8 @@ public class ChatPanel
|
|||||||
// keep this around for later
|
// keep this around for later
|
||||||
_ctx = ctx;
|
_ctx = ctx;
|
||||||
|
|
||||||
// create our chat director and register ourselves with it
|
// register ourselves with the chat director
|
||||||
_chatdtr = new ChatDirector(_ctx, null, null);
|
_ctx.getChatDirector().addChatDisplay(this);
|
||||||
// XXX - the line above royally borks things because it sends
|
|
||||||
// null, null downstream.
|
|
||||||
_chatdtr.addChatDisplay(this);
|
|
||||||
|
|
||||||
// register as an occupant observer
|
// register as an occupant observer
|
||||||
_ctx.getOccupantDirector().addOccupantObserver(this);
|
_ctx.getOccupantDirector().addOccupantObserver(this);
|
||||||
@@ -225,15 +221,15 @@ public class ChatPanel
|
|||||||
String message = text.substring(uidx + username.length()).trim();
|
String message = text.substring(uidx + username.length()).trim();
|
||||||
|
|
||||||
// request to send this text as a tell message
|
// request to send this text as a tell message
|
||||||
_chatdtr.requestTell(new Name(username), message, null);
|
_ctx.getChatDirector().requestTell(new Name(username), message, null);
|
||||||
|
|
||||||
} else if (text.startsWith("/clear")) {
|
} else if (text.startsWith("/clear")) {
|
||||||
// clear the chat box
|
// clear the chat box
|
||||||
_chatdtr.clearDisplays();
|
_ctx.getChatDirector().clearDisplays();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// request to send this text as a chat message
|
// request to send this text as a chat message
|
||||||
_chatdtr.requestSpeak(null, text, ChatCodes.DEFAULT_MODE);
|
_ctx.getChatDirector().requestSpeak(null, text, ChatCodes.DEFAULT_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear out the input because we sent a request
|
// clear out the input because we sent a request
|
||||||
@@ -320,7 +316,6 @@ public class ChatPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected CrowdContext _ctx;
|
protected CrowdContext _ctx;
|
||||||
protected ChatDirector _chatdtr;
|
|
||||||
|
|
||||||
protected boolean _focus = true;
|
protected boolean _focus = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user