//------------------------------------------------ // 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; }