mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
hook up prev hint button -- and finally fix infinite loop that
happened when you clicked hint while a hint was being calculated.
This commit is contained in:
parent
c98451c62a
commit
b8c905204e
2 changed files with 15 additions and 4 deletions
|
@ -726,7 +726,8 @@ public class BoardActivity extends Activity implements UtilCtxt {
|
||||||
new View.OnClickListener() {
|
new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick( View view ) {
|
public void onClick( View view ) {
|
||||||
Utils.notImpl( BoardActivity.this );
|
m_jniThread.handle( JNIThread.JNICmd
|
||||||
|
.CMD_PREV_HINT );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
m_toolbar.setListener( Toolbar.BUTTON_HINT_NEXT,
|
m_toolbar.setListener( Toolbar.BUTTON_HINT_NEXT,
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class JNIThread extends Thread {
|
||||||
CMD_UNDO_LAST,
|
CMD_UNDO_LAST,
|
||||||
CMD_HINT,
|
CMD_HINT,
|
||||||
CMD_ZOOM,
|
CMD_ZOOM,
|
||||||
|
CMD_PREV_HINT,
|
||||||
CMD_NEXT_HINT,
|
CMD_NEXT_HINT,
|
||||||
CMD_VALUES,
|
CMD_VALUES,
|
||||||
CMD_COUNTS_VALUES,
|
CMD_COUNTS_VALUES,
|
||||||
|
@ -397,11 +398,20 @@ public class JNIThread extends Thread {
|
||||||
|
|
||||||
case CMD_HINT:
|
case CMD_HINT:
|
||||||
XwJNI.board_resetEngine( m_jniGamePtr );
|
XwJNI.board_resetEngine( m_jniGamePtr );
|
||||||
// fallthru
|
handle( JNICmd.CMD_NEXT_HINT );
|
||||||
|
break;
|
||||||
|
|
||||||
case CMD_NEXT_HINT:
|
case CMD_NEXT_HINT:
|
||||||
draw = XwJNI.board_requestHint( m_jniGamePtr, false, barr );
|
case CMD_PREV_HINT:
|
||||||
|
if ( nextSame( elem.m_cmd ) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
draw = XwJNI.board_requestHint( m_jniGamePtr, false,
|
||||||
|
JNICmd.CMD_PREV_HINT==elem.m_cmd,
|
||||||
|
barr );
|
||||||
if ( barr[0] ) {
|
if ( barr[0] ) {
|
||||||
handle( JNICmd.CMD_NEXT_HINT );
|
handle( elem.m_cmd );
|
||||||
|
draw = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue