Advertisement
dominus

Untitled

Jun 1st, 2025
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.00 KB | None | 0 0
  1. diff --git a/gamemgr/bggame.cc b/gamemgr/bggame.cc
  2. index 199186b5f..0702a4a7a 100644
  3. --- a/gamemgr/bggame.cc
  4. +++ b/gamemgr/bggame.cc
  5. @@ -2239,11 +2239,9 @@ bool BG_Game::new_game(Vga_file& shapes) {
  6.                                                  // visible initially
  7.     }
  8.     SDL_Window* window = gwin->get_win()->get_screen_window();
  9. -#if !defined(SDL_PLATFORM_IOS) && !defined(ANDROID)
  10.     if (!SDL_TextInputActive(window)) {
  11.         SDL_StartTextInput(window);
  12.     }
  13. -#endif
  14.     do {
  15.         Delay();
  16.         if (redraw) {
  17. @@ -2298,6 +2296,16 @@ bool BG_Game::new_game(Vga_file& shapes) {
  18.         } else if (Mouse::mouse() && Mouse::mouse()->is_onscreen()) {
  19.             gwin->get_win()->ShowFillGuardBand();
  20.         }
  21. +       if (touchui != nullptr) {
  22. +           int yoffset = static_cast<int>(-gwin->get_height() / 3.0 + 132);
  23. +           SDL_Rect screenRect = {topx, topy + yoffset, 1, 1};
  24. +           int screen_x = screenRect.x;
  25. +           int screen_y = screenRect.y;
  26. +           gwin->get_win()->game_to_screen(screenRect.x, screenRect.y, false, screen_x,screen_y);
  27. +           screenRect.x = screen_x;
  28. +           screenRect.y = screen_y;
  29. +           SDL_SetTextInputArea(window, &screenRect, 0);
  30. +       }
  31.         SDL_Renderer* renderer
  32.                 = SDL_GetRenderer(gwin->get_win()->get_screen_window());
  33.         SDL_Event event;
  34. @@ -2325,6 +2333,7 @@ bool BG_Game::new_game(Vga_file& shapes) {
  35.                 const SDL_Rect rectOnward = {topx + 10, topy + 180, 130, 16};
  36.                 const SDL_Rect rectReturn = {centerx + 10, topy + 180, 130, 16};
  37.                 SDL_Point      point;
  38. +              
  39.                 gwin->get_win()->screen_to_game(
  40.                         event.button.x, event.button.y, gwin->get_fastmouse(),
  41.                         point.x, point.y);
  42. @@ -2332,7 +2341,11 @@ bool BG_Game::new_game(Vga_file& shapes) {
  43.                     if (event.type == SDL_EVENT_MOUSE_BUTTON_DOWN) {
  44.                         selected = 0;
  45.                     } else if (selected == 0 && touchui != nullptr) {
  46. -                       touchui->promptForName(npc_name);
  47. +                       if (!SDL_TextInputActive(window)) {
  48. +                           SDL_StartTextInput(window);
  49. +                       } else {
  50. +                           SDL_StopTextInput(window);
  51. +                       }
  52.                     }
  53.                     redraw = true;
  54.                 } else if (SDL_GetRectEnclosingPoints(
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement