fix duplicate removal in editor help
The sort was in place for this purpose. Let's use it on the modifier keys, but not sort the regular keys, since the order matters for those. This isn't really the right way to do this from the start, but that'll be something that could be rewritten at another time given that our mappings are still pretty much hardcoded.
This commit is contained in:
+5
-3
@@ -5757,11 +5757,13 @@ static void ProcessKeyName( RString &s )
|
||||
s.Replace( "Key_", "" );
|
||||
}
|
||||
|
||||
static void ProcessKeyNames( vector<RString> &vs )
|
||||
static void ProcessKeyNames( vector<RString> &vs, bool doSort )
|
||||
{
|
||||
FOREACH( RString, vs, s )
|
||||
ProcessKeyName( *s );
|
||||
|
||||
if (doSort)
|
||||
sort( vs.begin(), vs.end() );
|
||||
vector<RString>::iterator toDelete = unique( vs.begin(), vs.end() );
|
||||
vs.erase(toDelete, vs.end());
|
||||
}
|
||||
@@ -5786,8 +5788,8 @@ static RString GetDeviceButtonsLocalized( const vector<EditButton> &veb, const M
|
||||
}
|
||||
}
|
||||
|
||||
ProcessKeyNames( vsPress );
|
||||
ProcessKeyNames( vsHold );
|
||||
ProcessKeyNames( vsPress, false );
|
||||
ProcessKeyNames( vsHold, true );
|
||||
|
||||
RString s = join("/",vsPress);
|
||||
if( !vsHold.empty() )
|
||||
|
||||
Reference in New Issue
Block a user