game/debugging: Add a new imgui menu to filter debug text and adjust imgui config settings (#2085)

This adds a new ImGUI menu to help filter out the clutter on screen.


https://user-images.githubusercontent.com/13153231/210192912-b1c28319-bacb-449c-ad7f-e7308fb75f50.mp4

This also:
- moves the imgui display bool into a game specific config file (you can
hide it in jak1, and not in jak2)
- the config file also persists the settings from this menu (except the
filters for now, future TODO)
- there is a new `ignore_imgui_hide_keybind` in this file to ignore
hiding it when you press Alt
This commit is contained in:
Tyler Wilding
2023-01-02 09:45:38 -05:00
committed by GitHub
parent bb94c84d4b
commit 9f53edae7a
20 changed files with 257 additions and 46 deletions
+16
View File
@@ -1,9 +1,15 @@
#include "StringUtil.h"
#include <regex>
namespace str_util {
const std::string WHITESPACE = " \n\r\t\f\v";
bool contains(const std::string& s, const std::string& substr) {
return s.find(substr) != std::string::npos;
}
bool starts_with(const std::string& s, const std::string& prefix) {
return s.rfind(prefix) == 0;
}
@@ -31,4 +37,14 @@ int line_count(const std::string& str) {
}
return result;
}
// NOTE - this won't work running within gk.exe!
bool valid_regex(const std::string& regex) {
try {
std::regex re(regex);
} catch (const std::regex_error& e) {
return false;
}
return true;
}
} // namespace str_util