diff --git a/palm/l10n/xwords4_en_US.rcp.pre b/palm/l10n/xwords4_en_US.rcp.pre index 7c7c05b8d..d53447bcc 100644 --- a/palm/l10n/xwords4_en_US.rcp.pre +++ b/palm/l10n/xwords4_en_US.rcp.pre @@ -454,6 +454,19 @@ BEGIN #endif END +FORM ID XW_ASKNTILES_FORM_ID AT ( 2 60 156 97 ) USABLE MODAL SAVEBEHIND +BEGIN + TITLE "Number of tiles" + + LABEL "Use how many tiles" AUTOID 10 18 FONT 1 USABLE + LABEL "for this hint?" AUTOID 10 PREVBOTTOM FONT 1 USABLE + LIST "1" "2" "3" "4" "5" "6" "7" ID XW_ASKNTILES_LIST_ID + AT ( 156-20 16 AUTO AUTO) USABLE VISIBLEITEMS 7 + + BUTTON "Ok" AUTOID RIGHT@PREVLEFT-10 PREVBOTTOM-12 AUTO 12 +END + + #if defined OWNER_HASH || defined NO_REG_REQUIRED FORM ID XW_SAVEDGAMES_DIALOG_ID AT ( 2 2 156 156 ) USABLE MODAL DEFAULTBTNID XW_SAVEDGAMES_DONE_BUTTON diff --git a/palm/palmmain.c b/palm/palmmain.c index 516c199a9..769ada83a 100644 --- a/palm/palmmain.c +++ b/palm/palmmain.c @@ -610,6 +610,7 @@ palmInitPrefs( PalmAppGlobals* globals ) #ifdef SHOW_PROGRESS globals->gState.showProgress = true; #endif + globals->gState.lastNTiles = MAX_TRAY_TILES; } /* palmInitPrefs */ static void @@ -1358,6 +1359,31 @@ handleHideTray( PalmAppGlobals* globals ) return draw; } /* handleHideTray */ +static XP_U16 +palmAskNTiles( PalmAppGlobals* globals, XP_U16 defaultChoice ) +{ + FormPtr form, prevForm; + UInt16 buttonHit; + ListPtr list; + + prevForm = FrmGetActiveForm(); + form = FrmInitForm( XW_ASKNTILES_FORM_ID ); + FrmSetActiveForm( form ); + + list = getActiveObjectPtr( XW_ASKNTILES_LIST_ID ); + XP_ASSERT( defaultChoice > 0 && defaultChoice <= MAX_TRAY_TILES ); + LstSetSelection( list, defaultChoice-1 ); + + buttonHit = FrmDoDialog( form ); + + defaultChoice = LstGetSelection( list ) + 1; + + FrmDeleteForm( form ); + FrmSetActiveForm( prevForm ); + + return defaultChoice; +} /* palmAskNTiles */ + static Boolean handleHintRequest( PalmAppGlobals* globals, XP_Bool askNTiles ) { @@ -1368,7 +1394,8 @@ handleHintRequest( PalmAppGlobals* globals, XP_Bool askNTiles ) XP_ASSERT( !!globals->game.board ); if ( askNTiles ) { - nTiles = 3; + nTiles = palmAskNTiles( globals, globals->gState.lastNTiles ); + globals->gState.lastNTiles = nTiles; } else { nTiles = MAX_TRAY_TILES; } diff --git a/palm/palmmain.h b/palm/palmmain.h index 97df0472b..e0c667334 100644 --- a/palm/palmmain.h +++ b/palm/palmmain.h @@ -113,6 +113,8 @@ typedef struct XWords4PreferenceType { #endif /* New for 0x0405 */ CommonPrefs cp; + /* New for 0x0406 */ + XP_U8 lastNTiles; } XWords4PreferenceType; diff --git a/palm/xwords4defines.h b/palm/xwords4defines.h index 171665e1d..d44784fad 100644 --- a/palm/xwords4defines.h +++ b/palm/xwords4defines.h @@ -51,9 +51,10 @@ #define XW_COLORPREF_DIALOG_ID 1007 #define XW_PREFS_FORM 1008 #define XW_SAVEDGAMES_DIALOG_ID 1009 -#define XW_CONNS_FORM 1010 +#define XW_ASKNTILES_FORM_ID 1010 +#define XW_CONNS_FORM 1011 #ifdef FOR_GREMLINS -# define XW_GREMLIN_WARN_FORM_ID 1011 +# define XW_GREMLIN_WARN_FORM_ID 1012 #endif #define XW_ASK_MENU_ID 1001 @@ -302,6 +303,11 @@ #define XW_CONNS_HOSTIP_LABEL_ID 2910 #define XW_CONNS_HOSTIP_FIELD_ID 2911 +/* + * selector for number of tiles during hint + */ +#define XW_ASKNTILES_LIST_ID 2950 + #define PALM_BOARD_TOP 8 #define PALM_GRIDLESS_BOARD_TOP 2