aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/base/UThemes.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-12-11 17:34:54 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-12-11 17:34:54 +0000
commit1ab628e8ad6c85c8f1b562f10480253ee3e622b7 (patch)
treed21621f68850ecd7762137e1c4387fa15731a811 /Lua/src/base/UThemes.pas
parent6ec275387c320d3d9a8f5b6fe185687643565b8c (diff)
downloadusdx-1ab628e8ad6c85c8f1b562f10480253ee3e622b7.tar.gz
usdx-1ab628e8ad6c85c8f1b562f10480253ee3e622b7.tar.xz
usdx-1ab628e8ad6c85c8f1b562f10480253ee3e622b7.zip
merged trunk into lua branch
plugin loading is disabled atm because of a bug reading the files (lua may be the reason). Reading the files in usdx and passing the contents to lua may solve this git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2019 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Lua/src/base/UThemes.pas')
-rw-r--r--Lua/src/base/UThemes.pas102
1 files changed, 60 insertions, 42 deletions
diff --git a/Lua/src/base/UThemes.pas b/Lua/src/base/UThemes.pas
index 9bf858ed..4322815e 100644
--- a/Lua/src/base/UThemes.pas
+++ b/Lua/src/base/UThemes.pas
@@ -34,21 +34,22 @@ interface
{$I switches.inc}
uses
- ULog,
IniFiles,
SysUtils,
Classes,
- UTexture;
+ ULog,
+ UTexture,
+ UPath;
type
TRGB = record
- R: single;
- G: single;
- B: single;
+ R: single;
+ G: single;
+ B: single;
end;
TRGBA = record
- R, G, B, A: Double;
+ R, G, B, A: double;
end;
type
@@ -112,7 +113,7 @@ type
Font: integer;
Size: integer;
Align: integer;
- Text: string;
+ Text: UTF8String;
//Reflection
Reflection: boolean;
ReflectionSpacing: real;
@@ -175,13 +176,14 @@ type
W: integer;
H: integer;
Z: real;
+ SBGW: integer;
TextSize: integer;
- //SBGW Mod
- SBGW: integer;
+ showArrows:boolean;
+ oneItemOnly:boolean;
- Text: string;
+ Text: UTF8String;
ColR, ColG, ColB, Int: real;
DColR, DColG, DColB, DInt: real;
TColR, TColG, TColB, TInt: real;
@@ -235,8 +237,8 @@ type
TextDescription: TThemeText;
TextDescriptionLong: TThemeText;
- Description: array[0..5] of string;
- DescriptionLong: array[0..5] of string;
+ Description: array[0..5] of UTF8String;
+ DescriptionLong: array[0..5] of UTF8String;
end;
TThemeName = class(TThemeBasic)
@@ -353,12 +355,17 @@ type
TextP3RScore: TThemeText;
//Linebonus Translations
- LineBonusText: array [0..8] of string;
+ LineBonusText: array [0..8] of UTF8String;
//Pause Popup
PausePopUp: TThemeStatic;
end;
+ TThemeLyricBar = record
+ IndicatorYOffset, UpperX, UpperW, UpperY, UpperH,
+ LowerX, LowerW, LowerY, LowerH : integer;
+ end;
+
TThemeScore = class(TThemeBasic)
TextArtist: TThemeText;
TextTitle: TThemeText;
@@ -402,6 +409,7 @@ type
TextNumber: AThemeText;
TextName: AThemeText;
TextScore: AThemeText;
+ TextDate: AThemeText;
end;
TThemeOptions = class(TThemeBasic)
@@ -415,7 +423,7 @@ type
ButtonExit: TThemeButton;
TextDescription: TThemeText;
- Description: array[0..7] of string;
+ Description: array[0..7] of UTF8String;
end;
TThemeOptionsGame = class(TThemeBasic)
@@ -490,8 +498,8 @@ type
TextDescription: TThemeText;
TextDescriptionLong: TThemeText;
- Description: array[0..5] of string;
- DescriptionLong: array[0..5] of string;
+ Description: array[0..5] of UTF8string;
+ DescriptionLong: array[0..5] of UTF8string;
end;
//Error- and Check-Popup
@@ -525,10 +533,10 @@ type
TextFound: TThemeText;
//Translated Texts
- Songsfound: string;
- NoSongsfound: string;
- CatText: string;
- IType: array [0..2] of string;
+ Songsfound: UTF8String;
+ NoSongsfound: UTF8String;
+ CatText: UTF8String;
+ IType: array [0..2] of UTF8String;
end;
//Party Screens
@@ -694,15 +702,15 @@ type
TextPage: TThemeText;
TextList: AThemeText;
- Description: array[0..3] of string;
- DescriptionR: array[0..3] of string;
- FormatStr: array[0..3] of string;
- PageStr: string;
+ Description: array[0..3] of UTF8String;
+ DescriptionR: array[0..3] of UTF8String;
+ FormatStr: array[0..3] of UTF8String;
+ PageStr: UTF8String;
end;
//Playlist Translations
TThemePlaylist = record
- CatText: string;
+ CatText: UTF8String;
end;
TTheme = class
@@ -723,6 +731,7 @@ type
Level: TThemeLevel;
Song: TThemeSong;
Sing: TThemeSing;
+ LyricBar: TThemeLyricBar;
Score: TThemeScore;
Top5: TThemeTop5;
Options: TThemeOptions;
@@ -754,11 +763,11 @@ type
Playlist: TThemePlaylist;
- ILevel: array[0..2] of string;
+ ILevel: array[0..2] of UTF8String;
- constructor Create(const FileName: string); overload; // Initialize theme system
- constructor Create(const FileName: string; Color: integer); overload; // Initialize theme system with color
- function LoadTheme(FileName: string; sColor: integer): boolean; // Load some theme settings from file
+ constructor Create(const FileName: IPath); overload; // Initialize theme system
+ constructor Create(const FileName: IPath; Color: integer); overload; // Initialize theme system with color
+ function LoadTheme(const FileName: IPath; sColor: integer): boolean; // Load some theme settings from file
procedure LoadColors;
@@ -838,12 +847,12 @@ begin
glColor4f(Color.R, Color.G, Color.B, Min(Color.A, Alpha));
end;
-constructor TTheme.Create(const FileName: string);
+constructor TTheme.Create(const FileName: IPath);
begin
Create(FileName, 0);
end;
-constructor TTheme.Create(const FileName: string; Color: integer);
+constructor TTheme.Create(const FileName: IPath; Color: integer);
begin
inherited Create();
@@ -886,7 +895,7 @@ begin
end;
-function TTheme.LoadTheme(FileName: string; sColor: integer): boolean;
+function TTheme.LoadTheme(const FileName: IPath; sColor: integer): boolean;
var
I: integer;
begin
@@ -894,23 +903,21 @@ begin
CreateThemeObjects();
- Log.LogStatus('Loading: '+ FileName, 'TTheme.LoadTheme');
-
- FileName := AdaptFilePaths(FileName);
+ Log.LogStatus('Loading: '+ FileName.ToNative, 'TTheme.LoadTheme');
- if not FileExists(FileName) then
+ if not FileName.IsFile() then
begin
- Log.LogError('Theme does not exist ('+ FileName +')', 'TTheme.LoadTheme');
+ Log.LogError('Theme does not exist ('+ FileName.ToNative +')', 'TTheme.LoadTheme');
end;
- if FileExists(FileName) then
+ if FileName.IsFile() then
begin
Result := true;
{$IFDEF THEMESAVE}
- ThemeIni := TIniFile.Create(FileName);
+ ThemeIni := TIniFile.Create(FileName.ToNative);
{$ELSE}
- ThemeIni := TMemIniFile.Create(FileName);
+ ThemeIni := TMemIniFile.Create(FileName.ToNative);
{$ENDIF}
if ThemeIni.ReadString('Theme', 'Name', '') <> '' then
@@ -1031,9 +1038,19 @@ begin
ThemeLoadStatic(Song.StaticTeam3Joker5, 'SongStaticTeam3Joker5');
+ //LyricBar asd
+ LyricBar.UpperX := ThemeIni.ReadInteger('SingLyricsUpperBar', 'X', 0);
+ LyricBar.UpperW := ThemeIni.ReadInteger('SingLyricsUpperBar', 'W', 0);
+ LyricBar.UpperY := ThemeIni.ReadInteger('SingLyricsUpperBar', 'Y', 0);
+ LyricBar.UpperH := ThemeIni.ReadInteger('SingLyricsUpperBar', 'H', 0);
+ LyricBar.IndicatorYOffset := ThemeIni.ReadInteger('SingLyricsUpperBar', 'IndicatorYOffset', 0);
+ LyricBar.LowerX := ThemeIni.ReadInteger('SingLyricsLowerBar', 'X', 0);
+ LyricBar.LowerW := ThemeIni.ReadInteger('SingLyricsLowerBar', 'W', 0);
+ LyricBar.LowerY := ThemeIni.ReadInteger('SingLyricsLowerBar', 'Y', 0);
+ LyricBar.LowerH := ThemeIni.ReadInteger('SingLyricsLowerBar', 'H', 0);
+
// Sing
ThemeLoadBasic(Sing, 'Sing');
-
//TimeBar mod
ThemeLoadStatic(Sing.StaticTimeProgress, 'SingTimeProgress');
ThemeLoadText(Sing.TextTimeText, 'SingTimeText');
@@ -1160,6 +1177,7 @@ begin
ThemeLoadTexts(Top5.TextNumber, 'Top5TextNumber');
ThemeLoadTexts(Top5.TextName, 'Top5TextName');
ThemeLoadTexts(Top5.TextScore, 'Top5TextScore');
+ ThemeLoadTexts(Top5.TextDate, 'Top5TextDate');
// Options
ThemeLoadBasic(Options, 'Options');
@@ -1769,7 +1787,7 @@ begin
ThemeSelectS.SkipX := ThemeIni.ReadInteger(Name, 'SkipX', 0);
- ThemeSelectS.SBGW := ThemeIni.ReadInteger(Name, 'SBGW', 450);
+ ThemeSelectS.SBGW := ThemeIni.ReadInteger(Name, 'SBGW', 400);
LoadColor(ThemeSelectS.ColR, ThemeSelectS.ColG, ThemeSelectS.ColB, ThemeIni.ReadString(Name, 'Color', ''));
ThemeSelectS.Int := ThemeIni.ReadFloat(Name, 'Int', 1);