mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
85 lines
2.0 KiB
Plaintext
85 lines
2.0 KiB
Plaintext
//------------------------------------------------
|
|
// player_slicing.scriptlib
|
|
//
|
|
// 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;
|
|
}
|