aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/src/screens/UScreenOptionsSound.pas
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/src/screens/UScreenOptionsSound.pas')
-rw-r--r--cmake/src/screens/UScreenOptionsSound.pas19
1 files changed, 10 insertions, 9 deletions
diff --git a/cmake/src/screens/UScreenOptionsSound.pas b/cmake/src/screens/UScreenOptionsSound.pas
index aa87ceb4..c0efa4d8 100644
--- a/cmake/src/screens/UScreenOptionsSound.pas
+++ b/cmake/src/screens/UScreenOptionsSound.pas
@@ -34,8 +34,8 @@ interface
{$I switches.inc}
uses
- UMenu,
SDL,
+ UMenu,
UDisplay,
UMusic,
UFiles,
@@ -46,26 +46,27 @@ type
TScreenOptionsSound = class(TMenu)
public
constructor Create; override;
- function ParseInput(PressedKey: cardinal; CharCode: widechar;
+ function ParseInput(PressedKey: Cardinal; CharCode: UCS4Char;
PressedDown: boolean): boolean; override;
- procedure onShow; override;
+ procedure OnShow; override;
end;
implementation
uses
UGraphic,
+ UUnicodeUtils,
SysUtils;
function TScreenOptionsSound.ParseInput(PressedKey: cardinal;
- CharCode: widechar; PressedDown: boolean): boolean;
+ CharCode: UCS4Char; PressedDown: boolean): boolean;
begin
Result := true;
if (PressedDown) then
begin // Key Down
// check normal keys
- case WideCharUpperCase(CharCode)[1] of
- 'Q':
+ case UCS4UpperCase(CharCode) of
+ Ord('Q'):
begin
Result := false;
Exit;
@@ -77,7 +78,7 @@ begin
SDLK_ESCAPE,
SDLK_BACKSPACE:
begin
- // Escape -> save nothing - just leave this screen
+ Ini.Save;
AudioPlayback.PlaySound(SoundLib.Back);
FadeTo(@ScreenOptions);
end;
@@ -172,12 +173,12 @@ begin
AddButton(Theme.OptionsSound.ButtonExit);
if (Length(Button[0].Text) = 0) then
- AddButtonText(14, 20, Theme.Options.Description[7]);
+ AddButtonText(20, 5, Theme.Options.Description[7]);
Interaction := 0;
end;
-procedure TScreenOptionsSound.onShow;
+procedure TScreenOptionsSound.OnShow;
begin
inherited;
Interaction := 0;