diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-04-05 13:43:20 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-04-05 13:43:20 +0000 |
commit | 5c46c303e25f84e49e36918bafc8d7eca09a507b (patch) | |
tree | 1299c99ac75aa56a4d9bad7c86992628175203d0 /Game/Code/Menu/UMenu.pas | |
parent | 42717e4611f758f137d86fd99e69bf9791d3a727 (diff) | |
download | usdx-5c46c303e25f84e49e36918bafc8d7eca09a507b.tar.gz usdx-5c46c303e25f84e49e36918bafc8d7eca09a507b.tar.xz usdx-5c46c303e25f84e49e36918bafc8d7eca09a507b.zip |
Fixed: Button.Z Attribut not loaded from Theme
Fixed: AddButton procedure don't set Result
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@58 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Menu/UMenu.pas')
-rw-r--r-- | Game/Code/Menu/UMenu.pas | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas index bf823b16..45a25cb7 100644 --- a/Game/Code/Menu/UMenu.pas +++ b/Game/Code/Menu/UMenu.pas @@ -369,6 +369,8 @@ begin ThemeButton.DColR, ThemeButton.DColG, ThemeButton.DColB, ThemeButton.DInt,
Skin.GetTextureFileName(ThemeButton.Tex), 'JPG', ThemeButton.Typ, ThemeButton.Reflection);
+ Button[Result].Z := ThemeButton.Z;
+
BTLen := Length(ThemeButton.Text);
for BT := 0 to BTLen-1 do begin
@@ -390,44 +392,42 @@ begin end;
function TMenu.AddButton(X, Y, W, H, ColR, ColG, ColB, Int, DColR, DColG, DColB, DInt: real; Name, Format, Typ: String; Reflection: Boolean): integer;
-var
- ButNum : integer;
begin
// adds button
- ButNum := Length(Button);
- SetLength(Button, ButNum + 1);
-// Button[ButNum] := TButton.Create(Texture.GetTexture(Name, Typ));
+ Result := Length(Button);
+ SetLength(Button, Result + 1);
+// Button[Result] := TButton.Create(Texture.GetTexture(Name, Typ));
// check here for cache
// Texture.GetTexture(Name, Typ, false); // preloads textures and creates cahce mipmap when needed
// if Covers.CoverExists(Name) then
- Button[ButNum] := TButton.Create(Texture.GetTexture(Name, Typ, true)); // use cache texture
+ Button[Result] := TButton.Create(Texture.GetTexture(Name, Typ, true)); // use cache texture
// else
-// Button[ButNum] := TButton.Create(Texture.GetTexture(Name, Typ, false)); // don't use cache texture}
+// Button[Result] := TButton.Create(Texture.GetTexture(Name, Typ, false)); // don't use cache texture}
// configures button
- Button[ButNum].Texture.X := X;
- Button[ButNum].Texture.Y := Y;
- Button[ButNum].Texture.W := W;
- Button[ButNum].Texture.H := H;
- Button[ButNum].SelectColR := ColR;
- Button[ButNum].SelectColG := ColG;
- Button[ButNum].SelectColB := ColB;
- Button[ButNum].SelectInt := Int;
- Button[ButNum].DeselectColR := DColR;
- Button[ButNum].DeselectColG := DColG;
- Button[ButNum].DeselectColB := DColB;
- Button[ButNum].DeselectInt := DInt;
- Button[ButNum].Texture.TexX1 := 0;
- Button[ButNum].Texture.TexY1 := 0;
- Button[ButNum].Texture.TexX2 := 1;
- Button[ButNum].Texture.TexY2 := 1;
- Button[ButNum].SetSelect(false);
-
- Button[ButNum].Reflection := Reflection;
+ Button[Result].Texture.X := X;
+ Button[Result].Texture.Y := Y;
+ Button[Result].Texture.W := W;
+ Button[Result].Texture.H := H;
+ Button[Result].SelectColR := ColR;
+ Button[Result].SelectColG := ColG;
+ Button[Result].SelectColB := ColB;
+ Button[Result].SelectInt := Int;
+ Button[Result].DeselectColR := DColR;
+ Button[Result].DeselectColG := DColG;
+ Button[Result].DeselectColB := DColB;
+ Button[Result].DeselectInt := DInt;
+ Button[Result].Texture.TexX1 := 0;
+ Button[Result].Texture.TexY1 := 0;
+ Button[Result].Texture.TexX2 := 1;
+ Button[Result].Texture.TexY2 := 1;
+ Button[Result].SetSelect(false);
+
+ Button[Result].Reflection := Reflection;
// adds interaction
- AddInteraction(iButton, ButNum);
+ AddInteraction(iButton, Result);
Interaction := 0;
end;
|