]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Devtools/ConsoleCmds.cpp
Devtools: Add clotheslist cmd and fix devkeys in console
[lugaru.git] / Source / Devtools / ConsoleCmds.cpp
index f6e9dc83b162c0e453a5f394445fe7ea9ac7c4f1..10f37e81398eb6cbdf3a0a9701911d38cb04f848 100644 (file)
@@ -160,6 +160,18 @@ static void set_clothes(int pnum, const char* args)
     Person::players[pnum]->DoMipmaps();
 }
 
+static void list_clothes(int pnum)
+{
+    printf("Clothes from player %d:\n", pnum);
+    for (int i = 0; i < Person::players[pnum]->numclothes; i++) {
+        printf("%s (%f %f %f)\n",
+               Person::players[pnum]->clothes[i],
+               Person::players[pnum]->clothestintr[i],
+               Person::players[pnum]->clothestintg[i],
+               Person::players[pnum]->clothestintb[i]);
+    }
+}
+
 /* Console commands themselves */
 
 void ch_quit(const char*)
@@ -438,6 +450,19 @@ void ch_clothesnear(const char* args)
     }
 }
 
+void ch_clotheslist(const char*)
+{
+    list_clothes(0);
+}
+
+void ch_clotheslistnear(const char*)
+{
+    int closest = findClosestPlayer();
+    if (closest >= 0) {
+        list_clothes(closest);
+    }
+}
+
 void ch_belt(const char*)
 {
     Person::players[0]->skeleton.clothes = !Person::players[0]->skeleton.clothes;