mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	config:: add_edit accepts key parameter
This commit is contained in:
		
							
								
								
									
										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() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue