pass rejecting dict name into java layer and display as part of turn

lost message.
This commit is contained in:
Eric House 2012-09-06 19:04:40 -07:00
parent 07e6239699
commit 4f180e9e14
5 changed files with 16 additions and 9 deletions

View file

@ -428,14 +428,18 @@ and_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
XP_U16 turn, XP_Bool turnLost )
{
jboolean result = XP_FALSE;
UTIL_CBK_HEADER("warnIllegalWord", "([Ljava/lang/String;IZ)Z" );
UTIL_CBK_HEADER("warnIllegalWord",
"(Ljava/lang/String;[Ljava/lang/String;IZ)Z" );
XP_ASSERT( bwi->nWords > 0 );
if ( bwi->nWords > 0 ) {
jobjectArray jwords = makeStringArray( env, bwi->nWords,
(const XP_UCHAR**)bwi->words );
XP_ASSERT( !!bwi->dictName );
jstring jname = (*env)->NewStringUTF( env, bwi->dictName );
result = (*env)->CallBooleanMethod( env, util->jutil, mid,
jwords, turn, turnLost );
jname, jwords, turn, turnLost );
(*env)->DeleteLocalRef( env, jwords );
(*env)->DeleteLocalRef( env, jname );
}
UTIL_CBK_TAIL();
return result;

View file

@ -629,8 +629,8 @@
phonies_disallow is the current setting and a "phony" is
played. One of the two following strings will be appended
-->
<string name="ids_badwords">Word[s] %s not found in
wordlist.</string>
<string name="ids_badwords">Word[s] %1$s not found in
wordlist %2$s.</string>
<!-- Appended to the above in the phonies_warn case. User may
ignore the warning -->

View file

@ -1492,10 +1492,10 @@ public class BoardActivity extends XWActivity
// m_view.setVerticalScrollBarEnabled( maxOffset > 0 );
// }
@Override
public boolean warnIllegalWord( String[] words, int turn,
public boolean warnIllegalWord( String dict, String[] words, int turn,
boolean turnLost )
{
DbgUtils.logf( "warnIllegalWord" );
DbgUtils.logf( "warnIllegalWord(dict=%s)", dict );
boolean accept = turnLost;
StringBuffer sb = new StringBuffer();
@ -1507,7 +1507,8 @@ public class BoardActivity extends XWActivity
sb.append( "; " );
}
String message = getString( R.string.ids_badwords, sb.toString() );
String message =
getString( R.string.ids_badwords, sb.toString(), dict );
if ( turnLost ) {
nonBlockingDialog( DLG_BADWORDS,

View file

@ -126,7 +126,8 @@ public interface UtilCtxt {
// Don't need this unless we have a scroll thumb to indicate position
//void yOffsetChange( int maxOffset, int oldOffset, int newOffset );
boolean warnIllegalWord( String[] words, int turn, boolean turnLost );
boolean warnIllegalWord( String dict, String[] words, int turn,
boolean turnLost );
void showChat( String msg );

View file

@ -242,7 +242,8 @@ public class UtilCtxtImpl implements UtilCtxt {
subclassOverride( "notifyGameOver" );
}
public boolean warnIllegalWord( String[] words, int turn, boolean turnLost )
public boolean warnIllegalWord( String dict, String[] words, int turn,
boolean turnLost )
{
subclassOverride( "warnIllegalWord" );
return false;