diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-03-30 19:18:27 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-03-30 19:18:27 +0000 |
commit | eb7df4c30c7e119ad56eb3ba8506ff3e3afce4a4 (patch) | |
tree | 85c256bdbc965d0d15cd93c336ce0237ff992652 /Game/Code/Menu | |
parent | 162c1ce5d4c68fc6784fd4a8f0b975b857505574 (diff) | |
download | usdx-eb7df4c30c7e119ad56eb3ba8506ff3e3afce4a4.tar.gz usdx-eb7df4c30c7e119ad56eb3ba8506ff3e3afce4a4.tar.xz usdx-eb7df4c30c7e119ad56eb3ba8506ff3e3afce4a4.zip |
Added Cursor Blink to TText
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@56 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Menu/UMenuText.pas | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/Game/Code/Menu/UMenuText.pas b/Game/Code/Menu/UMenuText.pas index 4a5356d8..4b8ea391 100644 --- a/Game/Code/Menu/UMenuText.pas +++ b/Game/Code/Menu/UMenuText.pas @@ -9,6 +9,9 @@ type SelectBool: boolean;
TextString: String;
TextTiles: Array of String;
+
+ STicks: Cardinal;
+ SelectBlink: Boolean;
public
X: real;
Y: real;
@@ -38,11 +41,15 @@ type end;
implementation
-uses UGraphic, StrUtils;
+uses UGraphic, StrUtils, Windows;
procedure TText.SetSelect(Value: Boolean);
begin
SelectBool := Value;
+
+ //Set Cursor Visible
+ SelectBlink := True;
+ STicks := GettickCount div 550;
end;
procedure TText.SetText(Value: String);
@@ -99,6 +106,10 @@ begin TextTiles[L] := Copy (Value, LastBreak + 1, Length(Value) - LastBreak);
end;
+
+ //Set Cursor Visible
+ SelectBlink := True;
+ STicks := GettickCount div 550;
end;
Procedure TText.DeleteLastL;
@@ -125,9 +136,21 @@ begin SetFontSize(Size);
SetFontItalic(False);
glColor3f(ColR*Int, ColG*Int, ColB*Int);
+
+ //If Selected Set Blink...
+ if SelectBool then
+ begin
+ I := Gettickcount div 550;
+ if I <> STicks then
+ begin //Change Visability
+ STicks := I;
+ SelectBlink := Not SelectBlink;
+ end;
+ end;
+
if (W <= 0) then //No Width set Draw as one Long String
begin
- if not SelectBool then
+ if not (SelectBool AND SelectBlink) then
Text2 := Text
else
Text2 := Text + '|';
@@ -147,7 +170,7 @@ begin Y2 := Y;
for I := 0 to high(TextTiles) do
begin
- if (not SelectBool) OR (I <> high(TextTiles)) then
+ if (not (SelectBool AND SelectBlink)) OR (I <> high(TextTiles)) then
Text2 := TextTiles[I]
else
Text2 := TextTiles[I] + '|';
|