From a110b1048456a50550f574c19d844d760a70dcbe Mon Sep 17 00:00:00 2001 From: Ian C Date: Wed, 5 Oct 2005 00:12:15 +0000 Subject: Added hide buttons option --- menu.bmx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/menu.bmx b/menu.bmx index 1a9c220..eea7aed 100644 --- a/menu.bmx +++ b/menu.bmx @@ -31,20 +31,24 @@ Type TMenu list.AddLast(TMenuOpt.Create(x,y,i,id)) End Method - ' Returns the selected item, or -1 for none. Err, so don't use -1 as an ID. + ' Returns the selected item, or -1 for none. Err, so don't use -1 as an ID. Set hide to remove the buttons. ' - Method Render:Int() - Local in:Int=-1 - Local mx:Int=MouseX() - Local my:Int=MouseY() - Local any:Int=False - + Method Render:Int(hide:Int) SetAlpha(0.5) For Local p:TMenuBdrop=EachIn bdrop p.Update() Next SetAlpha(1) + If hide + Return -1 + EndIf + + Local in:Int=-1 + Local mx:Int=MouseX() + Local my:Int=MouseY() + Local any:Int=False + For Local opt:TMenuOpt=EachIn list If opt.InBox(mx,my) SetColor(255,255,255) @@ -70,7 +74,6 @@ Type TMenu mbdown=False EndIf - Return in End Method End Type -- cgit v1.2.3