瀏覽代碼

Added vis and upf commands

Thomas Buck 11 年之前
父節點
當前提交
e4f6a401b9
共有 1 個檔案被更改,包括 36 行新增3 行删除
  1. 36
    3
      src/OpenRaider.cpp

+ 36
- 3
src/OpenRaider.cpp 查看文件

390
             return -25;
390
             return -25;
391
         }
391
         }
392
     } else if (strcmp(command, "portal") == 0) {
392
     } else if (strcmp(command, "portal") == 0) {
393
-
394
         if (args->size() > 0) {
393
         if (args->size() > 0) {
395
             bool b;
394
             bool b;
396
             if (readBool(args->at(0), &b) < 0) {
395
             if (readBool(args->at(0), &b) < 0) {
406
             getConsole().print("Invalid use of portal-command!");
405
             getConsole().print("Invalid use of portal-command!");
407
             return -27;
406
             return -27;
408
         }
407
         }
408
+    } else if (strcmp(command, "vis") == 0) {
409
+        if (args->size() > 0) {
410
+            bool b;
411
+            if (readBool(args->at(0), &b) < 0) {
412
+                getConsole().print("Pass BOOL to vis command!");
413
+                return -28;
414
+            }
415
+            if (b)
416
+                getRender().setFlags(Render::fUsePortals);
417
+            else
418
+                getRender().clearFlags(Render::fUsePortals);
419
+            getConsole().print("Portals are now %s", b ? "on" : "off");
420
+        } else {
421
+            getConsole().print("Invalid use of vis-command!");
422
+            return -29;
423
+        }
424
+    } else if (strcmp(command, "upf") == 0) {
425
+        if (args->size() > 0) {
426
+            bool b;
427
+            if (readBool(args->at(0), &b) < 0) {
428
+                getConsole().print("Pass BOOL to upf command!");
429
+                return -30;
430
+            }
431
+            if (b)
432
+                getRender().setFlags(Render::fUpdateRoomListPerFrame);
433
+            else
434
+                getRender().clearFlags(Render::fUpdateRoomListPerFrame);
435
+            getConsole().print("URLPF is now %s", b ? "on" : "off");
436
+        } else {
437
+            getConsole().print("Invalid use of upf-command!");
438
+            return -31;
439
+        }
409
     } else if (strcmp(command, "help") == 0) {
440
     } else if (strcmp(command, "help") == 0) {
410
         if (args->size() == 0) {
441
         if (args->size() == 0) {
411
             getConsole().print("Available commands:");
442
             getConsole().print("Available commands:");
425
             getConsole().print("  vmodel    - BOOL - View Model");
456
             getConsole().print("  vmodel    - BOOL - View Model");
426
             getConsole().print("  ralpha    - BOOL - Room Alpha");
457
             getConsole().print("  ralpha    - BOOL - Room Alpha");
427
             getConsole().print("  portal    - BOOL");
458
             getConsole().print("  portal    - BOOL");
459
+            getConsole().print("  vis       - BOOL - Use Portals");
460
+            getConsole().print("  upf       - BOOL - Update Room List Per Frame");
428
             getConsole().print("  help      - print command help");
461
             getConsole().print("  help      - print command help");
429
             getConsole().print("  quit      - exit OpenRaider");
462
             getConsole().print("  quit      - exit OpenRaider");
430
             getConsole().print("Use help COMMAND to get additional info");
463
             getConsole().print("Use help COMMAND to get additional info");
432
             return help(args->at(0));
465
             return help(args->at(0));
433
         } else {
466
         } else {
434
             getConsole().print("Invalid use of help-command");
467
             getConsole().print("Invalid use of help-command");
435
-            return -28;
468
+            return -32;
436
         }
469
         }
437
     } else {
470
     } else {
438
         getConsole().print("Unknown command: %s ", command);
471
         getConsole().print("Unknown command: %s ", command);
439
-        return -29;
472
+        return -33;
440
     }
473
     }
441
 
474
 
442
     return 0;
475
     return 0;

Loading…
取消
儲存