changed refresh_config to reload_cfg

pull/58/head
FlightlessMango 4 years ago
parent a8c5221c6e
commit fe69ec2955

@ -71,6 +71,7 @@ A partial list of parameters are below. See the config file for a complete list.
| `position=` | Location of the hud: `top-left` (default), `top-right`, `bottom-left`, `bottom-right` | | `position=` | Location of the hud: `top-left` (default), `top-right`, `bottom-left`, `bottom-right` |
| `no_display` | Hide the hud by default | | `no_display` | Hide the hud by default |
| `toggle_hud=`<br>`toggle_logging=` | Modifiable toggle hotkeys. Default are F12 and F2, respectively. | | `toggle_hud=`<br>`toggle_logging=` | Modifiable toggle hotkeys. Default are F12 and F2, respectively. |
| `reload_cfg=` | Change keybind for reloading the config |
| `time`<br>`time_format=%T` | Displays local time. See [std::put_time](https://en.cppreference.com/w/cpp/io/manip/put_time) for formatting help. | | `time`<br>`time_format=%T` | Displays local time. See [std::put_time](https://en.cppreference.com/w/cpp/io/manip/put_time) for formatting help. |
| `gpu_color`<br>`gpu_color`<br>`vram_color`<br>`ram_color`<br>`io_color`<br>`engine_color`<br>`frametime_color`<br>`background_color`<br>`text_color` | Change default colors: `gpu_color=RRGGBB`| | `gpu_color`<br>`gpu_color`<br>`vram_color`<br>`ram_color`<br>`io_color`<br>`engine_color`<br>`frametime_color`<br>`background_color`<br>`text_color` | Change default colors: `gpu_color=RRGGBB`|
| `alpha` | Set the opacity of all text and frametime graph `0.0-1.0` | | `alpha` | Set the opacity of all text and frametime graph `0.0-1.0` |
@ -89,6 +90,7 @@ Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_s
## Keybindings ## Keybindings
- `F2` : Toggle Logging - `F2` : Toggle Logging
- `F4` : Reload Config
- `F12`: Toggle Hud - `F12`: Toggle Hud
## MangoHud FPS logging ## MangoHud FPS logging

@ -3,8 +3,8 @@
#include "X11/keysym.h" #include "X11/keysym.h"
#include "mesa/util/os_time.h" #include "mesa/util/os_time.h"
double elapsedF2, elapsedF12, elapsedRefreshConfig; double elapsedF2, elapsedF12, elapsedReloadCfg;
uint64_t last_f2_press, last_f12_press, refresh_config_press; uint64_t last_f2_press, last_f12_press, reload_cfg_press;
pthread_t f2; pthread_t f2;
char *displayid = getenv("DISPLAY"); char *displayid = getenv("DISPLAY");
Display *dpy = XOpenDisplay(displayid); Display *dpy = XOpenDisplay(displayid);

@ -884,7 +884,7 @@ void check_keybinds(struct overlay_params& params){
uint64_t now = os_time_get(); /* us */ uint64_t now = os_time_get(); /* us */
elapsedF2 = (double)(now - last_f2_press); elapsedF2 = (double)(now - last_f2_press);
elapsedF12 = (double)(now - last_f12_press); elapsedF12 = (double)(now - last_f12_press);
elapsedRefreshConfig = (double)(now - refresh_config_press); elapsedReloadCfg = (double)(now - reload_cfg_press);
if (elapsedF2 >= 500000 && mangohud_output_env){ if (elapsedF2 >= 500000 && mangohud_output_env){
if (key_is_pressed(params.toggle_logging)){ if (key_is_pressed(params.toggle_logging)){
@ -906,9 +906,9 @@ void check_keybinds(struct overlay_params& params){
} }
if (elapsedRefreshConfig >= 500000){ if (elapsedRefreshConfig >= 500000){
if (key_is_pressed(params.refresh_config)){ if (key_is_pressed(params.reload_cfg)){
parse_overlay_config(&params, getenv("MANGOHUD_CONFIG")); parse_overlay_config(&params, getenv("MANGOHUD_CONFIG"));
refresh_config_press = now; reload_cfg_press = now;
} }
} }
} }

@ -101,7 +101,7 @@ parse_toggle_logging(const char *str)
} }
static KeySym static KeySym
parse_refresh_config(const char *str) parse_reload_cfg(const char *str)
{ {
return XStringToKeysym(str); return XStringToKeysym(str);
} }
@ -305,7 +305,7 @@ parse_overlay_config(struct overlay_params *params,
params->control = -1; params->control = -1;
params->toggle_hud = XK_F12; params->toggle_hud = XK_F12;
params->toggle_logging = XK_F2; params->toggle_logging = XK_F2;
params->refresh_config = XK_F4; params->reload_cfg = XK_F4;
params->fps_limit = 0; params->fps_limit = 0;
params->vsync = -1; params->vsync = -1;
params->gl_vsync = -1; params->gl_vsync = -1;

@ -75,7 +75,7 @@ extern "C" {
OVERLAY_PARAM_CUSTOM(font_size) \ OVERLAY_PARAM_CUSTOM(font_size) \
OVERLAY_PARAM_CUSTOM(toggle_hud) \ OVERLAY_PARAM_CUSTOM(toggle_hud) \
OVERLAY_PARAM_CUSTOM(toggle_logging) \ OVERLAY_PARAM_CUSTOM(toggle_logging) \
OVERLAY_PARAM_CUSTOM(refresh_config) \ OVERLAY_PARAM_CUSTOM(reload_cfg) \
OVERLAY_PARAM_CUSTOM(crosshair_size) \ OVERLAY_PARAM_CUSTOM(crosshair_size) \
OVERLAY_PARAM_CUSTOM(offset_x) \ OVERLAY_PARAM_CUSTOM(offset_x) \
OVERLAY_PARAM_CUSTOM(offset_y) \ OVERLAY_PARAM_CUSTOM(offset_y) \
@ -135,7 +135,7 @@ struct overlay_params {
float background_alpha, alpha; float background_alpha, alpha;
KeySym toggle_hud; KeySym toggle_hud;
KeySym toggle_logging; KeySym toggle_logging;
KeySym refresh_config; KeySym reload_cfg;
std::string time_format; std::string time_format;
}; };

Loading…
Cancel
Save