|
@@ -83,7 +83,6 @@ void killOpenRaiderSingleton()
|
83
|
83
|
#endif
|
84
|
84
|
|
85
|
85
|
printf("\nThanks for testing %s\n", VERSION);
|
86
|
|
- printf("Please file bug reports\n\n");
|
87
|
86
|
printf("Build date: %s @ %s\n", __DATE__, __TIME__);
|
88
|
87
|
printf("Build host: %s\n", BUILD_HOST);
|
89
|
88
|
printf("Web site : http://github.com/xythobuz/OpenRaider\n");
|
|
@@ -657,6 +656,62 @@ void OpenRaider::handleConsoleKeyPressEvent(unsigned int key,unsigned int mod)
|
657
|
656
|
}
|
658
|
657
|
|
659
|
658
|
|
|
659
|
+void OpenRaider::menuMapListMove(char dir, bool show) {
|
|
660
|
+ if (dir == 'f') {
|
|
661
|
+ mMapList.next();
|
|
662
|
+ if (!mMapList.forward())
|
|
663
|
+ mMapList.start();
|
|
664
|
+ } else if (dir == 'b') {
|
|
665
|
+ mMapList.prev();
|
|
666
|
+ if (!mMapList.backward())
|
|
667
|
+ mMapList.finish();
|
|
668
|
+ } else if (dir == 'n') {
|
|
669
|
+ size_t slashPos = strcspn(mMapList.current(), "/");
|
|
670
|
+ if (slashPos < strlen(mMapList.current())) {
|
|
671
|
+ char *dirName = new char[slashPos + 1];
|
|
672
|
+ dirName[slashPos] = '\0';
|
|
673
|
+ strncpy(dirName, mMapList.current(), slashPos);
|
|
674
|
+ do {
|
|
675
|
+ menuMapListMove('f', false);
|
|
676
|
+ } while (strstr(mMapList.current(), dirName) != NULL);
|
|
677
|
+ delete dirName;
|
|
678
|
+ } else {
|
|
679
|
+ do {
|
|
680
|
+ menuMapListMove('f', false);
|
|
681
|
+ } while (strstr(mMapList.current(), "/") == NULL);
|
|
682
|
+ }
|
|
683
|
+ } else if (dir == 'p') {
|
|
684
|
+ size_t slashPos = strcspn(mMapList.current(), "/");
|
|
685
|
+ if (slashPos < strlen(mMapList.current())) {
|
|
686
|
+ char *dirName = new char[slashPos + 1];
|
|
687
|
+ dirName[slashPos] = '\0';
|
|
688
|
+ strncpy(dirName, mMapList.current(), slashPos);
|
|
689
|
+ do {
|
|
690
|
+ menuMapListMove('b', false);
|
|
691
|
+ } while (strstr(mMapList.current(), dirName) != NULL);
|
|
692
|
+ // Yeah, cheap...
|
|
693
|
+ strncpy(dirName, mMapList.current(), slashPos);
|
|
694
|
+ do {
|
|
695
|
+ menuMapListMove('b', false);
|
|
696
|
+ } while (strstr(mMapList.current(), dirName) != NULL);
|
|
697
|
+ menuMapListMove('f', false);
|
|
698
|
+ delete dirName;
|
|
699
|
+ } else {
|
|
700
|
+ do {
|
|
701
|
+ menuMapListMove('b', false);
|
|
702
|
+ } while (strstr(mMapList.current(), "/") == NULL);
|
|
703
|
+ }
|
|
704
|
+ }
|
|
705
|
+
|
|
706
|
+ if (show) {
|
|
707
|
+ if (mMapList.current())
|
|
708
|
+ mText->SetString(textMenu, "Load %s?", mMapList.current());
|
|
709
|
+ else
|
|
710
|
+ mText->SetString(textMenu, "See README for map install");
|
|
711
|
+ }
|
|
712
|
+}
|
|
713
|
+
|
|
714
|
+
|
660
|
715
|
void OpenRaider::handleKeyPressEvent(unsigned int key, unsigned int mod)
|
661
|
716
|
{
|
662
|
717
|
static bool menu = false;
|
|
@@ -679,38 +734,17 @@ void OpenRaider::handleKeyPressEvent(unsigned int key, unsigned int mod)
|
679
|
734
|
menu = false;
|
680
|
735
|
break;
|
681
|
736
|
case SYS_KEY_DOWN:
|
682
|
|
- mMapList.prev();
|
683
|
|
-
|
684
|
|
- if (!mMapList.backward())
|
685
|
|
- {
|
686
|
|
- mMapList.finish();
|
687
|
|
- }
|
688
|
|
-
|
689
|
|
- if (mMapList.current())
|
690
|
|
- {
|
691
|
|
- mText->SetString(textMenu, "Load %s?", mMapList.current());
|
692
|
|
- }
|
693
|
|
- else
|
694
|
|
- {
|
695
|
|
- mText->SetString(textMenu, "See README for map install");
|
696
|
|
- }
|
|
737
|
+ menuMapListMove('b', true);
|
697
|
738
|
break;
|
698
|
739
|
case SYS_KEY_UP:
|
699
|
|
- mMapList.next();
|
700
|
|
-
|
701
|
|
- if (!mMapList.forward())
|
702
|
|
- {
|
703
|
|
- mMapList.start();
|
704
|
|
- }
|
705
|
|
-
|
706
|
|
- if (mMapList.current())
|
707
|
|
- {
|
708
|
|
- mText->SetString(textMenu, "Load %s?", mMapList.current());
|
709
|
|
- }
|
710
|
|
- else
|
711
|
|
- {
|
712
|
|
- mText->SetString(textMenu, "See README for map install");
|
713
|
|
- }
|
|
740
|
+ menuMapListMove('f', true);
|
|
741
|
+ break;
|
|
742
|
+ case SYS_KEY_LEFT:
|
|
743
|
+ menuMapListMove('p', true);
|
|
744
|
+ break;
|
|
745
|
+ case SYS_KEY_RIGHT:
|
|
746
|
+ menuMapListMove('n', true);
|
|
747
|
+ break;
|
714
|
748
|
}
|
715
|
749
|
|
716
|
750
|
return;
|