Free Hero Mesh

Check-in [42d0691852]
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:Implement (Help Misc1) for help text to be defined by the level strings
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 42d069185279937fb20ebcb20e7891a02c49536e
User & Date: user on 2021-03-07 21:44:21
Other Links: manifest | tags
Context
2021-03-08
06:16
Fix 16-bit writes in compatibility mode check-in: 2bc4991d49 user: user tags: trunk
2021-03-07
21:44
Implement (Help Misc1) for help text to be defined by the level strings check-in: 42d0691852 user: user tags: trunk
06:27
Make for/next loops to skip objects with Destroyed or VisualOnly flag set. (Fixed levels 53, 60, and 97 of FALLING puzzle set. Levels 78, 80, 81, 82, 84, and 86 still fail.) check-in: 7337cfa590 user: user tags: trunk
Changes

Modified class.c from [faac25474f] to [b307433f16].

1318
1319
1320
1321
1322
1323
1324

1325
1326
1327







1328
1329
1330
1331
1332
1333
1334
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342







+



+
+
+
+
+
+
+







  }
}

static char*class_def_help(void) {
  char*txt=malloc(0x3000);
  int n=0;
  int i;
  if(!txt) fatal("Allocation failed\n");
  for(;;) {
    nxttok();
    if(tokent==TF_CLOSE) break;
    if(Tokenf(TF_NAME) && tokenv==OP_MISC1 && !n) {
      txt[0]=16;
      n=1;
      nxttok();
      if(tokent==TF_CLOSE) break;
      ParseError("Close parenthesis expected\n");
    }
    if(!Tokenf(TF_NAME) || tokenv!=OP_STRING) ParseError("String expected\n");
    i=strlen(tokenstr);
    if(i+n>=0x2FFA) ParseError("Help text is too long\n");
    strcpy(txt+n,tokenstr);
    n+=i;
    txt[n++]=10;
    txt[n]=0;

Modified class.doc from [89de65b0c2] to [b561abab61].

311
312
313
314
315
316
317




318
319
320
321
322
323
324
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328







+
+
+
+







(Height <number>)
  Define the Height variable for this class.

(Help <strings...>)
  A help message for the game player, which would normally explain what
  this object does. Each string is one line of text.

(Help Misc1)
  Similar to (Help) but tells it to display a level string referenced
  by the Misc1 of this object.

(Image <strings...>)
  Specify strings with the names of images. The first string is the
  name of the image numbered 0, next for the image numbered 1, etc.

Input
  Set the Input flag for this class. This causes it to receive a KEY
  message during the input phase of each turn.

Modified game.c from [9cf5f3a549] to [3633182984].

570
571
572
573
574
575
576





577
578
579
580
581
582
583
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588







+
+
+
+
+







  unsigned char*s;
  Uint32 n;
  if(xy<0 || xy>=64*64) return;
  n=playfield[xy];
  if(n==VOIDLINK) return;
  while(n!=VOIDLINK && objects[n]->up!=VOIDLINK) n=objects[n]->up;
  if(!classes[objects[n]->class]->gamehelp) return;
  if(classes[objects[n]->class]->gamehelp[0]==16 && !classes[objects[n]->class]->gamehelp[1]) {
    if(objects[n]->misc1.t!=TY_LEVELSTRING || objects[n]->misc1.u>=nlevelstrings) return;
    modal_draw_popup(levelstrings[objects[n]->misc1.u]);
    return;
  }
  s=sqlite3_mprintf("\x0C\x0E%s:%d\\ %s\x0B\x0F%s",classes[objects[n]->class]->name,objects[n]->image,classes[objects[n]->class]->name,classes[objects[n]->class]->gamehelp);
  if(!s) fatal("Allocation failed\n");
  modal_draw_popup(s);
  sqlite3_free(s);
}

static void do_import_moves(const char*arg) {