aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Menu
diff options
context:
space:
mode:
authormogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-06 16:46:35 +0000
committermogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-06 16:46:35 +0000
commiteaa18fd6da15849eb20c06320c66d51191ffcdf9 (patch)
tree624b7644b4f9b1f6b5ce45dd14628eb596bbbfbf /Game/Code/Menu
parent6ec8f23c79ff9b4ff3c4a47167b237dc61f39738 (diff)
downloadusdx-eaa18fd6da15849eb20c06320c66d51191ffcdf9.tar.gz
usdx-eaa18fd6da15849eb20c06320c66d51191ffcdf9.tar.xz
usdx-eaa18fd6da15849eb20c06320c66d51191ffcdf9.zip
Option screen has two rows of buttons, to select the row beneath press [cursor down] / [cursor up] for the row above
Settings are not saved if you press [escape] (just for the "main" option screen atm) Long descriptions are used to explain what hides behind a option screen git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1063 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Menu')
-rw-r--r--Game/Code/Menu/UMenu.pas51
1 files changed, 49 insertions, 2 deletions
diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas
index 0eebeaf6..3cdccb0b 100644
--- a/Game/Code/Menu/UMenu.pas
+++ b/Game/Code/Menu/UMenu.pas
@@ -143,7 +143,8 @@ type
procedure InteractPrev; virtual;
procedure InteractInc; virtual;
procedure InteractDec; virtual;
-
+ procedure InteractNextRow; virtual; // this is for the options screen, so button down makes sense
+ procedure InteractPrevRow; virtual; // this is for the options screen, so button up makes sense
procedure AddBox(X, Y, W, H: real);
end;
@@ -886,6 +887,53 @@ begin
end;
end;
+// implemented for the sake of usablility
+// [curser down] picks the button left to the actual atm
+// this behaviour doesn't make sense for two rows of buttons
+procedure TMenu.InteractPrevRow;
+var
+ Int: Integer;
+begin
+// these two procedures just make sense for at least 5 buttons, because we
+// usually start a second row when there are more than 4 buttons
+ Int := Interaction;
+
+ // change interaction as long as it's needed
+ repeat
+ Int := int - ceil(Length(Interactions) / 2);
+
+ //If no Interaction is Selectable Simply Select Next
+ if (Int = Interaction) then Break;
+
+ Until IsSelectable(Int);
+
+ //Set Interaction
+ if ((Int < 0) or (Int > Length(Interactions) - 1))
+ then Int := Interaction //nonvalid button, keep current one
+ else Interaction := Int; //select row above
+end;
+
+procedure TMenu.InteractNextRow;
+var
+ Int: Integer;
+begin
+ Int := Interaction;
+
+ // change interaction as long as it's needed
+ repeat
+ Int := int + ceil(Length(Interactions) / 2);
+
+ //If no Interaction is Selectable Simply Select Next
+ if (Int = Interaction) then Break;
+
+ Until IsSelectable(Int);
+
+ //Set Interaction
+ if ((Int < 0) or (Int > Length(Interactions) - 1))
+ then Int := Interaction //nonvalid button, keep current one
+ else Interaction := Int; //select row above
+end;
+
procedure TMenu.InteractNext;
var
Int: Integer;
@@ -905,7 +953,6 @@ begin
Interaction := Int;
end;
-
procedure TMenu.InteractPrev;
var
Int: Integer;