aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-02 01:38:02 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-02 01:38:02 +0000
commit8b1898e992b4247e640f4449667bfb6a780d3de7 (patch)
tree3dd63d9855ea0d99db4478e8d4b7a83a0c8f426e
parentb4e12810394d8b1c024ba81ebb0810ab425bdc45 (diff)
downloadusdx-8b1898e992b4247e640f4449667bfb6a780d3de7.tar.gz
usdx-8b1898e992b4247e640f4449667bfb6a780d3de7.tar.xz
usdx-8b1898e992b4247e640f4449667bfb6a780d3de7.zip
GetSkinNumber and LoadSkin
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3170 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--src/base/USkins.pas12
-rw-r--r--src/base/UThemes.pas4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/base/USkins.pas b/src/base/USkins.pas
index 6d8c2ebf..0492fb7a 100644
--- a/src/base/USkins.pas
+++ b/src/base/USkins.pas
@@ -62,9 +62,9 @@ type
procedure LoadList;
procedure ParseDir(Dir: IPath);
procedure LoadHeader(FileName: IPath);
- procedure LoadSkin(Name: string);
+ procedure LoadSkin(Name, Theme: string);
function GetTextureFileName(TextureName: string): IPath;
- function GetSkinNumber(Name: string): integer;
+ function GetSkinNumber(Name, Theme: string): integer;
function GetDefaultColor(SkinNo: integer): integer;
procedure GetSkinsByTheme(Theme: string; out Skins: TUTF8StringDynArray);
@@ -143,14 +143,14 @@ begin
SkinIni.Free;
end;
-procedure TSkin.LoadSkin(Name: string);
+procedure TSkin.LoadSkin(Name, Theme: string);
var
SkinIni: TMemIniFile;
SL: TStringList;
T: integer;
S: integer;
begin
- S := GetSkinNumber(Name);
+ S := GetSkinNumber(Name, Theme);
SkinPath := Skin[S].Path;
SkinIni := TMemIniFile.Create(SkinPath.Append(Skin[S].FileName).ToNative);
@@ -191,13 +191,13 @@ begin
end;
end;
-function TSkin.GetSkinNumber(Name: string): integer;
+function TSkin.GetSkinNumber(Name, Theme: string): integer;
var
S: integer;
begin
Result := 0; // set default to the first available skin
for S := 0 to High(Skin) do
- if CompareText(Skin[S].Name, Name) = 0 then
+ if (CompareText(Skin[S].Name, Name) = 0) and (CompareText(Skin[S].Theme, Theme) = 0) then
Result := S;
end;
diff --git a/src/base/UThemes.pas b/src/base/UThemes.pas
index b9ec8bb0..283c148d 100644
--- a/src/base/UThemes.pas
+++ b/src/base/UThemes.pas
@@ -1047,7 +1047,7 @@ begin
// set correct default skin
Skin.GetSkinsByTheme(Entry.Name, Skins);
Entry.DefaultSkin := max(0, GetArrayIndex(Skins, SkinName, true));
-
+
Len := Length(Themes);
SetLength(Themes, Len + 1);
SetLength(ITheme, Len + 1);
@@ -1106,7 +1106,7 @@ begin
Skin.SkinReg := false; }
Skin.Color := sColor;
- Skin.LoadSkin(ISkin[Ini.SkinNo]);
+ Skin.LoadSkin(ISkin[Ini.SkinNo], Themes[ThemeNum].Name);
LoadColors;