aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Menu
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
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')
-rw-r--r--Game/Code/Menu/UDisplay.pas3
-rw-r--r--Game/Code/Menu/UMenu.pas41
-rw-r--r--Game/Code/Menu/UMenuButton.pas23
-rw-r--r--Game/Code/Menu/UMenuSelect.pas4
-rw-r--r--Game/Code/Menu/UMenuSelectSlide.pas12
-rw-r--r--Game/Code/Menu/UMenuStatic.pas4
-rw-r--r--Game/Code/Menu/UMenuText.pas4
7 files changed, 36 insertions, 55 deletions
diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas
index d2027ca7..c914e0f2 100644
--- a/Game/Code/Menu/UDisplay.pas
+++ b/Game/Code/Menu/UDisplay.pas
@@ -93,9 +93,6 @@ begin
glBindTexture(GL_TEXTURE_2D, pTex[i]);
if glGetError <> GL_NO_ERROR then canFade := False;
- //glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- //if glGetError <> GL_NO_ERROR then canFade := False;
-
glTexImage2D(GL_TEXTURE_2D, 0, 3, TexW, TexH, 0, GL_RGB, GL_UNSIGNED_BYTE, nil);
if glGetError <> GL_NO_ERROR then canFade := False;
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.
-
diff --git a/Game/Code/Menu/UMenuButton.pas b/Game/Code/Menu/UMenuButton.pas
index 03085478..b91bfd15 100644
--- a/Game/Code/Menu/UMenuButton.pas
+++ b/Game/Code/Menu/UMenuButton.pas
@@ -83,34 +83,14 @@ implementation
uses UDrawTexture, SysUtils, windows;
procedure TButton.SetX(Value: real);
-var
- dx: real;
- T: integer; // text
begin
- {dY := Value - Texture.y;
-
- Texture.X := Value;
-
- for T := 0 to High(Text) do
- Text[T].X := Text[T].X + dY;}
-
PosX := Value;
if (FadeTex.TexNum = -1) then
Texture.X := Value;
-
end;
procedure TButton.SetY(Value: real);
-var
- dY: real;
- T: integer; // text
begin
- {dY := Value - PosY;
-
-
- for T := 0 to High(Text) do
- Text[T].Y := Text[T].Y + dY;}
-
PosY := Value;
if (FadeTex.TexNum = -1) then
Texture.y := Value;
@@ -267,6 +247,7 @@ var
Tick: Cardinal;
Spacing: Real;
begin
+ T := 0;
if Visible then begin
//Fade Mod
if Fade then
@@ -485,4 +466,4 @@ begin
end;
-end.
+end. \ No newline at end of file
diff --git a/Game/Code/Menu/UMenuSelect.pas b/Game/Code/Menu/UMenuSelect.pas
index 2362ff4f..67c36111 100644
--- a/Game/Code/Menu/UMenuSelect.pas
+++ b/Game/Code/Menu/UMenuSelect.pas
@@ -99,8 +99,6 @@ begin
end;
procedure TSelect.SetSelect(Value: boolean);
-var
- SO: integer;
begin // default 1, 0.4
SelectBool := Value;
if Value then begin
@@ -195,4 +193,4 @@ begin
end;
end;
-end.
+end. \ No newline at end of file
diff --git a/Game/Code/Menu/UMenuSelectSlide.pas b/Game/Code/Menu/UMenuSelectSlide.pas
index b5d68aff..712e23cc 100644
--- a/Game/Code/Menu/UMenuSelectSlide.pas
+++ b/Game/Code/Menu/UMenuSelectSlide.pas
@@ -117,9 +117,6 @@ begin
end;
procedure TSelectSlide.SetSelect(Value: boolean);
-var
- SO: integer;
- I: integer;
begin
SelectBool := Value;
if Value then begin
@@ -173,11 +170,10 @@ end;
procedure TSelectSlide.SetSelectOpt(Value: integer);
var
SO: integer;
- Sel: integer;
HalfL: integer;
HalfR: integer;
-procedure DoSelection(Sel: Cardinal);
+procedure DoSelection(Sel: Integer);
var I: Integer;
begin
for I := low(TextOpt) to high(TextOpt) do
@@ -205,7 +201,7 @@ begin
if (Value <= 0) then
begin //First Option Selected
- Value := 0;
+ //Value := 0;
for SO := low (TextOpt) to high(TextOpt) do
begin
@@ -216,7 +212,7 @@ begin
end
else if (Value >= high(TextOptT)) then
begin //Last Option Selected
- Value := high(TextOptT);
+ //Value := high(TextOptT);
for SO := high(TextOpt) downto low (TextOpt) do
begin
@@ -342,4 +338,4 @@ begin
end;
end;
-end.
+end. \ No newline at end of file
diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas
index 758869e6..b877b6a6 100644
--- a/Game/Code/Menu/UMenuStatic.pas
+++ b/Game/Code/Menu/UMenuStatic.pas
@@ -21,8 +21,6 @@ implementation
uses UDrawTexture;
procedure TStatic.Draw;
-var
- Pet: integer;
begin
if Visible then
begin
@@ -81,4 +79,4 @@ begin
Texture := Textura;
end;
-end.
+end. \ No newline at end of file
diff --git a/Game/Code/Menu/UMenuText.pas b/Game/Code/Menu/UMenuText.pas
index 315a7302..8409b09f 100644
--- a/Game/Code/Menu/UMenuText.pas
+++ b/Game/Code/Menu/UMenuText.pas
@@ -73,7 +73,7 @@ var
Function GetNextPos: Boolean;
var
- T1, T2, T3: Cardinal;
+ T1, T3: Cardinal;
begin
LastPos := NextPos;
@@ -321,4 +321,4 @@ begin
end;
-end.
+end. \ No newline at end of file