Free Hero Mesh

Check-in [2f8784fac0]
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:In the level editor, add the possibility to clear levels, resize levels, and to fill the playfield with one kind of object.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2f8784fac0b537c7c3425014a31ed7988d38f9b8
User & Date: user on 2021-02-16 07:11:26
Other Links: manifest | tags
Context
2021-02-16
22:21
In add_mru function in editor, do not add blank MRUs check-in: a87bcb73f5 user: user tags: trunk
07:11
In the level editor, add the possibility to clear levels, resize levels, and to fill the playfield with one kind of object. check-in: 2f8784fac0 user: user tags: trunk
03:08
Add XY function check-in: 1bcf59e130 user: user tags: trunk
Changes

Modified bindings.doc from [49d6e34851] to [7578e8d589].

117
118
119
120
121
122
123




124
125
126
127
128
129
130
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134







+
+
+
+







'mR' <number>
  Select a relative MRU. Negative numbers move up the list, and positive
  numbers move down the list.

'mr' <number>
  Select a MRU, given the MRU number (0 to 31; the top is zero).

're' <width> <height>
  Remove all objects from the level and resize the level. The minimum size
  is 1x1 and the maximum size is 64x64.


=== Commands available in game and editor ===

'^E'
  Switch to the editor.

'^P'

Modified default.heromeshrc from [0717a6e544] to [57b9ba9aa2].

133
134
135
136
137
138
139


140
141

142
143
144
145
146
147
148
149
150
151
152
153
154
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157







+
+


+













?.editKey.5: select 'mr',4;
?.editKey.6: select 'mr',5;
?.editKey.7: select 'mr',6;
?.editKey.8: select 'mr',7;
?.editKey.9: select 'mr',8;
?.editKey.up: select 'mR',-1;
?.editKey.down: select 'mR',+1;
?.editKey.shift.F: with n(n) as (select 65 union all select n+1 h from n where h<=64*pfheight()+65) select '^a',n from n;
?.editKey.ctrl.X: select 're',pfwidth(),pfheight();
?.editKey.ctrl.P: ^P
?.editKey.ctrl.Q: ^Q
?.editKey.ctrl.R: select 're',substr(:resize,1,instr(:resize,'x')-1),substr(:resize,instr(:resize,'x')+1) where length(:resize);
?.editKey.space: ^c
?.editKey.return: ^e
?.editClick.left: ^a
?.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);
?.?.ctrl.G: select 'go',-:Go_To_Level where :Go_To_Level=cast(:Go_To_Level as int) and cast(:Go_To_Level as int)>0;
?.?.shift.ctrl.M: select ':s';
?.?.f10: select ':x';

Modified edit.c from [077a253bca] to [fba48953dd].

537
538
539
540
541
542
543

544
545
546
547
548
549
550
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551







+







  objects[n]->misc1=m->misc1;
  objects[n]->misc2=m->misc2;
  objects[n]->misc3=m->misc3;
  pflink(n);
}

static int editor_command(int prev,int cmd,int number,int argc,sqlite3_stmt*args,void*aux) {
  int x,y;
  switch(cmd) {
    case '^a': // Add object (no duplicates)
      if(prev) return prev;
      add_object_at(number&63?:64,number/64?:64,mru+curmru,1);
      return 0;
    case '^c': // Select class/image
      class_image_select();
564
565
566
567
568
569
570









571
572
573
574
575
576
577
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587







+
+
+
+
+
+
+
+
+







      load_level(number);
      return 1;
    case 'mR': // Select MRU relative
      number+=curmru;
      // fall through
    case 'mr': // Select MRU absolute
      if(number>=0 && number<MRUCOUNT) curmru=number;
      return 0;
    case 're': // Resize and clear
      if(argc<3) return 0;
      x=sqlite3_column_int(args,1);
      y=sqlite3_column_int(args,2);
      if(x<1 || y<1 || x>64 || y>64) return 0;
      annihilate();
      pfwidth=x;
      pfheight=y;
      return 0;
    default:
      return prev;
  }
}

void run_editor(void) {

Modified sql.doc from [98e4b49059] to [fa10274d55].

81
82
83
84
85
86
87

88
89
90
91
92
93
94
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95







+








TRACE_ON()
  Enables tracing when called.

XY(x,y)
  Many bindings require a position as their first argument; use this
  function to combine X/Y coordinates into a single value for this.
  Coordinates are one-based. This is the same as (x+y*64).

ZERO_EXTEND(number)
  Zero extends a 32-bit number to 64-bits. Same as NVALUE.


=== Tables ===