From: RĂ©mi Verschelde Date: Sat, 10 Dec 2016 19:31:46 +0000 (+0100) Subject: Rename debug mode to dev tools X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=2b4a9af9f7693a7715ae77f491157baac7257b10;p=lugaru.git Rename debug mode to dev tools The new config is then "Devtools" and the command line option is --devtools, -d. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 793cb70..087eafe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,6 +289,6 @@ endif(APPLE) install(FILES ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_SOURCE_DIR}/CONTENT-LICENSE.txt ${CMAKE_SOURCE_DIR}/COPYING.txt - ${CMAKE_SOURCE_DIR}/DEBUG-OPTIONS.txt + ${CMAKE_SOURCE_DIR}/DEVTOOLS.txt ${CMAKE_SOURCE_DIR}/README.md DESTINATION ${LUGARU_DOCDIR}) diff --git a/DEBUG-OPTIONS.txt b/DEBUG-OPTIONS.txt deleted file mode 100644 index 945f099..0000000 --- a/DEBUG-OPTIONS.txt +++ /dev/null @@ -1,119 +0,0 @@ -Lugaru - ----------Pass --debug option to the binary for these to work---------- - -Note: debug key must be pressed as if on a qwerty - -~=console (map mapname, save mapname, quit) -tab=minimap - -super+z = restart level -shift+k = win level - -alt+h = give 2000 health -alt+j = toggle snow/grass/desert -alt+c = toggle cameramode -alt+b = slow motion (with motion blur that might work) -alt+n = ragdoll -alt+x = change weapon of nearby player (main player if ctrl is pressed) -alt+f = spontaneously combust -alt+o = change enemy's skin (main player if ctrl is pressed) -alt+shift+o = change enemy's type (rabbit/wolf) (main player if ctrl is pressed) -alt+i = explode nearby head -alt+shift+i = explode nearby enemy - - -Map editor: -alt+m = toggle editor mode -m = place object -p = place enemy -shift-p = place waypoint -delete = delete most recently made object -shift-delete = delete most recently made player -up/down = change size of next object -control+up/down = change tilt of next object -left/right = change rotation of next object -shift+left/right = change type of next object - -control+p = make/connect pathfind waypoint -period/comma = select pathfind waypoints -shift+comma = delete pathfind waypoint - -Console commands: -f is floating point, i is integer, b is boolean, str is string. - -Map mapname where mapname is the name of a map in the maps folder -Save mapname where mapname is an unused filename -Cellar door, rambo, kungfu, white, brown, black = change skins - -Tintr f = red clothes color from 0 to 1 -Tintg f = green clothes color from 0 to 1 -Tintb f = blue clothes color from 0 to 1 -Tint f f f = r,g,b clothes colors from 0 to 1 -Noclothes = remove all clothes -Clothes str = add clothes str.png - -Included clothes include: -shirt -longsleeve -earwrap -footwrap -pants -fancypants -scar -headband -leatherwristleft -leatherwristright -leatherarmor -leatherpants - -Skybox = toggle skybox (i.e. turn off to get fog) -Sky Tint f f f = r,g,b colors from 0 to 1 for the sky -Sky Light f f f = r,g,b colors from 0 to 1 for the lighting - -Speed f = set player speed -Strength f = set player power -Power f = set player power -Protection f f f = set high,medium,low resistance to blunt attacks -Armor f f f = set high,medium,low resistance to sharp attacks - -slomo f = set the slomo speed -slofreq i = set the slomo sound frequency - -tutorial b = toggle tutorial mode on/off -hostile b = toggle hostility - -type active/sitting/sitting wall/sleeping/dead1/dead2/dead3/dead4 = set initial state -path keepwalking/pause = determine whether enemies walk through the next pathpoint or pause briefly - -mapkilleveryone = set the map objective to kill everyone -mapgosomewhere = set the map objective to go somewhere -mapkillsomeone = set the map objective to kill a specific enemy -mapkillmost = set the map objective to kill everyone but one - -hs f i str = set the size, type, and text for a hotspot -(type 0 = static, display text -type 1-10 = attached to player 1-10, display text -type 11-20 = attached to player 1-10, must kill to win -type -1 = win if approached) - -dhs = delete last hotspot - -dialogue str = load the dialogue str.txt and enter directing mode (fly around, press numpad 1-10 to change their head target, press 1-10 for who is saying each line and to go to next line) - -ddialogue = delete last dialogue - -play i = play dialogue #i - -immobile = make immobile; this can increase fps -mobile = make mobile - -proportion f f f f = set head, body, arm and leg proportion (1 is default) - -viewdistance x= set the far clipping plane (1 is default) -fadestart x= set what fraction of the viewdistance an object must pass to begin fading (1 is default) - -funnybunny = set player to rabbit -wolfieisgod = set player to wolf - -quit = quit diff --git a/DEVTOOLS.txt b/DEVTOOLS.txt new file mode 100644 index 0000000..d765ab6 --- /dev/null +++ b/DEVTOOLS.txt @@ -0,0 +1,136 @@ +Lugaru Developer Tools +====================== + +Activation +---------- + +- Pass --devtools option to the binary for these to work +- Or add the following to your config.txt: + + Devtools: + 1 + +Key bindings +------------ + +Note: dev keys must be pressed as if on a QWERTY keyboard. + +General +~~~~~~~ + +~ = console (map mapname, save mapname, quit) +tab = minimap + +super+z = restart level +shift+k = win level + +alt+h = give 2000 health +alt+j = toggle snow/grass/desert +alt+c = toggle cameramode +alt+b = slow motion (with motion blur that might work) +alt+n = ragdoll +alt+x = change weapon of nearby player (main player if ctrl is pressed) +alt+f = spontaneously combust +alt+o = change enemy's skin (main player if ctrl is pressed) +alt+shift+o = change enemy's type (rabbit/wolf) (main player if ctrl is pressed) +alt+i = explode nearby head +alt+shift+i = explode nearby enemy + +Map editor +~~~~~~~~~~ + +alt+m = toggle editor mode +m = place object +p = place enemy +shift-p = place waypoint +delete = delete most recently made object +shift-delete = delete most recently made player +up/down = change size of next object +control+up/down = change tilt of next object +left/right = change rotation of next object +shift+left/right = change type of next object + +control+p = make/connect pathfind waypoint +period/comma = select pathfind waypoints +shift+comma = delete pathfind waypoint + +Console commands +---------------- + +f is floating point, i is integer, b is boolean, str is string. + +Map mapname where mapname is the name of a map in the maps folder +Save mapname where mapname is an unused filename +Cellar door, rambo, kungfu, white, brown, black = change skins + +Tintr f = red clothes color from 0 to 1 +Tintg f = green clothes color from 0 to 1 +Tintb f = blue clothes color from 0 to 1 +Tint f f f = r,g,b clothes colors from 0 to 1 +Noclothes = remove all clothes +Clothes str = add clothes str.png + +Included clothes include: +Shirt +LongSleeve +EarWrap +FootWrap +Pants +FancyPants +Scar +Headband +LeatherWristLeft +LeatherWristRight +LeatherArmor +LeatherPants + +Skybox = toggle skybox (i.e. turn off to get fog) +Sky Tint f f f = r,g,b colors from 0 to 1 for the sky +Sky Light f f f = r,g,b colors from 0 to 1 for the lighting + +Speed f = set player speed +Strength f = set player power +Power f = set player power +Protection f f f = set high,medium,low resistance to blunt attacks +Armor f f f = set high,medium,low resistance to sharp attacks + +slomo f = set the slomo speed +slofreq i = set the slomo sound frequency + +tutorial b = toggle tutorial mode on/off +hostile b = toggle hostility + +type active/sitting/sitting wall/sleeping/dead1/dead2/dead3/dead4 = set initial state +path keepwalking/pause = determine whether enemies walk through the next pathpoint or pause briefly + +mapkilleveryone = set the map objective to kill everyone +mapgosomewhere = set the map objective to go somewhere +mapkillsomeone = set the map objective to kill a specific enemy +mapkillmost = set the map objective to kill everyone but one + +hs f i str = set the size, type, and text for a hotspot +(type 0 = static, display text +type 1-10 = attached to player 1-10, display text +type 11-20 = attached to player 1-10, must kill to win +type -1 = win if approached) + +dhs = delete last hotspot + +dialogue str = load the dialogue str.txt and enter directing mode (fly around, press numpad 1-10 to change their head target, press 1-10 for who is saying each line and to go to next line) + +ddialogue = delete last dialogue + +play i = play dialogue #i + +immobile = make immobile; this can increase fps +mobile = make mobile + +proportion f f f f = set head, body, arm and leg proportion (1 is default) + +viewdistance x= set the far clipping plane (1 is default) +fadestart x= set what fraction of the viewdistance an object must pass to begin fading (1 is default) + +funnybunny = set player to rabbit +wolfieisgod = set player to wolf + +quit = quit diff --git a/Source/Account.cpp b/Source/Account.cpp index b3d42c7..bfaa3d4 100644 --- a/Source/Account.cpp +++ b/Source/Account.cpp @@ -27,7 +27,7 @@ along with Lugaru. If not, see . using namespace std; -extern bool debugmode; +extern bool devtools; vector Account::accounts = vector(); @@ -100,7 +100,7 @@ void Account::winCampaignLevel(int choice, float score, float time) void Account::winLevel(int level, float score, float time) { - if (!debugmode) { + if (!devtools) { if (score > highscore[level]) highscore[level] = score; if (time < fasttime[level] || fasttime[level] == 0) diff --git a/Source/Game.h b/Source/Game.h index 68a23a3..96ec815 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -217,7 +217,7 @@ SDL_bool sdlEventProc(const SDL_Event &e); -enum optionIndex { UNKNOWN, HELP, FULLSCREEN, NOMOUSEGRAB, SOUND, OPENALINFO, SHOWRESOLUTIONS, DEBUG }; +enum optionIndex { UNKNOWN, HELP, FULLSCREEN, NOMOUSEGRAB, SOUND, OPENALINFO, SHOWRESOLUTIONS, DEVTOOLS }; /* Number of options + 1 */ const int commandLineOptionsNumber = 9; diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index a0c92d5..87a982b 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -62,7 +62,7 @@ extern float motionbluramount; extern bool isclient; extern bool alwaysblur; extern bool velocityblur; -extern bool debugmode; +extern bool devtools; extern int mainmenu; extern int bloodtoggle; extern int difficulty; @@ -1150,7 +1150,7 @@ int Game::DrawGLScene(StereoSide side) glColor4f(.5, .5, .5, 1); - if ((texttoggle || editorenabled) && debugmode && !mainmenu) { + if ((texttoggle || editorenabled) && devtools && !mainmenu) { sprintf (string, "The framespersecond is %d.", (int)(fps)); text->glPrint(10, 30, string, 0, .8, 1024, 768); diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 5dfc393..e738a42 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -90,7 +90,7 @@ extern bool mousejump; extern float viewdistance; extern bool freeze; extern XYZ windvector; -extern bool debugmode; +extern bool devtools; int leveltheme; extern int mainmenu; extern int oldmainmenu; @@ -1639,10 +1639,10 @@ void doTutorial() } } -void doDebugKeys() +void doDevKeys() { float headprop, bodyprop, armprop, legprop; - if (!debugmode) { + if (!devtools) { return; } @@ -4604,14 +4604,14 @@ void Game::Tick() leveltime += multiplier; //keys - if (Input::isKeyDown(SDL_SCANCODE_LALT) && Input::isKeyPressed(SDL_SCANCODE_V) && debugmode) { + if (Input::isKeyDown(SDL_SCANCODE_LALT) && Input::isKeyPressed(SDL_SCANCODE_V) && devtools) { freeze = !freeze; if (freeze) { OPENAL_SetFrequency(OPENAL_ALL); } } - if (Input::isKeyPressed(consolekey) && debugmode) { + if (Input::isKeyPressed(consolekey) && devtools) { console = !console; if (console) { OPENAL_SetFrequency(OPENAL_ALL); @@ -4976,7 +4976,7 @@ void Game::Tick() hawkcalldelay = 16 + abs(Random() % 8); } - doDebugKeys(); + doDevKeys(); doAttacks(); @@ -5002,7 +5002,7 @@ void Game::Tick() (whichlevel != -2 && (Input::isKeyDown(SDL_SCANCODE_Z) && Input::isKeyDown(SDL_SCANCODE_LGUI) && - debugmode) || + devtools) || (Input::isKeyDown(jumpkey) && !respawnkeydown && !oldattackkey && @@ -5772,7 +5772,7 @@ void Game::Tick() Person::players[i]->crouchtogglekeydown = 1; } else Person::players[i]->velocity.y = 5; - if (mousejump && i == 0 && debugmode) { + if (mousejump && i == 0 && devtools) { if (!Person::players[i]->isLanding()) Person::players[i]->tempdeltav = deltav; if (Person::players[i]->tempdeltav < 0) @@ -5797,7 +5797,7 @@ void Game::Tick() if (Person::players[i]->animTarget == jumpupanim && (((!floatjump && !editorenabled) || - !debugmode) || + !devtools) || Person::players[i]->aitype != playercontrolled)) { if (Person::players[i]->jumppower > multiplier * 6) { Person::players[i]->velocity.y += multiplier * 6; @@ -5808,7 +5808,7 @@ void Game::Tick() Person::players[i]->jumppower = 0; } } - if (((floatjump || editorenabled) && debugmode) && i == 0) + if (((floatjump || editorenabled) && devtools) && i == 0) Person::players[i]->velocity.y += multiplier * 30; } diff --git a/Source/Globals.cpp b/Source/Globals.cpp index c5a336e..d8d430d 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -148,7 +148,7 @@ float envsoundvol[30] = {0}; float envsoundlife[30] = {0}; int numenvsounds; -bool debugmode = false; +bool devtools = false; bool gamestarted = false; diff --git a/Source/Menu.cpp b/Source/Menu.cpp index 9e08d74..af6fe29 100644 --- a/Source/Menu.cpp +++ b/Source/Menu.cpp @@ -329,7 +329,7 @@ void Menu::updateControlsMenu() setText(6, (string)"Draw: " + (keyselect == 6 ? "_" : Input::keyToChar(drawkey))); setText(7, (string)"Throw: " + (keyselect == 7 ? "_" : Input::keyToChar(throwkey))); setText(8, (string)"Attack: " + (keyselect == 8 ? "_" : Input::keyToChar(attackkey))); - if (debugmode) { + if (devtools) { setText(9, (string)"Console: " + (keyselect == 9 ? "_" : Input::keyToChar(consolekey))); } } @@ -389,10 +389,10 @@ void Menu::Load() addButton(6, "", 10 + 40, 160); addButton(7, "", 10 + 30, 120); addButton(8, "", 10 + 20, 80); - if (debugmode) { + if (devtools) { addButton(9, "", 10 + 10, 40); } - addButton(debugmode ? 10 : 9, "Back", 10, 10); + addButton(devtools ? 10 : 9, "Back", 10, 10); updateControlsMenu(); break; case 5: { @@ -688,11 +688,11 @@ void Menu::Tick() case 4: if (!waiting) { fireSound(); - if (selected < (debugmode ? 10 : 9) && keyselect == -1) + if (selected < (devtools ? 10 : 9) && keyselect == -1) keyselect = selected; if (keyselect != -1) setKeySelected(); - if (selected == (debugmode ? 10 : 9)) { + if (selected == (devtools ? 10 : 9)) { flash(); mainmenu = 3; } diff --git a/Source/Person.cpp b/Source/Person.cpp index acd6647..cada57b 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -523,7 +523,7 @@ void Person::CheckKick() * * USES: * GameTick/doPlayerCollisions - spread fire between players - * GameTick/doDebugKeys - press f to ignite + * GameTick/doDevKeys - press f to ignite * Person::DoStuff - spread fire from lit campfires and bushes */ void Person::CatchFire() diff --git a/Source/Settings.cpp b/Source/Settings.cpp index fd3e03d..e962d0b 100644 --- a/Source/Settings.cpp +++ b/Source/Settings.cpp @@ -52,7 +52,7 @@ void DefaultSettings() velocityblur = 0; volume = 0.8f; ambientsound = 1; - debugmode = 0; + devtools = 0; crouchkey = SDL_SCANCODE_LSHIFT; jumpkey = SDL_SCANCODE_SPACE; @@ -245,8 +245,8 @@ bool LoadSettings() ipstream >> damageeffects; } else if ( !strncmp(setting, "Text", 4) ) { ipstream >> texttoggle; - } else if ( !strncmp(setting, "Debug", 5) ) { - ipstream >> debugmode; + } else if ( !strncmp(setting, "Devtools", 5) ) { + ipstream >> devtools; } else if ( !strncmp(setting, "Show Points", 11) ) { ipstream >> showpoints; } else if ( !strncmp(setting, "Always Blur", 11) ) { diff --git a/Source/Settings.h b/Source/Settings.h index 942d163..ac14df3 100644 --- a/Source/Settings.h +++ b/Source/Settings.h @@ -40,7 +40,7 @@ extern float oldgamespeed; extern int difficulty; extern bool damageeffects; extern bool texttoggle; -extern bool debugmode; +extern bool devtools; extern bool showpoints; extern bool showdamagebar; extern bool alwaysblur; diff --git a/Source/main.cpp b/Source/main.cpp index 10f2459..f90f620 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -581,7 +581,7 @@ const option::Descriptor usage[] = {SOUND, OPENAL_OUTPUT_OSS, "", "force-oss", option::Arg::None, " --force-oss Force use of OSS back-end." }, {OPENALINFO, 0, "", "openal-info", option::Arg::None, " --openal-info Print info about OpenAL at launch." }, {SHOWRESOLUTIONS, 0, "", "showresolutions", option::Arg::None, " --showresolutions List the resolutions found by SDL at launch." }, - {DEBUG, 0, "d", "debug", option::Arg::None, " -d, --debug Activates console, level editor and debug information." }, + {DEVTOOLS, 0, "d", "devtools", option::Arg::None, " -d, --devtools Activates developer tools: console, level editor and debug information." }, {0,0,0,0,0,0} }; @@ -635,8 +635,8 @@ int main(int argc, char **argv) return 42; } - if (commandLineOptions[DEBUG]) { - debugmode = true; + if (commandLineOptions[DEVTOOLS]) { + devtools = true; } bool gameDone = false;