aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-03-15 21:14:51 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-03-15 21:14:51 +0000
commitecaf172eeda812de19e1e93daa1b0fd27d6a4186 (patch)
tree084745235ce1668959cd6226a36b3c5280ab54d9
parent91d892149bdc487725e96a63aad8c37fc1f5798a (diff)
downloadusdx-ecaf172eeda812de19e1e93daa1b0fd27d6a4186.tar.gz
usdx-ecaf172eeda812de19e1e93daa1b0fd27d6a4186.tar.xz
usdx-ecaf172eeda812de19e1e93daa1b0fd27d6a4186.zip
bugfix: player selection on party player screen (the layout is still ugly)
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2201 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--game/themes/Deluxe.ini44
-rw-r--r--src/screens/UScreenPartyPlayer.pas103
2 files changed, 79 insertions, 68 deletions
diff --git a/game/themes/Deluxe.ini b/game/themes/Deluxe.ini
index b2241feb..d99954b1 100644
--- a/game/themes/Deluxe.ini
+++ b/game/themes/Deluxe.ini
@@ -6949,7 +6949,7 @@ Text = SING_LEGEND_CONTINUE
Tex = MainBar
TexSBG = SelectBG
Text = PARTY_TEAMS
-X = 85
+X = 45
Y = 90
W = 220
H = 40
@@ -6970,7 +6970,7 @@ STDColor = GrayDark
Tex = MainBar
TexSBG = PartyPlayerSelectBG
Text = PARTY_TEAMS_PLAYER1
-X = 405
+X = 365
Y = 145
W = 200
SBGW = 200
@@ -6992,7 +6992,7 @@ STDColor = GrayDark
Tex = MainBar
TexSBG = PartyPlayerSelectBG
Text = PARTY_TEAMS_PLAYER2
-X = 405
+X = 365
Y = 285
W = 200
SBGW = 200
@@ -7014,7 +7014,7 @@ STDColor = GrayDark
Tex = MainBar
TexSBG = PartyPlayerSelectBG
Text = PARTY_TEAMS_PLAYER3
-X = 405
+X = 365
Y = 425
W = 200
SBGW = 200
@@ -7035,7 +7035,7 @@ STDColor = GrayDark
[PartyPlayerTeam1Name]
Tex = PartyTeamButton2
-X = 85
+X = 45
Y = 140
W = 310
H = 50
@@ -7045,7 +7045,7 @@ Color = P1Lightest
DColor = P1Dark
[PartyPlayerTeam1NameText1]
-X = 155
+X = 115
Y = 8
Font = 0
Size = 36
@@ -7055,7 +7055,7 @@ Color = White
[PartyPlayerPlayer1Name]
Tex = Button
-X = 85
+X = 45
Y = 200
W = 150
H = 50
@@ -7077,7 +7077,7 @@ Color = White
[PartyPlayerPlayer2Name]
Tex = Button
-X = 245
+X = 205
Y = 200
W = 150
H = 50
@@ -7099,7 +7099,7 @@ Color = White
[PartyPlayerPlayer3Name]
Tex = Button
-X = 405
+X = 365
Y = 200
W = 150
H = 50
@@ -7121,7 +7121,7 @@ Color = White
[PartyPlayerPlayer4Name]
Tex = Button
-X = 565
+X = 525
Y = 200
W = 150
H = 50
@@ -7143,7 +7143,7 @@ Color = White
[PartyPlayerTeam2Name]
Tex = PartyTeamButton2
-X = 85
+X = 45
Y = 280
W = 310
H = 50
@@ -7153,7 +7153,7 @@ Color = P2Lightest
DColor = P2Dark
[PartyPlayerTeam2NameText1]
-X = 155
+X = 115
Y = 8
Font = 0
Size = 36
@@ -7163,7 +7163,7 @@ Color = White
[PartyPlayerPlayer5Name]
Tex = Button
-X = 85
+X = 45
Y = 340
W = 150
H = 50
@@ -7185,7 +7185,7 @@ Color = White
[PartyPlayerPlayer6Name]
Tex = Button
-X = 245
+X = 205
Y = 340
W = 150
H = 50
@@ -7207,7 +7207,7 @@ Color = White
[PartyPlayerPlayer7Name]
Tex = Button
-X = 405
+X = 365
Y = 340
W = 150
H = 50
@@ -7229,7 +7229,7 @@ Color = White
[PartyPlayerPlayer8Name]
Tex = Button
-X = 565
+X = 525
Y = 340
W = 150
H = 50
@@ -7251,7 +7251,7 @@ Color = White
[PartyPlayerTeam3Name]
Tex = PartyTeamButton2
-X = 85
+X = 45
Y = 420
W = 310
H = 50
@@ -7261,7 +7261,7 @@ Color = P3Lightest
DColor = P3Dark
[PartyPlayerTeam3NameText1]
-X = 155
+X = 115
Y = 8
Font = 0
Size = 36
@@ -7271,7 +7271,7 @@ Color = White
[PartyPlayerPlayer9Name]
Tex = Button
-X = 85
+X = 45
Y = 480
Z = 0.6
W = 150
@@ -7294,7 +7294,7 @@ Color = White
[PartyPlayerPlayer10Name]
Tex = Button
-X = 245
+X = 205
Y = 480
Z = 0.6
W = 150
@@ -7317,7 +7317,7 @@ Color = White
[PartyPlayerPlayer11Name]
Tex = Button
-X = 405
+X = 365
Y = 480
Z = 0.6
W = 150
@@ -7340,7 +7340,7 @@ Color = White
[PartyPlayerPlayer12Name]
Tex = Button
-X = 565
+X = 525
Y = 480
Z = 0.6
W = 150
diff --git a/src/screens/UScreenPartyPlayer.pas b/src/screens/UScreenPartyPlayer.pas
index 3f9c0f77..a7f4d627 100644
--- a/src/screens/UScreenPartyPlayer.pas
+++ b/src/screens/UScreenPartyPlayer.pas
@@ -167,13 +167,17 @@ var
begin
repeat
InteractNext;
- until (Interactions[Interaction].Typ <> iButton) or (Button[Interactions[Interaction].Num].Visible);
+ until ((Interactions[Interaction].Typ = iSelectS) and
+ SelectsS[Interactions[Interaction].Num].Visible) or
+ (Button[Interactions[Interaction].Num].Visible);
end;
procedure IntPrev;
begin
repeat
InteractPrev;
- until (Interactions[Interaction].Typ <> iButton) or (Button[Interactions[Interaction].Num].Visible);
+ until ((Interactions[Interaction].Typ = iSelectS) and
+ SelectsS[Interactions[Interaction].Num].Visible) or
+ (Button[Interactions[Interaction].Num].Visible);
end;
begin
Result := true;
@@ -184,8 +188,10 @@ begin
else
SDL_ModState := 0;
- begin // Key Down
- // check normal keys
+ // Key Down
+ // check normal keys
+ if (Interactions[Interaction].Typ = iButton) then
+ begin
case CharCode of
Ord('0')..Ord('9'),
Ord('a')..Ord('z'),
@@ -193,144 +199,149 @@ begin
Ord(' '), Ord('-'), Ord('_'), Ord('!'), Ord(','), Ord('<'), Ord('/'),
Ord('*'), Ord('?'), Ord(''''), Ord('"'):
begin
- Button[Interaction].Text[0].Text := Button[Interaction].Text[0].Text +
- UCS4ToUTF8String(CharCode);
+ Button[Interactions[Interaction].Num].Text[0].Text :=
+ Button[Interactions[Interaction].Num].Text[0].Text + UCS4ToUTF8String(CharCode);
Exit;
end;
end;
+
// check special keys
case PressedKey of
// Templates for Names Mod
SDLK_F1:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[0] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[0] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[0];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[0];
end;
SDLK_F2:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[1] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[1] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[1];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[1];
end;
SDLK_F3:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[2] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[2] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[2];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[2];
end;
SDLK_F4:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[3] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[3] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[3];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[3];
end;
SDLK_F5:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[4] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[4] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[4];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[4];
end;
SDLK_F6:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[5] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[5] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[5];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[5];
end;
SDLK_F7:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[6] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[6] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[6];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[6];
end;
SDLK_F8:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[7] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[7] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[7];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[7];
end;
SDLK_F9:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[8] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[8] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[8];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[8];
end;
SDLK_F10:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[9] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[9] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[9];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[9];
end;
SDLK_F11:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[10] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[10] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[10];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[10];
end;
SDLK_F12:
if (SDL_ModState = KMOD_LALT) then
begin
- Ini.NameTemplate[11] := Button[Interaction].Text[0].Text;
+ Ini.NameTemplate[11] := Button[Interactions[Interaction].Num].Text[0].Text;
end
else
begin
- Button[Interaction].Text[0].Text := Ini.NameTemplate[11];
+ Button[Interactions[Interaction].Num].Text[0].Text := Ini.NameTemplate[11];
end;
SDLK_BACKSPACE:
begin
- Button[Interaction].Text[0].DeleteLastLetter;
+ Button[Interactions[Interaction].Num].Text[0].DeleteLastLetter;
end;
+ end;
+ end;
- SDLK_ESCAPE:
- begin
- Ini.SaveNames;
- AudioPlayback.PlaySound(SoundLib.Back);
- FadeTo(@ScreenPartyOptions);
- end;
+ case PressedKey of
+ SDLK_ESCAPE:
+ begin
+ Ini.SaveNames;
+ AudioPlayback.PlaySound(SoundLib.Back);
+ FadeTo(@ScreenPartyOptions);
+ end;
- SDLK_RETURN: UpdateParty;
+ SDLK_RETURN: UpdateParty;
- // 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: IntNext;
- SDLK_UP: IntPrev;
- SDLK_RIGHT: begin
+ // 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: IntNext;
+ SDLK_UP: IntPrev;
+ SDLK_RIGHT:
+ begin
if (Interaction in [0,2,8,14]) then
begin
AudioPlayback.PlaySound(SoundLib.Option);
@@ -339,7 +350,8 @@ begin
UpdateInterface;
end;
end;
- SDLK_LEFT: begin
+ SDLK_LEFT:
+ begin
if (Interaction in [0,2,8,14]) then
begin
AudioPlayback.PlaySound(SoundLib.Option);
@@ -348,7 +360,6 @@ begin
UpdateInterface;
end;
end;
- end;
end;
end;