Index: TODO ================================================================== --- TODO +++ TODO @@ -14,11 +14,10 @@ * Returning a class from COLLIDE/COLLIDEBY to transform * Editor * Mouse dragging * Level index editor * Bizarro world - * Edit attributes of existing objects * Table of contents for levels * Can define your own columns * User can write SQL queries on them * Deal better with allowing to skip past corrupted levels * Picture editor/loading Index: bindings.doc ================================================================== --- bindings.doc +++ bindings.doc @@ -130,10 +130,13 @@ '^u' Add an object with the current MRU values to that location, even if there is already another object of the same class at that location. +'em' + Edit the Misc/Dir of an existing object. + 'ex' Export a level (given the operating system command to receive the exported data). See export.doc for details. 'im' Index: default.heromeshrc ================================================================== --- default.heromeshrc +++ default.heromeshrc @@ -155,10 +155,11 @@ ?.editKey.space: ^c ?.editKey.return: ^e ?.editKey.f1: select 'im',:Import_Level; ?.editKey.f2: select 'ex',:Export_Level; ?.editClick.left: ^a +?.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); Index: edit.c ================================================================== --- edit.c +++ edit.c @@ -687,10 +687,30 @@ case SDL_QUIT: exit(0); break; } } + +static void mru_edit_obj(Uint32 obj) { + Object*o; + MRU m; + if(obj>=nobjects) return; + o=objects[obj]; + if(!o) return; + m.class=o->class; + m.img=o->image; + m.misc1=o->misc1; + m.misc2=o->misc2; + m.misc3=o->misc3; + m.dir=o->dir; + mru_edit(&m); + o->image=m.img; + o->misc1=m.misc1; + o->misc2=m.misc2; + o->misc3=m.misc3; + o->dir=m.dir; +} static void add_object_at(int x,int y,MRU*m,int d) { Uint32 n,u; Class*c; if(x<1 || x>pfwidth || y<1 || y>pfheight || !m || !m->class) return; @@ -1425,10 +1445,13 @@ save_level(); return 1; case '^T': // Level title edit_string(&level_title); return 0; + case 'em': // Edit Misc/Dir of object + if(argc>1 && sqlite3_column_type(args,1)!=SQLITE_NULL) mru_edit_obj(sqlite3_column_int64(args,1)); + return 0; case 'ex': // Export level if(argc<2) return prev; export_level(sqlite3_column_text(args,1)); return prev; case 'go': // Select level