X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FDevtools%2FConsoleCmds.cpp;h=e1e553ed08ec517e1c103de0bfa44d7095bf4c72;hb=5fca41ab430df85d6dd620a7f4130df01bc1430f;hp=fba2400a3277b01ee1548197b4a8551db39073fa;hpb=8139604f6d9f7014ef516371895c72fabd55f828;p=lugaru.git diff --git a/Source/Devtools/ConsoleCmds.cpp b/Source/Devtools/ConsoleCmds.cpp index fba2400..e1e553e 100644 --- a/Source/Devtools/ConsoleCmds.cpp +++ b/Source/Devtools/ConsoleCmds.cpp @@ -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*) @@ -309,11 +321,6 @@ void ch_save(const char* args) fclose(tfile); } -void ch_cellar(const char*) -{ - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Furdarko.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); -} - void ch_tint(const char* args) { sscanf(args, "%f%f%f", &tintr, &tintg, &tintb); @@ -438,6 +445,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; @@ -467,39 +487,14 @@ void ch_wolfie(const char*) set_proportion(0, "1 1 1 1"); } -void ch_wolf(const char*) -{ - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Wolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); -} - -void ch_snowwolf(const char*) -{ - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/SnowWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); -} - -void ch_darkwolf(const char*) -{ - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/DarkWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); -} - void ch_lizardwolf(const char*) { - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/LizardWolf.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); -} - -void ch_white(const char*) -{ - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Fur.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); + Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/FurWolfLizard.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } -void ch_brown(const char*) +void ch_darko(const char*) { - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Fur3.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); -} - -void ch_black(const char*) -{ - Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/Fur2.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); + Person::players[0]->skeleton.drawmodel.textureptr.load("Textures/FurDarko.jpg", 1, &Person::players[0]->skeleton.skinText[0], &Person::players[0]->skeleton.skinsize); } void ch_sizemin(const char*) @@ -555,7 +550,7 @@ void ch_hs(const char* args) strcat(Hotspot::hotspots.back().text, "\n"); } -void ch_dialogue(const char* args) +void ch_dialog(const char* args) { int type; char buf1[32]; @@ -570,22 +565,23 @@ void ch_dialogue(const char* args) Dialog::whichdialogue = Dialog::dialogs.size(); } -void ch_fixdialogue(const char* args) +void ch_fixdialog(const char* args) { char buf1[32]; - int whichdi; + int whichdlg = 0; - sscanf(args, "%d %31s", &whichdi, buf1); + sscanf(args, "%d %31s", &whichdlg, buf1); std::string filename = std::string("Dialogues/") + buf1 + ".txt"; - Dialog::dialogs[whichdi] = Dialog(Dialog::dialogs[whichdi].type, filename); + Dialog::dialogs[whichdlg] = Dialog(Dialog::dialogs[whichdlg].type, filename); } void ch_fixtype(const char* args) { - int dlg; - sscanf(args, "%d", &dlg); - Dialog::dialogs[0].type = dlg; + int whichdlg = 0; + int type = 0; + sscanf(args, "%d %d", &whichdlg, &type); + Dialog::dialogs[whichdlg].type = type; } void ch_fixrotation(const char*) @@ -594,11 +590,27 @@ void ch_fixrotation(const char*) Dialog::currentDialog().participantyaw[playerId] = Person::players[playerId]->yaw; } -void ch_ddialogue(const char*) +void ch_ddialog(const char* args) { - if (!Dialog::dialogs.empty()) { + if (Dialog::dialogs.empty() || Dialog::inDialog()) { + return; + } + + int dlg = -1; + sscanf(args, "%d", &dlg); + if (dlg == -1) { + // Remove last entry Dialog::dialogs.pop_back(); + return; } + + if (dlg >= int(Dialog::dialogs.size())) { + // Invalid index, abort + return; + } + + // Erase given index, higher indexes will be decreased by 1 + Dialog::dialogs.erase(Dialog::dialogs.begin() + dlg); } void ch_dhs(const char*)