Index: TODO ================================================================== --- TODO +++ TODO @@ -35,6 +35,7 @@ * Command-line switch for batch import/export levels * SQL * Implement the GROUP column in the CLASSES table * Allow multiple SQL statements in one binding * Large fonts (width 8 or 16, height 8-32) +* Remember solved levels (store solved version in USERSTATE column) Index: default.heromeshrc ================================================================== --- default.heromeshrc +++ default.heromeshrc @@ -162,11 +162,11 @@ ?.editClick.ctrl.left: select 'em',id from objects where x=$X and y=$Y and up is null; ?.editClick.alt.left: ^u ?.editClick.right: delete from objects where x=$X and y=$Y and up is null; ! Global key bindings -?.?.kp_minus: select 'go',-(level()-1); -?.?.kp_plus: select 'go',-(level()+1); +?.?.kp_minus: select 'go',-(level()-1) where level()>1; +?.?.kp_plus: select 'go',-(level()+1) where level()0; ?.?.shift.ctrl.M: select ':s'; ?.?.f10: select ':x'; Index: function.c ================================================================== --- function.c +++ function.c @@ -258,10 +258,14 @@ } if(sqlite3_value_type(*argv)==SQLITE_NULL) return; s=load_level(sqlite3_value_int(*argv)); if(s) sqlite3_result_error(cxt,s,-1); } + +static void fn_max_level(sqlite3_context*cxt,int argc,sqlite3_value**argv) { + sqlite3_result_int(cxt,level_nindex); +} static void fn_modstate(sqlite3_context*cxt,int argc,sqlite3_value**argv) { sqlite3_result_int(cxt,SDL_GetModState()); } @@ -974,10 +978,11 @@ sqlite3_create_function(userdb,"LEVEL",0,SQLITE_UTF8,&level_ord,fn_level,0,0); sqlite3_create_function(userdb,"LEVEL_CACHEID",0,SQLITE_UTF8|SQLITE_DETERMINISTIC,ptr0,fn_cacheid,0,0); sqlite3_create_function(userdb,"LEVEL_ID",0,SQLITE_UTF8,&level_id,fn_level,0,0); sqlite3_create_function(userdb,"LEVEL_TITLE",0,SQLITE_UTF8,0,fn_level_title,0,0); sqlite3_create_function(userdb,"LOAD_LEVEL",1,SQLITE_UTF8,0,fn_load_level,0,0); + sqlite3_create_function(userdb,"MAX_LEVEL",0,SQLITE_UTF8,0,fn_max_level,0,0); sqlite3_create_function(userdb,"MODSTATE",0,SQLITE_UTF8,0,fn_modstate,0,0); sqlite3_create_function(userdb,"MOVE_LIST",0,SQLITE_UTF8,0,fn_move_list,0,0); sqlite3_create_function(userdb,"MOVENUMBER",0,SQLITE_UTF8,0,fn_movenumber,0,0); sqlite3_create_function(userdb,"MVALUE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_mvalue,0,0); sqlite3_create_function(userdb,"NVALUE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_zero_extend,0,0); Index: sql.doc ================================================================== --- sql.doc +++ sql.doc @@ -59,11 +59,11 @@ LEVEL() The one-based order number of the current level. LEVEL_CACHEID() - The cache ID number of this level in the user cache table. + The user cache ID of the level file. LEVEL_ID() The ID number of the current level. LEVEL_TITLE() @@ -103,10 +103,13 @@ manager. Returns null if there is no such resource value. SIGN_EXTEND(number) Sign extends a 32-bit number to 64-bits. +SOLUTION_CACHEID() + The user cache ID of the level file. + TRACE_OFF() Disables tracing when called. TRACE_ON() Enables tracing when called.