mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
support for receiving and displaying chat messages. Compiles but not tested.
This commit is contained in:
parent
d35bc7d748
commit
1e13e92deb
5 changed files with 23 additions and 0 deletions
|
@ -15,6 +15,7 @@ local_DEFINES += \
|
|||
$(local_DEBUG) \
|
||||
-DXWFEATURE_RELAY \
|
||||
-DXWFEATURE_TURNCHANGENOTIFY \
|
||||
-DXWFEATURE_CHAT \
|
||||
-DSHOW_PROGRESS \
|
||||
-DKEY_SUPPORT \
|
||||
-DXWFEATURE_CROSSHAIRS \
|
||||
|
|
|
@ -346,6 +346,15 @@ and_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
|
|||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
and_util_showChat( XW_UtilCtxt* uc, const XP_UCHAR const* msg )
|
||||
{
|
||||
UTIL_CBK_HEADER("showChat", "(Ljava/lang/String;)V" );
|
||||
jstring jmsg = (*env)->NewStringUTF( env, msg );
|
||||
(*env)->CallVoidMethod( env, util->jutil, mid, jmsg );
|
||||
(*env)->DeleteLocalRef( env, jmsg );
|
||||
UTIL_CBK_TAIL();
|
||||
}
|
||||
|
||||
static void
|
||||
and_util_remSelected(XW_UtilCtxt* uc)
|
||||
|
@ -445,6 +454,7 @@ makeUtil( MPFORMAL JNIEnv** envp, jobject jutil, CurGameInfo* gi,
|
|||
SET_PROC(makeEmptyDict);
|
||||
SET_PROC(getUserString);
|
||||
SET_PROC(warnIllegalWord);
|
||||
SET_PROC(showChat);
|
||||
SET_PROC(remSelected);
|
||||
SET_PROC(setIsServer);
|
||||
|
||||
|
|
|
@ -386,4 +386,6 @@
|
|||
<string name="no_name_found">No public rooms found. Try
|
||||
refreshing or creating your own.</string>
|
||||
|
||||
<string name="chat_received">Message received</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1152,4 +1152,12 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
|||
return accept;
|
||||
}
|
||||
|
||||
public void showChat( String msg )
|
||||
{
|
||||
Utils.logf( "showChat(%s)", msg );
|
||||
m_dlgBytes = msg;
|
||||
m_dlgTitle = R.string.chat_received;
|
||||
showDialog( DLG_OKONLY );
|
||||
}
|
||||
|
||||
} // class BoardActivity
|
||||
|
|
|
@ -108,4 +108,6 @@ public interface UtilCtxt {
|
|||
//void yOffsetChange( int maxOffset, int oldOffset, int newOffset );
|
||||
|
||||
boolean warnIllegalWord( String[] words, int turn, boolean turnLost );
|
||||
|
||||
void showChat( String msg );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue