1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-10 15:59:53 +00:00

config:: add_edit accepts key parameter

This commit is contained in:
Zeno Rogue 2023-11-30 12:25:13 +01:00
parent 79165ae014
commit 2add515fbf

View File

@ -3714,10 +3714,24 @@ EX void add_edit_ptr(void *val) {
if(found != 1) println(hlog, "found = ", found); if(found != 1) println(hlog, "found = ", found);
} }
EX void add_edit_ptr(void *val, char key) {
int found = 0;
for(auto& fs: params) {
fs.second->check_change();
if(fs.second->affects(val))
fs.second->show_edit_option(key), found++;
}
if(found != 1) println(hlog, "found = ", found);
}
#if HDR #if HDR
template<class T> void add_edit(T& val) { template<class T> void add_edit(T& val) {
add_edit_ptr(&val); add_edit_ptr(&val);
} }
template<class T> void add_edit(T& val, char key) {
add_edit_ptr(&val, key);
}
#endif #endif
EX void find_setting() { EX void find_setting() {