mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-26 18:10:35 +00:00
config:: add_edit accepts key parameter
This commit is contained in:
parent
79165ae014
commit
2add515fbf
14
config.cpp
14
config.cpp
@ -3714,10 +3714,24 @@ EX void add_edit_ptr(void *val) {
|
||||
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
|
||||
template<class T> void add_edit(T& val) {
|
||||
add_edit_ptr(&val);
|
||||
}
|
||||
|
||||
template<class T> void add_edit(T& val, char key) {
|
||||
add_edit_ptr(&val, key);
|
||||
}
|
||||
#endif
|
||||
|
||||
EX void find_setting() {
|
||||
|
Loading…
Reference in New Issue
Block a user