Files
dsrc/sku.0/sys.server/compiled/game/script/player/player_slicing.script
T
2013-09-10 23:17:15 -07:00

85 lines
2.1 KiB
Plaintext

//------------------------------------------------
// player_slicing.scriptlib
// Brandon Reinhart
//
// Player interface for slicing callbacks.
//------------------------------------------------
//------------------------------------------------
// Includes
//------------------------------------------------
include library.slicing;
include library.sui;
//------------------------------------------------
// handleSlicingCategory
//------------------------------------------------
messageHandler handleSlicingCategory()
{
// Grab params.
int idx = sui.getListboxSelectedRow( params );
if ( idx < 0 ) idx = 0;
obj_id player = sui.getPlayerId( params );
int btn = sui.getIntButtonPressed( params );
if ( btn == sui.BP_CANCEL )
{
// Clear slicing attempt.
slicing.clearSlicing( self );
return SCRIPT_CONTINUE;
}
// Return the results to the slicing system.
slicing.handleSlicingCategory( self, idx );
return SCRIPT_CONTINUE;
}
//------------------------------------------------
// handleSlicingSelect
//------------------------------------------------
messageHandler handleSlicingSelect()
{
// Grab params.
int idx = sui.getListboxSelectedRow( params );
if ( idx < 0 ) idx = 0;
obj_id player = sui.getPlayerId( params );
int btn = sui.getIntButtonPressed( params );
if ( btn == sui.BP_CANCEL )
{
// Clear slicing attempt.
slicing.clearSlicing( self );
return SCRIPT_CONTINUE;
}
// Return the results to the slicing system.
slicing.handleSlicingSelect( self, idx );
return SCRIPT_CONTINUE;
}
//------------------------------------------------
// handleApplySlice
//------------------------------------------------
messageHandler handleApplySlice()
{
// Grab params.
int idx = sui.getListboxSelectedRow( params );
if ( idx < 0 ) idx = 0;
obj_id player = sui.getPlayerId( params );
int btn = sui.getIntButtonPressed( params );
if ( btn == sui.BP_CANCEL )
{
// Clear slicing attempt.
slicing.clearSlicing( self );
return SCRIPT_CONTINUE;
}
// Return the results to the slicing system.
slicing.handleApplySlice( self, idx );
return SCRIPT_CONTINUE;
}