Push params to HudElements options

pull/379/head
FlightlessMango 4 years ago
parent 7471d42cac
commit 378cc1e089

@ -6,7 +6,7 @@
#include "config.h"
#include "file_utils.h"
#include "string_utils.h"
#include "hud_elements.h"
std::string program_name;
void parseConfigLine(std::string line, std::unordered_map<std::string,std::string>& options) {
@ -24,8 +24,10 @@ void parseConfigLine(std::string line, std::unordered_map<std::string,std::strin
param = line.substr(0, equal);
trim(param);
trim(value);
if (!param.empty())
if (!param.empty()){
HUDElements.options.push_back(param);
options[param] = value;
}
}
void enumerate_config_files(std::vector<std::string>& paths)
@ -67,6 +69,7 @@ void enumerate_config_files(std::vector<std::string>& paths)
}
void parseConfigFile(overlay_params& params) {
HUDElements.options.clear();
params.options.clear();
std::vector<std::string> paths;
const char *cfg_file = getenv("MANGOHUD_CONFIGFILE");

@ -0,0 +1,3 @@
#include "hud_elements.h"
HudElements HUDElements;

@ -0,0 +1,9 @@
#pragma once
#include "overlay.h"
#include "overlay_params.h"
class HudElements{
public:
std::vector<std::string> options;
};
extern HudElements HUDElements;

@ -27,6 +27,7 @@ foreach s : ['overlay.frag', 'overlay.vert']
endforeach
vklayer_files = files(
'hud_elements.cpp',
'overlay.cpp',
'overlay_params.cpp',
'font.cpp',

Loading…
Cancel
Save