aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/src/screens/UScreenEditHeader.pas
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/src/screens/UScreenEditHeader.pas')
-rw-r--r--cmake/src/screens/UScreenEditHeader.pas110
1 files changed, 56 insertions, 54 deletions
diff --git a/cmake/src/screens/UScreenEditHeader.pas b/cmake/src/screens/UScreenEditHeader.pas
index ad0fc40a..1d697bc9 100644
--- a/cmake/src/screens/UScreenEditHeader.pas
+++ b/cmake/src/screens/UScreenEditHeader.pas
@@ -38,6 +38,7 @@ uses
SDL,
USongs,
USong,
+ UPath,
UThemes;
type
@@ -72,8 +73,8 @@ type
procedure SetRoundButtons;
constructor Create; override;
- procedure onShow; override;
- function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
+ procedure OnShow; override;
+ function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override;
{ function Draw: boolean; override;
procedure Finish;}
end;
@@ -86,17 +87,18 @@ uses
SysUtils,
UFiles,
USkins,
- UTexture;
+ UTexture,
+ UUnicodeUtils;
-function TScreenEditHeader.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
+function TScreenEditHeader.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean;
var
T: integer;
begin
Result := true;
if (PressedDown) then // Key Down
begin // check normal keys
- case WideCharUpperCase(CharCode)[1] of
- 'Q':
+ case UCS4UpperCase(CharCode) of
+ Ord('Q'):
begin
Result := false;
Exit;
@@ -105,10 +107,10 @@ begin
// check special keys
case PressedKey of
- SDLK_ESCAPE :
+ SDLK_ESCAPE:
begin
-// Music.PlayBack;
-// FadeTo(@MainScreen);
+ //Music.PlayBack;
+ //FadeTo(@MainScreen);
Result := false;
end;
@@ -116,7 +118,7 @@ begin
begin
if Interaction = 1 then
begin
-// Save;
+ //Save;
end;
end;
@@ -159,19 +161,19 @@ begin
T := Interaction - 2 + TextTitle;
if (Interaction >= 2) and (Interaction <= 13) and (Length(Text[T].Text) >= 1) then
begin
- Text[T].DeleteLastL;
+ Text[T].DeleteLastLetter;
SetRoundButtons;
end;
end;
end;
case CharCode of
- #32..#255:
+ 32..255:
begin
if (Interaction >= 2) and (Interaction <= 13) then
begin
Text[Interaction - 2 + TextTitle].Text :=
- Text[Interaction - 2 + TextTitle].Text + CharCode;
+ Text[Interaction - 2 + TextTitle].Text + UCS4ToUTF8String(CharCode);
SetRoundButtons;
end;
end;
@@ -223,18 +225,18 @@ begin
TextGAP := AddText(340, 110 + 13*30, 0, 30, 0, 0, 0, '');
TextBPM := AddText(340, 110 + 14*30, 0, 30, 0, 0, 0, '');
- StaticTitle := AddStatic(130, 115 + 0*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticArtist := AddStatic(130, 115 + 1*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticMp3 := AddStatic(130, 115 + 2*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticBackground := AddStatic(130, 115 + 4*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticVideo := AddStatic(130, 115 + 5*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticVideoGAP := AddStatic(130, 115 + 6*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticRelative := AddStatic(130, 115 + 8*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticResolution := AddStatic(130, 115 + 9*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticNotesGAP := AddStatic(130, 115 + 10*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticStart := AddStatic(130, 115 + 12*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticGAP := AddStatic(130, 115 + 13*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
- StaticBPM := AddStatic(130, 115 + 14*30, 20, 20, 1, 1, 1, 'RoundButton', TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticTitle := AddStatic(130, 115 + 0*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticArtist := AddStatic(130, 115 + 1*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticMp3 := AddStatic(130, 115 + 2*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticBackground := AddStatic(130, 115 + 4*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticVideo := AddStatic(130, 115 + 5*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticVideoGAP := AddStatic(130, 115 + 6*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticRelative := AddStatic(130, 115 + 8*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticResolution := AddStatic(130, 115 + 9*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticNotesGAP := AddStatic(130, 115 + 10*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticStart := AddStatic(130, 115 + 12*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticGAP := AddStatic(130, 115 + 13*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
+ StaticBPM := AddStatic(130, 115 + 14*30, 20, 20, 1, 1, 1, Path('RoundButton'), TEXTURE_TYPE_TRANSPARENT, $FF00FF);
AddInteraction(iText, TextTitle);
AddInteraction(iText, TextArtist);
@@ -250,7 +252,7 @@ begin
AddInteraction(iText, TextBPM);
end;
-procedure TScreenEditHeader.onShow;
+procedure TScreenEditHeader.OnShow;
begin
inherited;
@@ -347,90 +349,90 @@ end;*)
procedure TScreenEditHeader.SetRoundButtons;
begin
if Length(Text[TextTitle].Text) > 0 then
- Static[StaticTitle].Visible := true
+ Statics[StaticTitle].Visible := true
else
- Static[StaticTitle].Visible := false;
+ Statics[StaticTitle].Visible := false;
if Length(Text[TextArtist].Text) > 0 then
- Static[StaticArtist].Visible := true
+ Statics[StaticArtist].Visible := true
else
- Static[StaticArtist].Visible := false;
+ Statics[StaticArtist].Visible := false;
if Length(Text[TextMp3].Text) > 0 then
- Static[StaticMp3].Visible := true
+ Statics[StaticMp3].Visible := true
else
- Static[StaticMp3].Visible := false;
+ Statics[StaticMp3].Visible := false;
if Length(Text[TextBackground].Text) > 0 then
- Static[StaticBackground].Visible := true
+ Statics[StaticBackground].Visible := true
else
- Static[StaticBackground].Visible := false;
+ Statics[StaticBackground].Visible := false;
if Length(Text[TextVideo].Text) > 0 then
- Static[StaticVideo].Visible := true
+ Statics[StaticVideo].Visible := true
else
- Static[StaticVideo].Visible := false;
+ Statics[StaticVideo].Visible := false;
try
StrToFloat(Text[TextVideoGAP].Text);
if StrToFloat(Text[TextVideoGAP].Text)<> 0 then
- Static[StaticVideoGAP].Visible := true
+ Statics[StaticVideoGAP].Visible := true
else
- Static[StaticVideoGAP].Visible := false;
+ Statics[StaticVideoGAP].Visible := false;
except
- Static[StaticVideoGAP].Visible := false;
+ Statics[StaticVideoGAP].Visible := false;
end;
if LowerCase(Text[TextRelative].Text) = 'yes' then
- Static[StaticRelative].Visible := true
+ Statics[StaticRelative].Visible := true
else
- Static[StaticRelative].Visible := false;
+ Statics[StaticRelative].Visible := false;
try
StrToInt(Text[TextResolution].Text);
if (StrToInt(Text[TextResolution].Text) <> 0) and (StrToInt(Text[TextResolution].Text) >= 1) then
- Static[StaticResolution].Visible := true
+ Statics[StaticResolution].Visible := true
else
- Static[StaticResolution].Visible := false;
+ Statics[StaticResolution].Visible := false;
except
- Static[StaticResolution].Visible := false;
+ Statics[StaticResolution].Visible := false;
end;
try
StrToInt(Text[TextNotesGAP].Text);
- Static[StaticNotesGAP].Visible := true;
+ Statics[StaticNotesGAP].Visible := true;
except
- Static[StaticNotesGAP].Visible := false;
+ Statics[StaticNotesGAP].Visible := false;
end;
// start
try
StrToFloat(Text[TextStart].Text);
if (StrToFloat(Text[TextStart].Text) > 0) then
- Static[StaticStart].Visible := true
+ Statics[StaticStart].Visible := true
else
- Static[StaticStart].Visible := false;
+ Statics[StaticStart].Visible := false;
except
- Static[StaticStart].Visible := false;
+ Statics[StaticStart].Visible := false;
end;
// GAP
try
StrToFloat(Text[TextGAP].Text);
- Static[StaticGAP].Visible := true;
+ Statics[StaticGAP].Visible := true;
except
- Static[StaticGAP].Visible := false;
+ Statics[StaticGAP].Visible := false;
end;
// BPM
try
StrToFloat(Text[TextBPM].Text);
if (StrToFloat(Text[TextBPM].Text) > 0) then
- Static[StaticBPM].Visible := true
+ Statics[StaticBPM].Visible := true
else
- Static[StaticBPM].Visible := false;
+ Statics[StaticBPM].Visible := false;
except
- Static[StaticBPM].Visible := false;
+ Statics[StaticBPM].Visible := false;
end;
end;