aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens/UScreenMain.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-29 17:50:29 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-29 17:50:29 +0000
commitbda4fa8e57ca63a1d591433f120b4226d6a5d327 (patch)
tree745df64699fdc0b6e2deafc99107f86166232aa9 /Game/Code/Screens/UScreenMain.pas
parent23e4d293dc19ce496da33b3929c9b71952148e86 (diff)
downloadusdx-bda4fa8e57ca63a1d591433f120b4226d6a5d327.tar.gz
usdx-bda4fa8e57ca63a1d591433f120b4226d6a5d327.tar.xz
usdx-bda4fa8e57ca63a1d591433f120b4226d6a5d327.zip
Added 2 new Buttons to ScreenMain: Multi and Stats
Updated Language Fiels to Fit with new Buttons Some CodeClean Up in Menu Class and in Screens Some minor Bug fixes I forgot about Added ability to group Buttons within a Screen New Theme Object: ButtonCollection: Same Attributes as a Button Plus FirstChild: Defining the First Button in the Group. For Example: SingSolo is 1, SingMulti Button is 2, in ScreenMain Added Attribute to Theme Button: Parent: Number of the assigned Group, 0 for no Group Used new Abilitys in MainScreen git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@149 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Screens/UScreenMain.pas79
1 files changed, 61 insertions, 18 deletions
diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas
index 4c822640..49bd98ee 100644
--- a/Game/Code/Screens/UScreenMain.pas
+++ b/Game/Code/Screens/UScreenMain.pas
@@ -16,6 +16,8 @@ type
procedure onShow; override;
procedure InteractNext; override;
procedure InteractPrev; override;
+ procedure InteractInc; override;
+ procedure InteractDec; override;
procedure UpdateLCD;
procedure SetAnimationProgress(Progress: real); override;
//function Draw: boolean; override;
@@ -84,6 +86,7 @@ begin
SDLK_RETURN:
begin
+ //Solo
if (Interaction = 0) and (Length(Songs.Song) >= 1) then begin
Music.PlayStart;
if (Ini.Players >= 0) and (Ini.Players <= 3) then PlayersPlay := Ini.Players + 1;
@@ -92,23 +95,44 @@ begin
ScreenName.Goto_SingScreen := False;
FadeTo(@ScreenName);
end;
+
+ //Multi
if Interaction = 1 then begin
+ if (Ini.Players >= 1) AND (Length(DLLMan.Plugins)>=1) then
+ begin
+ Music.PlayStart;
+ FadeTo(@ScreenPartyOptions);
+ end;
+ end;
+
+ //Stats
+ if Interaction = 2 then begin
+ Music.PlayStart;
+ FadeTo(@ScreenStatMain);
+ end;
+
+ //Editor
+ if Interaction = 3 then begin
Music.PlayStart;
FadeTo(@ScreenEdit);
end;
- if Interaction = 2 then begin
+
+ //Options
+ if Interaction = 4 then begin
Music.PlayStart;
FadeTo(@ScreenOptions);
end;
- if Interaction = 3 then begin
+
+ //Exit
+ if Interaction = 5 then begin
Result := false;
end;
end;
// Up and Down could be done at the same time,
// but I don't want to declare variables inside
// functions like this one, called so many times
- SDLK_DOWN: InteractNext;
- SDLK_UP: InteractPrev;
+ SDLK_DOWN: InteractInc;
+ SDLK_UP: InteractDec;
SDLK_RIGHT: InteractNext;
SDLK_LEFT: InteractPrev;
end;
@@ -127,27 +151,28 @@ var
begin
inherited Create;
-// AddButton(400-200, 320, 400, 60, Skin.GameStart);
-// AddButton(400-200, 390, 400, 60, Skin.Editor);
-// AddButton(400-200, 460, 400, 60, Skin.Options);
-// AddButton(400-200, 530, 400, 60, Skin.Exit);
+ //----------------
+ //Attention ^^:
+ //New Creation Order needed because of LoadFromTheme
+ //and Button Collections.
+ //At First Custom Texts and Statics
+ //Then LoadFromTheme
+ //after LoadFromTheme the Buttons and Selects
+ //----------------
+
+
+ TextDescription := AddText(Theme.Main.TextDescription);
+ TextDescriptionLong := AddText(Theme.Main.TextDescriptionLong);
- AddBackground(Theme.Main.Background.Tex);
+ LoadFromTheme(Theme.Main);
AddButton(Theme.Main.ButtonSolo);
+ AddButton(Theme.Main.ButtonMulti);
+ AddButton(Theme.Main.ButtonStat);
AddButton(Theme.Main.ButtonEditor);
AddButton(Theme.Main.ButtonOptions);
AddButton(Theme.Main.ButtonExit);
- for I := 0 to High(Theme.Main.Static) do
- AddStatic(Theme.Main.Static[I]);
-
- for I := 0 to High(Theme.Main.Text) do
- AddText(Theme.Main.Text[I]);
-
- TextDescription := AddText(Theme.Main.TextDescription);
- TextDescriptionLong := AddText(Theme.Main.TextDescriptionLong);
-
Interaction := 0;
end;
@@ -175,6 +200,24 @@ begin
Light.LightOne(0, 200);
end;
+procedure TScreenMain.InteractDec;
+begin
+ inherited InteractDec;
+ Text[TextDescription].Text := Theme.Main.Description[Interaction];
+ Text[TextDescriptionLong].Text := Theme.Main.DescriptionLong[Interaction];
+ UpdateLCD;
+ Light.LightOne(0, 200);
+end;
+
+procedure TScreenMain.InteractInc;
+begin
+ inherited InteractInc;
+ Text[TextDescription].Text := Theme.Main.Description[Interaction];
+ Text[TextDescriptionLong].Text := Theme.Main.DescriptionLong[Interaction];
+ UpdateLCD;
+ Light.LightOne(1, 200);
+end;
+
procedure TScreenMain.UpdateLCD;
begin
case Interaction of