diff options
author | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-08-27 13:28:57 +0000 |
---|---|---|
committer | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-08-27 13:28:57 +0000 |
commit | 1ba91d5a0e1df7419a561f6dcf16a0839509a5e7 (patch) | |
tree | 3f76e96fc5a3f5b738dabce28642ff2415748ccb /Game/Code/Screens/UScreenOptionsThemes.pas | |
parent | e9fd8ce40b4cbf006695fd6e56f84071407843c9 (diff) | |
download | usdx-1ba91d5a0e1df7419a561f6dcf16a0839509a5e7.tar.gz usdx-1ba91d5a0e1df7419a561f6dcf16a0839509a5e7.tar.xz usdx-1ba91d5a0e1df7419a561f6dcf16a0839509a5e7.zip |
Reordering of the directories[1]: moving Game/Code to src
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1302 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Screens/UScreenOptionsThemes.pas')
-rw-r--r-- | Game/Code/Screens/UScreenOptionsThemes.pas | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/Game/Code/Screens/UScreenOptionsThemes.pas b/Game/Code/Screens/UScreenOptionsThemes.pas deleted file mode 100644 index a4f00b64..00000000 --- a/Game/Code/Screens/UScreenOptionsThemes.pas +++ /dev/null @@ -1,171 +0,0 @@ -unit UScreenOptionsThemes; - -interface - -{$I switches.inc} - -uses - SDL, - UMenu, - UDisplay, - UMusic, - UFiles, - UIni, - UThemes; - -type - TScreenOptionsThemes = class(TMenu) - private - procedure ReloadTheme; - public - SkinSelect: Integer; - constructor Create; override; - function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; - procedure onShow; override; - procedure InteractInc; override; - procedure InteractDec; override; - end; - -implementation - -uses UMain, - UGraphic, - USkins, - SysUtils; - -function TScreenOptionsThemes.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; -begin - Result := true; - If (PressedDown) Then - begin // Key Down - // check normal keys - case WideCharUpperCase(CharCode)[1] of - 'Q': - begin - Result := false; - Exit; - end; - end; - - // check special keys - case PressedKey of - SDLK_ESCAPE, - SDLK_BACKSPACE : - begin - // Escape -> save nothing - just leave this screen - - AudioPlayback.PlaySound(SoundLib.Back); - FadeTo(@ScreenOptions); - end; - SDLK_RETURN: - begin - if SelInteraction = 3 then - begin - Ini.Save; - - // Reload all screens, after Theme changed - // Todo : JB - Check if theme was actually changed - UGraphic.UnLoadScreens(); - UGraphic.LoadScreens(); - - AudioPlayback.PlaySound(SoundLib.Back); - FadeTo(@ScreenOptions); - end; - end; - SDLK_DOWN: - InteractNext; - SDLK_UP : - InteractPrev; - SDLK_RIGHT: - begin - if (SelInteraction >= 0) and (SelInteraction <= 2) then - begin - AudioPlayback.PlaySound(SoundLib.Option); - InteractInc; - end; - end; - SDLK_LEFT: - begin - if (SelInteraction >= 0) and (SelInteraction <= 2) then - begin - AudioPlayback.PlaySound(SoundLib.Option); - InteractDec; - end; - end; - end; - end; -end; - -procedure TScreenOptionsThemes.InteractInc; -begin - inherited InteractInc; - - //Update Skins - if (SelInteraction = 0) then - begin - Skin.OnThemeChange; - UpdateSelectSlideOptions (Theme.OptionsThemes.SelectSkin, SkinSelect, ISkin, Ini.SkinNo); - end; - - ReloadTheme(); -end; - -procedure TScreenOptionsThemes.InteractDec; -begin - inherited InteractDec; - - //Update Skins - if (SelInteraction = 0 ) then - begin - Skin.OnThemeChange; - UpdateSelectSlideOptions (Theme.OptionsThemes.SelectSkin, SkinSelect, ISkin, Ini.SkinNo); - end; - - ReloadTheme(); -end; - -constructor TScreenOptionsThemes.Create; -var - I: integer; -begin - inherited Create; - - LoadFromTheme(Theme.OptionsThemes); - - AddSelectSlide(Theme.OptionsThemes.SelectTheme, Ini.Theme, ITheme); - - SkinSelect := AddSelectSlide(Theme.OptionsThemes.SelectSkin, Ini.SkinNo, ISkin); - - AddSelectSlide(Theme.OptionsThemes.SelectColor, Ini.Color, IColor); - - AddButton(Theme.OptionsThemes.ButtonExit); - if (Length(Button[0].Text)=0) then - AddButtonText(14, 20, Theme.Options.Description[7]); -end; - -procedure TScreenOptionsThemes.onShow; -begin - inherited; - - Interaction := 0; -end; - -procedure TScreenOptionsThemes.ReloadTheme; -begin - Theme.LoadTheme(ThemePath + ITheme[Ini.Theme] + '.ini', Ini.Color); - - ScreenOptionsThemes := TScreenOptionsThemes.create(); - ScreenOptionsThemes.onshow; - Display.CurrentScreen := @ScreenOptionsThemes; - - ScreenOptionsThemes.Interaction := self.Interaction; - ScreenOptionsThemes.Draw; - - - Display.Draw; - SwapBuffers; - - freeandnil( self ); -end; - -end. |