Free Hero Mesh

Check-in [7518eafb66]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Add 'lt' for setting level title by SQL codes, and make ^P in the text editor to remember the last character picket
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7518eafb66b53d5a319e1b99d9d5e2fa2b0da5c2
User & Date: user on 2021-03-27 22:08:34
Other Links: manifest | tags
Context
2021-03-27
23:21
Disable a part of the code which is currently unused. check-in: 95388f9377 user: user tags: trunk
22:08
Add 'lt' for setting level title by SQL codes, and make ^P in the text editor to remember the last character picket check-in: 7518eafb66 user: user tags: trunk
08:21
Implement the text editor, for editing the level title and level strings (currently, only editing the title is implemented). check-in: 1665c0ca5d user: user tags: trunk
Changes

Modified bindings.doc from [f99b352e8c] to [12900583cc].

137
138
139
140
141
142
143




144
145
146
147
148
149
150
  to be imported). See export.doc for details.

'lc' <number>
  Set the level code number. This is a 16-bit number which can be used in
  the class codes of your puzzle set for whatever purpose you wish; the
  game engine does not use this value itself.





'lv' <number>
  Set the level version number. This number is used to detect the validity
  of stored solutions. Normally, you do not need to set this; it will do
  so automatically once the level is saved, if any changes have been made
  which might invalidate the solution (although it doesn't know for sure,
  so there are false positives). However, you can set this deliberately by
  yourself, in case you know that the solution remains valid; if you do







>
>
>
>







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
  to be imported). See export.doc for details.

'lc' <number>
  Set the level code number. This is a 16-bit number which can be used in
  the class codes of your puzzle set for whatever purpose you wish; the
  game engine does not use this value itself.

'lt' <blob>
  Set the level title. The value must be unescaped; you can use the
  HEROMESH_UNESCAPE function to do this.

'lv' <number>
  Set the level version number. This number is used to detect the validity
  of stored solutions. Normally, you do not need to set this; it will do
  so automatically once the level is saved, if any changes have been made
  which might invalidate the solution (although it doesn't know for sure,
  so there are false positives). However, you can set this deliberately by
  yourself, in case you know that the solution remains valid; if you do

Modified edit.c from [53e03af8b4] to [dca0840b6e].

1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
}

static inline Uint8 pick_character(void) {
  SDL_Rect r;
  SDL_Event ev;
  Uint8 buf[17];
  int i,j;
  Uint8 p=0;
  redraw:
  r.x=r.y=4;
  r.w=r.h=0x9C;
  SDL_FillRect(screen,&r,0xF8);
  SDL_LockSurface(screen);
  draw_text(24,8,"0123456789ABCDEF",0xF8,0xF3);
  buf[16]=0;







|







1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
}

static inline Uint8 pick_character(void) {
  SDL_Rect r;
  SDL_Event ev;
  Uint8 buf[17];
  int i,j;
  static Uint8 p=0;
  redraw:
  r.x=r.y=4;
  r.w=r.h=0x9C;
  SDL_FillRect(screen,&r,0xF8);
  SDL_LockSurface(screen);
  draw_text(24,8,"0123456789ABCDEF",0xF8,0xF3);
  buf[16]=0;
1306
1307
1308
1309
1310
1311
1312






1313
1314
1315
1316
1317
1318
1319
      if(argc<2) return prev;
      import_level(sqlite3_column_text(args,1));
      return 0;
    case 'lc': // Set level code
      level_code=number;
      level_changed=1;
      return 0;






    case 'lv': // Set level version
      level_version=number;
      level_changed=0;
      return 0;
    case 'mR': // Select MRU relative
      number+=curmru;
      // fall through







>
>
>
>
>
>







1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
      if(argc<2) return prev;
      import_level(sqlite3_column_text(args,1));
      return 0;
    case 'lc': // Set level code
      level_code=number;
      level_changed=1;
      return 0;
    case 'lt': // Set level title
      if(argc<2 || !sqlite3_column_text(args,1)) break;
      free(level_title);
      level_title=strdup(sqlite3_column_text(args,1));
      if(!level_title) fatal("Allocation failed\n");
      return 0;
    case 'lv': // Set level version
      level_version=number;
      level_changed=0;
      return 0;
    case 'mR': // Select MRU relative
      number+=curmru;
      // fall through