Allow de-capitalizing to be turned off by subclasses.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4720 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2007-05-25 18:16:32 +00:00
parent c29a7b007b
commit 8b85e8a940
2 changed files with 18 additions and 2 deletions
@@ -751,7 +751,7 @@ public class ChatDirector extends BasicDirector
return text; return text;
// check to make sure there aren't too many caps // check to make sure there aren't too many caps
} else if (tlen > 7) { } else if (tlen > 7 && suppressTooManyCaps()) {
// count caps // count caps
var caps :int = 0; var caps :int = 0;
for (var ii :int = 0; ii < tlen; ii++) { for (var ii :int = 0; ii < tlen; ii++) {
@@ -826,6 +826,14 @@ public class ChatDirector extends BasicDirector
return text; return text;
} }
/**
* Return true if we should lowercase messages containing more than half upper-case characters.
*/
protected function suppressTooManyCaps () :Boolean
{
return true;
}
/** /**
* Check that after mogrification the message is not too long. * Check that after mogrification the message is not too long.
* @return an error mesage if it is too long, or null. * @return an error mesage if it is too long, or null.
@@ -814,7 +814,7 @@ public class ChatDirector extends BasicDirector
return text; return text;
// check to make sure there aren't too many caps // check to make sure there aren't too many caps
} else if (tlen > 7) { } else if (tlen > 7 && suppressTooManyCaps()) {
// count caps // count caps
int caps = 0; int caps = 0;
for (int ii=0; ii < tlen; ii++) { for (int ii=0; ii < tlen; ii++) {
@@ -898,6 +898,14 @@ public class ChatDirector extends BasicDirector
return buf; return buf;
} }
/**
* Return true if we should lowercase messages containing more than half upper-case characters.
*/
protected boolean suppressTooManyCaps ()
{
return true;
}
/** /**
* Check that after mogrification the message is not too long. * Check that after mogrification the message is not too long.
* @return an error message if it is too long, or null. * @return an error message if it is too long, or null.