aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Menu/UMenu.pas
diff options
context:
space:
mode:
authorbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-28 19:54:31 +0000
committerbrunzelchen <brunzelchen@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-28 19:54:31 +0000
commit60e6d3f9904a8114e985fccd14454b9b604ea275 (patch)
treec3dc298e5c81272f3df8e80171ae0f60d8774f2e /Game/Code/Menu/UMenu.pas
parent58a47541955f5010269d72a06e307bbb945211ea (diff)
downloadusdx-60e6d3f9904a8114e985fccd14454b9b604ea275.tar.gz
usdx-60e6d3f9904a8114e985fccd14454b9b604ea275.tar.xz
usdx-60e6d3f9904a8114e985fccd14454b9b604ea275.zip
- new SDL.dll (with a quick and dirty workaround for the hanging-mouse problem)
- changing of sorting and folder-option (on/off) does not need any restart now - a lot of code clean up - some bugfixes... i hope... dont't know which... git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1 Challenge MOD@2316 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Menu/UMenu.pas')
-rw-r--r--Game/Code/Menu/UMenu.pas41
1 files changed, 26 insertions, 15 deletions
diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas
index ca91a65c..a0f8904d 100644
--- a/Game/Code/Menu/UMenu.pas
+++ b/Game/Code/Menu/UMenu.pas
@@ -282,8 +282,8 @@ begin
if Name <> '' then begin
// BackImg := Texture.LoadTexture(false, PChar(Skin.SkinPath + FileName), 'JPG', 'Plain', 0); // new theme system
BackImg := Texture.GetTexture(Skin.GetTextureFileName(Name), 'Plain');
- BackImg.W := 800;
- BackImg.H := 600;
+ BackImg.W := RenderW;
+ BackImg.H := RenderH;
BackW := 1;
BackH := 1;
end;
@@ -383,15 +383,11 @@ begin
end;
function TMenu.AddStatic(X, Y, W, H: real; ColR, ColG, ColB: real; Name, Format, Typ: string): integer;
-var
- StatNum: integer;
begin
Result := AddStatic(X, Y, W, H, ColR, ColG, ColB, Name, Format, Typ, $FFFFFF);
end;
function TMenu.AddStatic(X, Y, W, H, Z: real; ColR, ColG, ColB: real; Name, Format, Typ: string): integer;
-var
- StatNum: integer;
begin
Result := AddStatic(X, Y, W, H, Z, ColR, ColG, ColB, Name, Format, Typ, $FFFFFF);
end;
@@ -417,8 +413,6 @@ begin
end;
function TMenu.AddStatic(X, Y, W, H: real; ColR, ColG, ColB: real; Name, Format, Typ: string; Color: integer): integer;
-var
- StatNum: integer;
begin
Result := AddStatic(X, Y, W, H, 0, ColR, ColG, ColB, Name, Format, Typ, Color);
end;
@@ -516,7 +510,7 @@ function TMenu.AddButton(ThemeButton: TThemeButton): integer;
var
BT: integer;
BTLen: integer;
- temp: integer;
+
begin
{ Result := AddButton(ThemeButton.X, ThemeButton.Y, ThemeButton.W, ThemeButton.H,
ThemeButton.ColR, ThemeButton.ColG, ThemeButton.ColB, ThemeButton.Int,
@@ -636,8 +630,30 @@ begin
end;
procedure TMenu.ClearButtons;
+var
+ I: Integer;
+ num: Integer;
+
begin
- Setlength(Button, 0);
+ num := 0;
+ for I := 0 to Length(Interactions) - 1 do
+ begin
+ if (Interactions[I].Typ <> iButton) then
+ begin
+ Interactions[num].Typ := Interactions[I].Typ;
+ Interactions[num].Num := num;
+ Inc(num);
+ end;
+ end;
+
+ SetLength(Interactions, num);
+ SetLength(Button, 0);
+
+ //Set ButtonPos to Autoset Length
+ ButtonPos := -1;
+ SelInteraction := 0;
+ if(num>0) then
+ Interaction := 0;
end;
// Method to draw our TMenu and all his child buttons
@@ -822,10 +838,6 @@ end;
procedure TMenu.InteractCustom(CustomSwitch: integer);
-var
- Num: integer;
- Typ: integer;
- Again: boolean;
begin
//Code Commented atm, because it needs to be Rewritten
//it doesn't work with Button Collections
@@ -1445,4 +1457,3 @@ begin
end;
end.
-