diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 42c2c6b66a08ab53ccfe6ac9a8187763004f78a7..a76a1801f560969bd0ab491f9dca790cc7565c3f 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
var
g_GUIWindows: array of TGUIWindow;
g_ActiveWindow: TGUIWindow = nil;
var
g_GUIWindows: array of TGUIWindow;
g_ActiveWindow: TGUIWindow = nil;
+ g_GUIGrabInput: Boolean = False;
procedure g_GUI_Init();
function g_GUI_AddWindow(Window: TGUIWindow): TGUIWindow;
procedure g_GUI_Init();
function g_GUI_AddWindow(Window: TGUIWindow): TGUIWindow;
var
i: Integer;
ID: DWORD;
var
i: Integer;
ID: DWORD;
+ tw, th: Word;
begin
begin
- if FBackTexture <> '' then
+ if FBackTexture <> '' then // Here goes code duplication from g_game.pas:DrawMenuBackground()
if g_Texture_Get(FBackTexture, ID) then
if g_Texture_Get(FBackTexture, ID) then
- e_DrawSize(ID, 0, 0, 0, False, False, gScreenWidth, gScreenHeight)
+ begin
+ e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);
+ e_GetTextureSize(ID, @tw, @th);
+ if tw = th then
+ tw := round(tw * 1.333 * (gScreenHeight / th))
+ else
+ tw := trunc(tw * (gScreenHeight / th));
+ e_DrawSize(ID, (gScreenWidth - tw) div 2, 0, 0, False, False, tw, gScreenHeight);
+ end
else
e_Clear(GL_COLOR_BUFFER_BIT, 0.5, 0.5, 0.5);
else
e_Clear(GL_COLOR_BUFFER_BIT, 0.5, 0.5, 0.5);
end;
end;
end;
end;
- g_Touch_ShowKeyboard(FWindow.FActiveControl = Self);
+ g_GUIGrabInput := (@FOnEnterEvent = nil) and (FWindow.FActiveControl = Self);
+ g_Touch_ShowKeyboard(g_GUIGrabInput)
end;
procedure TGUIEdit.SetText(Text: string);
end;
procedure TGUIEdit.SetText(Text: string);
end;
end;
end;
end;
end;
end;
+
+ g_GUIGrabInput := FIsQuery
end;
{ TGUIKeyRead2 }
end;
{ TGUIKeyRead2 }
end;
end;
end;
end;
end;
end;
+
+ g_GUIGrabInput := FIsQuery
end;
end;