From 770dd20613efbca83519fbf33ec99acf642eebd4 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 9 Jul 2018 18:10:28 +0200 Subject: [PATCH] shift+f2 to shift+f4 can now disable HUD, FPS, and the map --- basegraph.cpp | 2 ++ config.cpp | 3 +++ control.cpp | 15 +++++++++++++++ graph.cpp | 3 ++- help.cpp | 5 ++++- hyper.h | 2 +- 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/basegraph.cpp b/basegraph.cpp index fe1ba25a..03fbbf54 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -1049,6 +1049,8 @@ void saveHighQualityShot(const char *fname, const char *caption, int fade) { #endif drawfullmap(); + drawStats(); + callhooks(hooks_hqshot, &glbuf); if(fade < 255) diff --git a/config.cpp b/config.cpp index 535a8a25..b266b55e 100644 --- a/config.cpp +++ b/config.cpp @@ -259,6 +259,9 @@ void initConfig() { addsaver(gp::param.first, "goldberg-x", gp::param.first); addsaver(gp::param.second, "goldberg-y", gp::param.second); + addsaver(nohud, "no-hud", false); + addsaver(nofps, "no-fps", false); + #if CAP_SHMUP shmup::initConfig(); #endif diff --git a/control.cpp b/control.cpp index 488114f0..a928f253 100644 --- a/control.cpp +++ b/control.cpp @@ -801,6 +801,21 @@ void handle_event(SDL_Event& ev) { if(needConfirmation() && !(cmode & sm::MISSION)) showMissionScreen(); else quitmainloop = true; } + + if(sym == SDLK_F4 && anyshift) { + nomap = !nomap; + sym = 0; + } + + if(sym == SDLK_F2 && anyshift) { + nohud = !nohud; + sym = 0; + } + + if(sym == SDLK_F3 && anyshift) { + nofps = !nofps; + sym = 0; + } handlekey(sym, uni); } diff --git a/graph.cpp b/graph.cpp index bcf4e9b3..d2f2f025 100644 --- a/graph.cpp +++ b/graph.cpp @@ -35,6 +35,7 @@ int ticks; int frameid; bool camelotcheat; +bool nomap; eItem orbToTarget; eMonster monsterToSummon; @@ -5486,7 +5487,7 @@ void drawfullmap() { } */ clearaura(); - drawthemap(); + if(!nomap) drawthemap(); if(!inHighQual) { if((cmode & sm::NORMAL) && !rug::rugged) { if(multi::players > 1) { diff --git a/help.cpp b/help.cpp index 197bdb45..461a1c39 100644 --- a/help.cpp +++ b/help.cpp @@ -46,7 +46,10 @@ vector extra_keys = { "ctrl + mousewheel = change zoom", "ctrl + shift + mousewheel = change both projection and zoom", "ctrl + hold middle button = move the screen", - "shift + middle button = reset position" + "shift + middle button = reset position", + "shift + F2 = disable the HUD", + "shift + F3 = disable the FPS", + "shift + F4 = disable the map" }; void buildHelpText() { diff --git a/hyper.h b/hyper.h index ad42f308..26509d3d 100644 --- a/hyper.h +++ b/hyper.h @@ -3044,7 +3044,7 @@ static const int max_vec = (1<<14); string helptitle(string s, int col); pair cell_to_pair(cell *c); -extern bool nohud, nofps; +extern bool nohud, nofps, nomap; template array make_array(T a, T b, T c) { array x; x[0] = a; x[1] = b; x[2] = c; return x; } template array make_array(T a, T b) { array x; x[0] = a; x[1] = b; return x; }