Restore style

develop
ymber 2020-04-04 11:17:10 +01:00
parent 5d032b3d9c
commit 9b813aab49
No known key found for this signature in database
GPG Key ID: 67C1F45D80C15567
1 changed files with 9 additions and 9 deletions

@ -3,22 +3,22 @@
struct embark_profile_name_hook : df::viewscreen_setupdwarfgamest { struct embark_profile_name_hook : df::viewscreen_setupdwarfgamest {
typedef df::viewscreen_setupdwarfgamest interpose_base; typedef df::viewscreen_setupdwarfgamest interpose_base;
DEFINE_VMETHOD_INTERPOSE( void, feed, ( std::set<df::interface_key> *input ) ) { DEFINE_VMETHOD_INTERPOSE(void, feed, (std::set<df::interface_key> *input)) {
int ch = -1; int ch = -1;
for( auto it = input->begin(); ch == -1 && it != input->end(); ++it ) { for (auto it = input->begin(); ch == -1 && it != input->end(); ++it) {
ch = Screen::keyToChar( *it ); ch = Screen::keyToChar(*it);
} }
// Intercept all printable characters except space. // Intercept all printable characters except space.
// If space is intercepted the shift-space abort key will not work. // If space is intercepted the shift-space abort key will not work.
if( in_save_profile && ch >= 33 && ch <= 126 ) { if (in_save_profile && ch >= 33 && ch <= 126) {
profile_name.push_back( ( char )ch ); profile_name.push_back((char)ch);
} else { } else {
if( input->count( df::interface_key::LEAVESCREEN ) ) { if (input->count(df::interface_key::LEAVESCREEN)) {
input->insert( df::interface_key::SETUPGAME_SAVE_PROFILE_ABORT ); input->insert(df::interface_key::SETUPGAME_SAVE_PROFILE_ABORT);
} }
INTERPOSE_NEXT( feed )( input ); INTERPOSE_NEXT(feed)(input);
} }
} }
}; };
IMPLEMENT_VMETHOD_INTERPOSE( embark_profile_name_hook, feed ); IMPLEMENT_VMETHOD_INTERPOSE(embark_profile_name_hook, feed);