From 60e6d3f9904a8114e985fccd14454b9b604ea275 Mon Sep 17 00:00:00 2001 From: brunzelchen Date: Wed, 28 Apr 2010 19:54:31 +0000 Subject: - 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 --- Game/Code/Menu/UMenu.pas | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) (limited to 'Game/Code/Menu/UMenu.pas') 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. - -- cgit v1.2.3