Code: Select all
// Display a "tile button" (returns a key value and can close gump)
//
// Syntax: x, y, release, press, quit, page, key, tilepic, hue, tile-x, tile-y
// (page=0 - it returns a value instead of changing page)
// Don't know if "release" ad "press" are really used by the client
//
// Adds a button to the gump with the specified coords and tilepic as graphic.
// tile-x and tile-y define the coords of the tile graphic, relative to x and y.
//
// returns: A structure...
// .lytidx = Layout-array index changed
// .keyid = KeyID allocated to the button - returned from Gump if pressed
// (butid)
//
function GFButtonTileArtID( x, y, release, press, close, tilepic, hue:= 0, tilex:= 0, tiley:= 0, id := 0 )
// "ButtonTileArt x y release press quit page key tilepic hue tile-x tile-y"
var line := "buttontileart " + CStr(GFref.x + CInt(x)) + " " + CStr(GFref.y + CInt(y));
line := line + " " + CStr(CInt(release)) + " " + CStr(CInt(press)) + " ";
if ( close == 0 )
line := line + "0 0 ";
else
line := line + "1 0 ";
endif
id := CInt(id); // Ensure it's an integer
if ( id < 1 ) // Catch errors (0) and invalid (negative) values
id := GFbutid;
GFbutid := GFbutid + 1; // Update KeyID (butid) (only if used)
endif
line := line + CStr(id);
line := line + " " + CStr(CInt(tilepic)) + " " + CStr(CInt(hue));
line := line + " " + CStr(CInt(tilex)) + " " + CStr(CInt(tiley));
GFlayout.append( line );
return XGFRetVal( GFlayout.size(), -1, id );
endfunction
I will change it to fit in the distro and submit a patch soon...