Free Hero Mesh

Check-in [acca5b95d3]
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 the possibility to edit Misc/Dir of existing objects.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: acca5b95d30620cf0f3b8e2884964ce6fc4a4247
User & Date: user on 2021-05-05 20:03:44
Other Links: manifest | tags
Context
2021-05-09
01:21
Implement possibility for SQL codes in picture editor to use REPLACE INTO or INSERT INTO to replace some or all pixels according to the result of a SELECT query. check-in: 3c35f09e50 user: user tags: trunk
2021-05-05
20:03
Add the possibility to edit Misc/Dir of existing objects. check-in: acca5b95d3 user: user tags: trunk
02:33
Add the possibility to use SQL queries in the picture editor. check-in: 7e6d0f4f80 user: user tags: trunk
Changes

Modified TODO from [88ed99e2b7] to [a04c3e1979].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  * A ,PopUp command to use a popup with arguments starting from a mark
  * "Goto message" instruction (?)
  * 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
  * Allowing more altimages
* Puzzle set catalog format (using with internet; a separate program)







<







12
13
14
15
16
17
18

19
20
21
22
23
24
25
  * A ,PopUp command to use a popup with arguments starting from a mark
  * "Goto message" instruction (?)
  * Returning a class from COLLIDE/COLLIDEBY to transform
* Editor
  * Mouse dragging
  * Level index editor
  * Bizarro world

* 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
  * Allowing more altimages
* Puzzle set catalog format (using with internet; a separate program)

Modified bindings.doc from [1bf7746fc4] to [a7dfb340db].

128
129
130
131
132
133
134



135
136
137
138
139
140
141
'^s'
  Display the list of level strings.

'^u' <location>
  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.




'ex' <command>
  Export a level (given the operating system command to receive the
  exported data). See export.doc for details.

'im' <command>
  Import a level (given the operating system command to produce the data
  to be imported). See export.doc for details.







>
>
>







128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
'^s'
  Display the list of level strings.

'^u' <location>
  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' <object>
  Edit the Misc/Dir of an existing object.

'ex' <command>
  Export a level (given the operating system command to receive the
  exported data). See export.doc for details.

'im' <command>
  Import a level (given the operating system command to produce the data
  to be imported). See export.doc for details.

Modified default.heromeshrc from [804c1e8ecd] to [f9d22c5234].

153
154
155
156
157
158
159

160
161
162
163
164
165
166
?.editKey.ctrl.T: ^T
?.editKey.ctrl.X: select 're',pfwidth(),pfheight();
?.editKey.space: ^c
?.editKey.return: ^e
?.editKey.f1: select 'im',:Import_Level;
?.editKey.f2: select 'ex',:Export_Level;
?.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;







>







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
?.editKey.ctrl.T: ^T
?.editKey.ctrl.X: select 're',pfwidth(),pfheight();
?.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);
?.?.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;

Modified edit.c from [33f0991a96] to [597bb9c9cc].

685
686
687
688
689
690
691




















692
693
694
695
696
697
698
    case SDL_VIDEOEXPOSE:
      goto redraw;
    case SDL_QUIT:
      exit(0);
      break;
  }
}





















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;
  c=classes[m->class];
  if(!c) return;







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







685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
    case SDL_VIDEOEXPOSE:
      goto redraw;
    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;
  c=classes[m->class];
  if(!c) return;
1423
1424
1425
1426
1427
1428
1429



1430
1431
1432
1433
1434
1435
1436
      return -1;
    case '^S': // Save level
      save_level();
      return 1;
    case '^T': // Level title
      edit_string(&level_title);
      return 0;



    case 'ex': // Export level
      if(argc<2) return prev;
      export_level(sqlite3_column_text(args,1));
      return prev;
    case 'go': // Select level
      load_level(number);
      return 1;







>
>
>







1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
      return -1;
    case '^S': // Save level
      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
      load_level(number);
      return 1;