Match recent changes on Java side.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4432 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -26,6 +26,7 @@ import mx.collections.ArrayCollection;
|
||||
import com.threerings.util.ArrayUtil;
|
||||
import com.threerings.util.HashMap;
|
||||
import com.threerings.util.Map;
|
||||
import com.threerings.util.ObserverList;
|
||||
import com.threerings.util.ResultListener;
|
||||
import com.threerings.util.StringUtil;
|
||||
|
||||
@@ -102,6 +103,16 @@ public class ChatDirector extends BasicDirector
|
||||
registerCommandHandler(msg, "tell", new TellHandler());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the supplied chat display to the front of the chat display list. It
|
||||
* will subsequently be notified of incoming chat messages as well as tell
|
||||
* responses.
|
||||
*/
|
||||
public function pushChatDisplay (display :ChatDisplay) :void
|
||||
{
|
||||
_displays.add(display, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the supplied chat display to the chat display list. It will
|
||||
* subsequently be notified of incoming chat messages as well as tell
|
||||
@@ -109,9 +120,7 @@ public class ChatDirector extends BasicDirector
|
||||
*/
|
||||
public function addChatDisplay (display :ChatDisplay) :void
|
||||
{
|
||||
if (-1 == _displays.getItemIndex(display)) {
|
||||
_displays.addItem(display);
|
||||
}
|
||||
_displays.add(display);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,10 +129,7 @@ public class ChatDirector extends BasicDirector
|
||||
*/
|
||||
public function removeChatDisplay (display :ChatDisplay) :void
|
||||
{
|
||||
var idx :int = _displays.getItemIndex(display);
|
||||
if (idx != -1) {
|
||||
_displays.removeItemAt(idx);
|
||||
}
|
||||
_displays.remove(display);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,9 +233,9 @@ public class ChatDirector extends BasicDirector
|
||||
*/
|
||||
public function clearDisplays () :void
|
||||
{
|
||||
for (var ii :int = 0; ii < _displays.length; ii++) {
|
||||
(_displays.getItemAt(ii) as ChatDisplay).clear();
|
||||
}
|
||||
_displays.apply(function (disp :ChatDisplay) :void {
|
||||
disp.clear();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,9 +284,12 @@ public class ChatDirector extends BasicDirector
|
||||
*/
|
||||
public function dispatchMessage (message :ChatMessage) :void
|
||||
{
|
||||
for each (var display :ChatDisplay in _displays) {
|
||||
display.displayMessage(message);
|
||||
}
|
||||
var displayed :Boolean = false;
|
||||
_displays.apply(function (disp :ChatDisplay) :void {
|
||||
if (disp.displayMessage(message, displayed)) {
|
||||
displayed = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -986,7 +995,7 @@ public class ChatDirector extends BasicDirector
|
||||
protected var _clobj :ClientObject;
|
||||
|
||||
/** A list of registered chat displays. */
|
||||
protected var _displays :ArrayCollection = new ArrayCollection();
|
||||
protected var _displays :ObserverList = new ObserverList();
|
||||
|
||||
/** A list of registered chat filters. */
|
||||
// protected ObserverList _filters =
|
||||
|
||||
@@ -39,7 +39,9 @@ public interface ChatDisplay
|
||||
* Called to display a chat message.
|
||||
*
|
||||
* @see ChatMessage
|
||||
* @return true if the message was displayed here.
|
||||
*/
|
||||
function displayMessage (msg :ChatMessage) :void;
|
||||
function displayMessage (
|
||||
msg :ChatMessage, alreadyDisplayed :Boolean) :Boolean;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user