var transf_amt = 0;
BMAP *bmpTransferOn = "transfer_button_click.pcx";
BMAP *bmpTransferOff = "transfer_button.pcx";
BMAP *bmpTransferOver = "transfer_button_hover.pcx";
BMAP *bmpTransferSliderBg = "horizontalSliderBg.pcx";
BMAP *bmpTransferSliderKnob = "horizontalSlider.pcx";
function buttonTransferItems ( var button_id, PANEL *panel )
{
reset ( panel, SHOW );
printf ( "%.0f", (double)transf_amt );
}
PANEL* invTransferAmount =
{
digits ( 590, 490, 5, *, 1, transf_amt );
button ( 640, 510, bmpTransferOn, bmpTransferOff, bmpTransferOver, buttonTransferItems, NULL, NULL );
slider ( 450, 514, bmpTransferSliderBg, bmpTransferSliderKnob, 0, 1, transf_amt );
flags = OUTLINE;
}
...
transf_amt = 0;
var count_max = 1 + floor ( random(10) ); // maximum of items
pan_setslider ( invTransferAmount, 1, 450, 514, bmpTransferSliderBg, bmpTransferSliderKnob, 0, count_max, transf_amt );
set ( invTransferAmount, SHOW );
...