|
|
|
@ -186,32 +186,32 @@ void selhero_CatToName(char *in_buf, char *out_buf, int cnt) |
|
|
|
strncat(out_buf, output.c_str(), cnt - strlen(out_buf)); |
|
|
|
strncat(out_buf, output.c_str(), cnt - strlen(out_buf)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool UiFocusNavigation(SDL_Event *event) |
|
|
|
void UiFocusNavigation(SDL_Event *event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (GetMenuAction(*event)) { |
|
|
|
switch (GetMenuAction(*event)) { |
|
|
|
case MenuAction::SELECT: |
|
|
|
case MenuAction::SELECT: |
|
|
|
UiFocusNavigationSelect(); |
|
|
|
UiFocusNavigationSelect(); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
case MenuAction::UP: |
|
|
|
case MenuAction::UP: |
|
|
|
UiFocus(SelectedItem - 1, UiItemsWraps); |
|
|
|
UiFocus(SelectedItem - 1, UiItemsWraps); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
case MenuAction::DOWN: |
|
|
|
case MenuAction::DOWN: |
|
|
|
UiFocus(SelectedItem + 1, UiItemsWraps); |
|
|
|
UiFocus(SelectedItem + 1, UiItemsWraps); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
case MenuAction::PAGE_UP: |
|
|
|
case MenuAction::PAGE_UP: |
|
|
|
UiFocusPageUp(); |
|
|
|
UiFocusPageUp(); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
case MenuAction::PAGE_DOWN: |
|
|
|
case MenuAction::PAGE_DOWN: |
|
|
|
UiFocusPageDown(); |
|
|
|
UiFocusPageDown(); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
case MenuAction::DELETE: |
|
|
|
case MenuAction::DELETE: |
|
|
|
UiFocusNavigationYesNo(); |
|
|
|
UiFocusNavigationYesNo(); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
case MenuAction::BACK: |
|
|
|
case MenuAction::BACK: |
|
|
|
if (!gfnListEsc) |
|
|
|
if (!gfnListEsc) |
|
|
|
break; |
|
|
|
break; |
|
|
|
UiFocusNavigationEsc(); |
|
|
|
UiFocusNavigationEsc(); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -252,7 +252,7 @@ bool UiFocusNavigation(SDL_Event *event) |
|
|
|
selhero_CatToName(clipboard, UiTextInput, UiTextInputLen); |
|
|
|
selhero_CatToName(clipboard, UiTextInput, UiTextInputLen); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
case SDLK_BACKSPACE: |
|
|
|
case SDLK_BACKSPACE: |
|
|
|
case SDLK_LEFT: { |
|
|
|
case SDLK_LEFT: { |
|
|
|
@ -260,7 +260,7 @@ bool UiFocusNavigation(SDL_Event *event) |
|
|
|
if (nameLen > 0) { |
|
|
|
if (nameLen > 0) { |
|
|
|
UiTextInput[nameLen - 1] = '\0'; |
|
|
|
UiTextInput[nameLen - 1] = '\0'; |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -281,7 +281,7 @@ bool UiFocusNavigation(SDL_Event *event) |
|
|
|
#ifndef USE_SDL1 |
|
|
|
#ifndef USE_SDL1 |
|
|
|
case SDL_TEXTINPUT: |
|
|
|
case SDL_TEXTINPUT: |
|
|
|
selhero_CatToName(event->text.text, UiTextInput, UiTextInputLen); |
|
|
|
selhero_CatToName(event->text.text, UiTextInput, UiTextInputLen); |
|
|
|
return true; |
|
|
|
return; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -294,10 +294,8 @@ bool UiFocusNavigation(SDL_Event *event) |
|
|
|
OutputToLogical(&event->button.x, &event->button.y); |
|
|
|
OutputToLogical(&event->button.x, &event->button.y); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if (UiItemMouseEvents(event, gUiItems, gUiItemCnt)) |
|
|
|
if (UiItemMouseEvents(event, gUiItems, gUiItemCnt)) |
|
|
|
return true; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UiHandleEvents(SDL_Event *event) |
|
|
|
void UiHandleEvents(SDL_Event *event) |
|
|
|
|