From 1ab628e8ad6c85c8f1b562f10480253ee3e622b7 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Fri, 11 Dec 2009 17:34:54 +0000 Subject: merged trunk into lua branch plugin loading is disabled atm because of a bug reading the files (lua may be the reason). Reading the files in usdx and passing the contents to lua may solve this git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2019 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Lua/src/screens/UScreenOptionsGraphics.pas | 60 +++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 18 deletions(-) (limited to 'Lua/src/screens/UScreenOptionsGraphics.pas') diff --git a/Lua/src/screens/UScreenOptionsGraphics.pas b/Lua/src/screens/UScreenOptionsGraphics.pas index 2e2b4f0e..8ca13f09 100644 --- a/Lua/src/screens/UScreenOptionsGraphics.pas +++ b/Lua/src/screens/UScreenOptionsGraphics.pas @@ -46,22 +46,26 @@ type TScreenOptionsGraphics = class(TMenu) public constructor Create; override; - function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; - procedure onShow; override; + function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; + procedure OnShow; override; end; implementation -uses UGraphic, UMain, SysUtils, TypInfo; +uses + UGraphic, + UMain, + UUnicodeUtils, + SysUtils; -function TScreenOptionsGraphics.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; +function TScreenOptionsGraphics.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; begin Result := true; - If (PressedDown) Then + 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; @@ -80,10 +84,12 @@ begin end; SDLK_RETURN: begin -{ if SelInteraction <= 1 then begin +{ if SelInteraction <= 1 then + begin Restart := true; end;} - if SelInteraction = 6 then begin + if SelInteraction = 6 then + begin Ini.Save; AudioPlayback.PlaySound(SoundLib.Back); // FIXME: changing the video mode does not work this way in windows @@ -101,14 +107,16 @@ begin InteractPrev; SDLK_RIGHT: begin - if (SelInteraction >= 0) and (SelInteraction < 6) then begin + if (SelInteraction >= 0) and (SelInteraction < 6) then + begin AudioPlayback.PlaySound(SoundLib.Option); InteractInc; end; end; SDLK_LEFT: begin - if (SelInteraction >= 0) and (SelInteraction < 6) then begin + if (SelInteraction >= 0) and (SelInteraction < 6) then + begin AudioPlayback.PlaySound(SoundLib.Option); InteractDec; end; @@ -124,13 +132,29 @@ begin inherited Create; LoadFromTheme(Theme.OptionsGraphics); - AddSelectSlide(Theme.OptionsGraphics.SelectResolution, Ini.Resolution, IResolution); - AddSelectSlide(Theme.OptionsGraphics.SelectFullscreen, Ini.Fullscreen, IFullscreen); - AddSelectSlide(Theme.OptionsGraphics.SelectDepth, Ini.Depth, IDepth); - AddSelectSlide(Theme.OptionsGraphics.SelectVisualizer, Ini.VisualizerOption, IVisualizer); - AddSelectSlide(Theme.OptionsGraphics.SelectOscilloscope, Ini.Oscilloscope, IOscilloscope); - AddSelectSlide(Theme.OptionsGraphics.SelectMovieSize, Ini.MovieSize, IMovieSize); + Theme.OptionsGraphics.SelectResolution.showArrows := true; + Theme.OptionsGraphics.SelectResolution.oneItemOnly := true; + AddSelectSlide(Theme.OptionsGraphics.SelectResolution, Ini.Resolution, IResolution); + + Theme.OptionsGraphics.SelectFullscreen.showArrows := true; + Theme.OptionsGraphics.SelectFullscreen.oneItemOnly := true; + AddSelectSlide(Theme.OptionsGraphics.SelectFullscreen, Ini.Fullscreen, IFullScreenTranslated); + + Theme.OptionsGraphics.SelectDepth.showArrows := true; + Theme.OptionsGraphics.SelectDepth.oneItemOnly := true; + AddSelectSlide(Theme.OptionsGraphics.SelectDepth, Ini.Depth, IDepth); + + Theme.OptionsGraphics.SelectVisualizer.showArrows := true; + Theme.OptionsGraphics.SelectVisualizer.oneItemOnly := true; + AddSelectSlide(Theme.OptionsGraphics.SelectVisualizer, Ini.VisualizerOption, IVisualizerTranslated); + + Theme.OptionsGraphics.SelectOscilloscope.showArrows := true; + Theme.OptionsGraphics.SelectOscilloscope.oneItemOnly := true; + AddSelectSlide(Theme.OptionsGraphics.SelectOscilloscope, Ini.Oscilloscope, IOscilloscopeTranslated); + Theme.OptionsGraphics.SelectMovieSize.showArrows := true; + Theme.OptionsGraphics.SelectMovieSize.oneItemOnly := true; + AddSelectSlide(Theme.OptionsGraphics.SelectMovieSize, Ini.MovieSize, IMovieSizeTranslated); AddButton(Theme.OptionsGraphics.ButtonExit); if (Length(Button[0].Text)=0) then @@ -138,7 +162,7 @@ begin end; -procedure TScreenOptionsGraphics.onShow; +procedure TScreenOptionsGraphics.OnShow; begin inherited; -- cgit v1.2.3