Free Hero Mesh

Check-in [1b9b475745]
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:Allow number pad keys to be used in the class/image selection menu in the level editor.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1b9b4757453a46d86e1a1987fa3fabd2d9e042a3
User & Date: user on 2021-05-01 01:10:08
Other Links: manifest | tags
Context
2021-05-01
01:29
Implement "and ... then" and "or ... then" blocks. check-in: 2f48f45b15 user: user tags: trunk
01:10
Allow number pad keys to be used in the class/image selection menu in the level editor. check-in: 1b9b475745 user: user tags: trunk
2021-04-30
03:25
Explain what a Hamster archive is in the documentation. check-in: be6023c165 user: user tags: trunk
Changes

Modified edit.c from [58dde81db5] to [7224dafdb1].

464
465
466
467
468
469
470
471
472
473
474




475
476

477
478
479
480
481
482
483
464
465
466
467
468
469
470




471
472
473
474
475

476
477
478
479
480
481
482
483







-
-
-
-
+
+
+
+

-
+







          img=imglist[i];
        }
        if(ev.button.button==3 || ev.button.button==2) add_mru(cl,img);
        if(ev.button.button==2) return;
        goto redraw;
      case SDL_KEYDOWN:
        switch(ev.key.keysym.sym) {
          case SDLK_HOME: clscroll=0; goto redraw;
          case SDLK_END: clscroll=clcount-screen->h/8; goto redraw;
          case SDLK_PAGEDOWN: clscroll+=screen->h/8; goto redraw;
          case SDLK_PAGEUP: clscroll-=screen->h/8; goto redraw;
          case SDLK_HOME: case SDLK_KP7: clscroll=0; goto redraw;
          case SDLK_END: case SDLK_KP1: clscroll=clcount-screen->h/8; goto redraw;
          case SDLK_PAGEDOWN: case SDLK_KP3: clscroll+=screen->h/8; goto redraw;
          case SDLK_PAGEUP: case SDLK_KP9: clscroll-=screen->h/8; goto redraw;
          case SDLK_ESCAPE: return;
          case SDLK_CLEAR: case SDLK_DELETE: namei=0; goto redraw;
          case SDLK_CLEAR: case SDLK_DELETE: case SDLK_KP_PERIOD: namei=0; goto redraw;
          case SDLK_BACKSPACE: if(namei) --namei; goto redraw;
          case SDLK_TAB:
            if(!cl) break;
            strncpy(name,classes[cl]->name,254);
            for(j=0;j<clcount;j++) if(cl==cllist[j]) break;
            // Increase namei according to all directly following letters that are matching
            while(namei<253 && classes[cl]->name[namei]) {
494
495
496
497
498
499
500
501

502
503
504
505
506
507

508
509
510
511
512
513

514
515
516
517
518
519
520

521
522
523
524
525
526
527
528
529
530
531
532
533
534

535
536
537

538
539
540
541
542
543
544
494
495
496
497
498
499
500

501
502
503
504
505
506

507
508
509
510
511
512

513
514
515
516
517
518
519

520
521
522
523
524
525
526
527
528
529
530
531
532
533

534
535
536

537
538
539
540
541
542
543
544







-
+





-
+





-
+






-
+













-
+


-
+







                    continue;
                  }
                }
              }
              ++namei;
            }
            goto redraw;
          case SDLK_LEFT:
          case SDLK_LEFT: case SDLK_KP4:
            for(i=0;i<imgcount-1;i++) if(img==imglist[i+1]) {
              img=imglist[i];
              goto redraw;
            }
            break;
          case SDLK_RIGHT:
          case SDLK_RIGHT: case SDLK_KP6:
            for(i=0;i<imgcount-1;i++) if(img==imglist[i]) {
              img=imglist[i+1];
              goto redraw;
            }
            break;
          case SDLK_UP:
          case SDLK_UP: case SDLK_KP8:
            namei=0;
            for(i=1;i<clcount;i++) if(cl==cllist[i]) {
              cl=cllist[i-1];
              goto setclass;
            }
            break;
          case SDLK_DOWN:
          case SDLK_DOWN: case SDLK_KP2:
            namei=0;
            if(!cl) {
              cl=*cllist;
              goto setclass;
            }
            for(i=0;i<clcount-1;i++) if(cl==cllist[i]) {
              cl=cllist[i+1];
              goto setclass;
            }
            break;
          case SDLK_RETURN: case SDLK_KP_ENTER:
            add_mru(cl,img);
            return;
          case SDLK_F1:
          case SDLK_F1: case SDLK_KP_DIVIDE:
            if(cl && classes[cl] && classes[cl]->gamehelp) modal_draw_popup(classes[cl]->gamehelp);
            goto redraw;
          case SDLK_F2:
          case SDLK_F2: case SDLK_KP_MULTIPLY:
            if(cl && classes[cl] && classes[cl]->edithelp) modal_draw_popup(classes[cl]->edithelp);
            goto redraw;
          default:
            j=ev.key.keysym.unicode;
            if(j=='$' || j==21) {
              namei=0;
              goto redraw;