aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-03-30 19:18:27 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-03-30 19:18:27 +0000
commiteb7df4c30c7e119ad56eb3ba8506ff3e3afce4a4 (patch)
tree85c256bdbc965d0d15cd93c336ce0237ff992652 /Game
parent162c1ce5d4c68fc6784fd4a8f0b975b857505574 (diff)
downloadusdx-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 'Game')
-rw-r--r--Game/Code/Menu/UMenuText.pas29
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] + '|';