aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-10-13 14:14:32 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-10-13 14:14:32 +0000
commit322b798413826681915eca1960f081cbc4dd302c (patch)
tree03feeba5d30f0757015d844db2a7687c63382ef5 /src/screens
parentdc2616a471905229cebc6225c98264c737161825 (diff)
downloadusdx-322b798413826681915eca1960f081cbc4dd302c.tar.gz
usdx-322b798413826681915eca1960f081cbc4dd302c.tar.xz
usdx-322b798413826681915eca1960f081cbc4dd302c.zip
Abstraction of the menus background
5 different bg types: none(fallback), colored, texture, video, and fade(for overlays) Some sideeffect is 5 mb less memory usage, don't know for which reasons :P git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1446 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/UScreenLoading.pas6
-rw-r--r--src/screens/UScreenOptionsThemes.pas2
-rw-r--r--src/screens/UScreenPopup.pas27
-rw-r--r--src/screens/UScreenSong.pas13
4 files changed, 21 insertions, 27 deletions
diff --git a/src/screens/UScreenLoading.pas b/src/screens/UScreenLoading.pas
index 55737b15..f4a3508a 100644
--- a/src/screens/UScreenLoading.pas
+++ b/src/screens/UScreenLoading.pas
@@ -47,7 +47,6 @@ type
constructor Create; override;
procedure onShow; override;
function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override;
- function GetBGTexNum: GLUInt;
end;
implementation
@@ -74,9 +73,4 @@ begin
inherited;
end;
-function TScreenLoading.GetBGTexNum: GLUInt;
-begin
- Result := Self.BackImg.TexNum;
-end;
-
end.
diff --git a/src/screens/UScreenOptionsThemes.pas b/src/screens/UScreenOptionsThemes.pas
index e9fde523..82d7d782 100644
--- a/src/screens/UScreenOptionsThemes.pas
+++ b/src/screens/UScreenOptionsThemes.pas
@@ -194,7 +194,7 @@ begin
Display.Draw;
SwapBuffers;
- freeandnil( self );
+ Self.Destroy;
end;
end.
diff --git a/src/screens/UScreenPopup.pas b/src/screens/UScreenPopup.pas
index 92ef7e28..4ef93549 100644
--- a/src/screens/UScreenPopup.pas
+++ b/src/screens/UScreenPopup.pas
@@ -136,7 +136,9 @@ var
begin
inherited Create;
- AddBackground(Theme.CheckPopup.Background.Tex);
+ AddText(Theme.CheckPopup.TextCheck);
+
+ LoadFromTheme(Theme.CheckPopup);
AddButton(Theme.CheckPopup.Button1);
if (Length(Button[0].Text) = 0) then
@@ -146,14 +148,6 @@ begin
if (Length(Button[1].Text) = 0) then
AddButtonText(14, 20, 'Button 2');
- AddText(Theme.CheckPopup.TextCheck);
-
- for I := 0 to High(Theme.CheckPopup.Static) do
- AddStatic(Theme.CheckPopup.Static[I]);
-
- for I := 0 to High(Theme.CheckPopup.Text) do
- AddText(Theme.CheckPopup.Text[I]);
-
Interaction := 0;
end;
@@ -179,6 +173,8 @@ begin
Button[0].Text[0].Text := Language.Translate('SONG_MENU_YES');
Button[1].Text[0].Text := Language.Translate('SONG_MENU_NO');
+
+ Background.OnShow
end;
// error popup
@@ -223,20 +219,14 @@ var
begin
inherited Create;
- AddBackground(Theme.CheckPopup.Background.Tex);
+ AddText(Theme.ErrorPopup.TextError);
+
+ LoadFromTheme(Theme.ErrorPopup);
AddButton(Theme.ErrorPopup.Button1);
if (Length(Button[0].Text) = 0) then
AddButtonText(14, 20, 'Button 1');
- AddText(Theme.ErrorPopup.TextError);
-
- for I := 0 to High(Theme.ErrorPopup.Static) do
- AddStatic(Theme.ErrorPopup.Static[I]);
-
- for I := 0 to High(Theme.ErrorPopup.Text) do
- AddText(Theme.ErrorPopup.Text[I]);
-
Interaction := 0;
end;
@@ -259,6 +249,7 @@ procedure TScreenPopupError.ShowPopup(msg: String);
begin
Interaction := 0; //Reset Interaction
Visible := True; //Set Visible
+ Background.OnShow;
{ //dirty hack... Text[0] is invisible for some strange reason
for i:=1 to high(Text) do
diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas
index c340be2b..95ccae83 100644
--- a/src/screens/UScreenSong.pas
+++ b/src/screens/UScreenSong.pas
@@ -340,17 +340,25 @@ begin
if (not CatSongs.Song[Interaction].Main) then // clicked on Song
begin
if CatSongs.CatNumShow = -3 then
- ScreenSongMenu.MenuShow(SM_Playlist)
+ begin
+ ScreenSongMenu.onShow;
+ ScreenSongMenu.MenuShow(SM_Playlist);
+ end
else
+ begin
+ ScreenSongMenu.onShow;
ScreenSongMenu.MenuShow(SM_Main);
+ end;
end
else
begin
+ ScreenSongMenu.onShow;
ScreenSongMenu.MenuShow(SM_Playlist_Load);
end;
end //Party Mode -> Show Party Menu
else
begin
+ ScreenSongMenu.onShow;
ScreenSongMenu.MenuShow(SM_Party_Main);
end;
end;
@@ -361,7 +369,8 @@ begin
begin
if (Songs.SongList.Count > 0) and (Mode = smNormal) then
begin
- ScreenSongMenu.MenuShow(SM_Playlist_Load);
+ ScreenSongMenu.onShow;
+ ScreenSongMenu.MenuShow(SM_Playlist_Load);
end;
Exit;
end;