mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
get rid of unnecessary string conversions in option menu shortcuts
This commit is contained in:
parent
7eb12fa9fb
commit
38fcfa5ba9
1 changed files with 2 additions and 2 deletions
|
@ -203,7 +203,7 @@ class OptionMenu : Menu
|
|||
}
|
||||
else if (ev.type == UIEvent.Type_Char)
|
||||
{
|
||||
String key = String.Format("%c", ev.keyChar).MakeLower();
|
||||
int key = String.CharLower(ev.keyChar);
|
||||
int itemsNumber = mDesc.mItems.Size();
|
||||
int direction = ev.IsAlt ? -1 : 1;
|
||||
for (int i = 0; i < itemsNumber; ++i)
|
||||
|
@ -211,7 +211,7 @@ class OptionMenu : Menu
|
|||
int index = (mDesc.mSelectedItem + direction * (i + 1) + itemsNumber) % itemsNumber;
|
||||
if (!mDesc.mItems[index].Selectable()) continue;
|
||||
String label = StringTable.Localize(mDesc.mItems[index].mLabel);
|
||||
String firstLabelCharacter = String.Format("%c", label.GetNextCodePoint(0)).MakeLower();
|
||||
int firstLabelCharacter = String.CharLower(label.GetNextCodePoint(0));
|
||||
if (firstLabelCharacter == key)
|
||||
{
|
||||
mDesc.mSelectedItem = index;
|
||||
|
|
Loading…
Reference in a new issue