Allow subclasses to translate the status if a nonstandard one is in use.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4911 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -201,7 +201,7 @@ public class BodyObject extends ClientObject
|
|||||||
{
|
{
|
||||||
var who :String = username.toString() + " (" + getOid();
|
var who :String = username.toString() + " (" + getOid();
|
||||||
if (status != OccupantInfo.ACTIVE) {
|
if (status != OccupantInfo.ACTIVE) {
|
||||||
who += (" " + OccupantInfo.X_STATUS[status]);
|
who += (" " + getStatusTranslation());
|
||||||
}
|
}
|
||||||
who += ")";
|
who += ")";
|
||||||
return who;
|
return who;
|
||||||
@@ -216,5 +216,14 @@ public class BodyObject extends ClientObject
|
|||||||
status = ins.readByte();
|
status = ins.readByte();
|
||||||
awayMessage = (ins.readField(String) as String);
|
awayMessage = (ins.readField(String) as String);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a translation suffix for this occupant's status.
|
||||||
|
* Can be overridden to translate nonstandard statuses.
|
||||||
|
*/
|
||||||
|
protected function getStatusTranslation () :String
|
||||||
|
{
|
||||||
|
return OccupantInfo.X_STATUS[status];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,10 +222,19 @@ public class BodyObject extends ClientObject
|
|||||||
{
|
{
|
||||||
buf.append(getOid());
|
buf.append(getOid());
|
||||||
if (status != OccupantInfo.ACTIVE) {
|
if (status != OccupantInfo.ACTIVE) {
|
||||||
buf.append(" ").append(OccupantInfo.X_STATUS[status]);
|
buf.append(" ").append(getStatusTranslation());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a translation suffix for this occupant's status.
|
||||||
|
* Can be overridden to translate nonstandard statuses.
|
||||||
|
*/
|
||||||
|
protected String getStatusTranslation ()
|
||||||
|
{
|
||||||
|
return OccupantInfo.X_STATUS[status];
|
||||||
|
}
|
||||||
|
|
||||||
/** The default (no tokens) access control. */
|
/** The default (no tokens) access control. */
|
||||||
protected static final TokenRing EMPTY_TOKENS = new TokenRing();
|
protected static final TokenRing EMPTY_TOKENS = new TokenRing();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user