Free Hero Mesh

Check-in [b43a526002]
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 pasting into text input prompts
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b43a526002a376b432c0bfb46420ffb272de0227
User & Date: user on 2021-04-18 22:44:04
Other Links: manifest | tags
Context
2021-04-18
22:54
Add the "next" pattern operator. check-in: 81587e71b1 user: user tags: trunk
22:44
Implement pasting into text input prompts check-in: b43a526002 user: user tags: trunk
22:20
Correct a mistake in importing level titles check-in: ce10815b30 user: user tags: trunk
Changes

Modified config.doc from [dcc6a279c8] to [cff0358f5d].

64
65
66
67
68
69
70




71
72
73
74
75
76
77
  does not prevent other kinds of infinite loops, though.)

.palette
  If defined, the file name of the palette to use (if not set, then the
  internal palette is used instead). The file format is hex rrggbb format
  separated by any kind of whitespaces.





.progress
  If positive, how many steps between dots in the progress report for the
  auto testing most. If negative, number of milliseconds to sleep before
  each level is executed.

.saveSolutions
  If true, then solutions are saved if you solve a level in less moves







>
>
>
>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  does not prevent other kinds of infinite loops, though.)

.palette
  If defined, the file name of the palette to use (if not set, then the
  internal palette is used instead). The file format is hex rrggbb format
  separated by any kind of whitespaces.

.pasteCommand
  The command to use for pasting text from the clipboard. When it asks for
  a single line of text, you can push SHIFT+INSERT to paste.

.progress
  If positive, how many steps between dots in the progress report for the
  auto testing most. If negative, number of milliseconds to sleep before
  each level is executed.

.saveSolutions
  If true, then solutions are saved if you solve a level in less moves

Modified default.heromeshrc from [29103a4844] to [322c2f0dbe].

1
2
3
4
5
6
7

8
9
10
11
12
13
14
! Hero Mesh configuration settings
?.screenWidth: 800
?.screenHeight: 600
?.imageSize: 24
?.traceAll: true
?.showInventory: 0
?.maxTrigger: 32767


! Game inputs
?.gameKey.A: 'A
?.gameKey.B: 'B
?.gameKey.C: 'C
?.gameKey.D: 'D
?.gameKey.E: 'E







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
! Hero Mesh configuration settings
?.screenWidth: 800
?.screenHeight: 600
?.imageSize: 24
?.traceAll: true
?.showInventory: 0
?.maxTrigger: 32767
?.pasteCommand: xclip -o

! Game inputs
?.gameKey.A: 'A
?.gameKey.B: 'B
?.gameKey.C: 'C
?.gameKey.D: 'D
?.gameKey.E: 'E

Modified edit.c from [c0b2b83ad9] to [de2922fa30].

939
940
941
942
943
944
945


946
947
948
949
950
951
952
        p=import_value(p,&v);
        if(!p || v.t!=TY_CLASS) goto bad;
        v.u=objalloc(v.u);
        if(v.u==VOIDLINK) goto bad;
        o=objects[v.u];
        o->x=x;
        o->y=y;


        p=import_value(p,&o->misc1);
        p=import_value(p,&o->misc2);
        p=import_value(p,&o->misc3);
        p=import_numbers(p,&x,0);
        o->dir=x;
        if((x&~7) || !p) {
          objtrash(v.u);







>
>







939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
        p=import_value(p,&v);
        if(!p || v.t!=TY_CLASS) goto bad;
        v.u=objalloc(v.u);
        if(v.u==VOIDLINK) goto bad;
        o=objects[v.u];
        o->x=x;
        o->y=y;
        p=import_numbers(p,&x,0);
        o->image=x;
        p=import_value(p,&o->misc1);
        p=import_value(p,&o->misc2);
        p=import_value(p,&o->misc3);
        p=import_numbers(p,&x,0);
        o->dir=x;
        if((x&~7) || !p) {
          objtrash(v.u);

Modified picture.c from [df67d91e95] to [9d616d2335].

240
241
242
243
244
245
246


















247
248
249
250
251
252
253
            t[n]=0;
            return t;
          case SDLK_BACKSPACE: case SDLK_DELETE:
            if(n) t[n--]=0;
            break;
          case SDLK_CLEAR:
            t[n=0]=0;


















            break;
          default:
            if(ev.key.keysym.sym==SDLK_u && (ev.key.keysym.mod&KMOD_CTRL)) {
              t[n=0]=0;
            } else if(ev.key.keysym.sym==SDLK_c && (ev.key.keysym.mod&KMOD_CTRL)) {
              r.y=0;
              r.h=17;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
            t[n]=0;
            return t;
          case SDLK_BACKSPACE: case SDLK_DELETE:
            if(n) t[n--]=0;
            break;
          case SDLK_CLEAR:
            t[n=0]=0;
            break;
          case SDLK_INSERT:
            if(ev.key.keysym.mod&KMOD_SHIFT) {
              const char*s;
              FILE*fp;
              int c;
              optionquery[1]=Q_pasteCommand;
              if((s=xrm_get_resource(resourcedb,optionquery,optionquery,2)) && (fp=popen(s,"r"))) {
                for(;;) {
                  c=fgetc(fp);
                  if(c=='\t') c=' ';
                  if(c>=32 && n<m) t[n++]=c;
                  if(c=='\n' || c<0 || n>=m) break;
                }
                t[n]=0;
                pclose(fp);
              }
            }
            break;
          default:
            if(ev.key.keysym.sym==SDLK_u && (ev.key.keysym.mod&KMOD_CTRL)) {
              t[n=0]=0;
            } else if(ev.key.keysym.sym==SDLK_c && (ev.key.keysym.mod&KMOD_CTRL)) {
              r.y=0;
              r.h=17;

Modified quarks from [89b36181b9] to [57706df161].

215
216
217
218
219
220
221

222
maxObjects
traceAll
traceObject
showInventory
progress
autoSave
maxTrigger









>

215
216
217
218
219
220
221
222
223
maxObjects
traceAll
traceObject
showInventory
progress
autoSave
maxTrigger
pasteCommand

Modified quarks.h from [b213ef7a95] to [2ea9aca83b].

180
181
182
183
184
185
186

187
188
189
190
191
192
193
#define Q_maxObjects 181
#define Q_traceAll 182
#define Q_traceObject 183
#define Q_showInventory 184
#define Q_progress 185
#define Q_autoSave 186
#define Q_maxTrigger 187

static const char*const global_quarks[]={
  "screenWidth",
  "screenHeight",
  "margin",
  "palette",
  "popupColors",
  "imageSize",







>







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#define Q_maxObjects 181
#define Q_traceAll 182
#define Q_traceObject 183
#define Q_showInventory 184
#define Q_progress 185
#define Q_autoSave 186
#define Q_maxTrigger 187
#define Q_pasteCommand 188
static const char*const global_quarks[]={
  "screenWidth",
  "screenHeight",
  "margin",
  "palette",
  "popupColors",
  "imageSize",
367
368
369
370
371
372
373

374
375
376
377
378
379
380
  "maxObjects",
  "traceAll",
  "traceObject",
  "showInventory",
  "progress",
  "autoSave",
  "maxTrigger",

0};
#ifdef HEROMESH_BINDINGS
static const SDLKey quark_to_key[Q_undo+1-Q_backspace]={
SDLK_BACKSPACE,
SDLK_TAB,
SDLK_CLEAR,
SDLK_RETURN,







>







368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
  "maxObjects",
  "traceAll",
  "traceObject",
  "showInventory",
  "progress",
  "autoSave",
  "maxTrigger",
  "pasteCommand",
0};
#ifdef HEROMESH_BINDINGS
static const SDLKey quark_to_key[Q_undo+1-Q_backspace]={
SDLK_BACKSPACE,
SDLK_TAB,
SDLK_CLEAR,
SDLK_RETURN,