def toolSelected(self):
        """
        Applies options of BrushToolOptions.
        It then imports all brush modes from their files,
        sets up the panel,
        and sets up the brush preview.
        Called on pressing "2" or pressing the brush button in the hotbar when brush is not selected.
        """
        self.setupBrushModes()
        self.selectedBrushMode = [m for m in self.brushModes][0]
        self.brushMode = self.brushModes[self.selectedBrushMode]
        if self.settings['chooseBlockImmediately']:
            key = getattr(self.brushMode, 'mainBlock', 'Block')
            wcb = getattr(self.brushMode, 'wildcardBlocks', [])
            aw = False
            if key in wcb:
                aw = True
            blockPicker = BlockPicker(self.options[key], self.editor.level.materials, allowWildcards=aw)
            if blockPicker.present():
                    self.options[key] = blockPicker.blockInfo
        if self.settings['updateBrushOffset']:
            self.reticleOffset = self.offsetMax()
        self.resetToolDistance()
        if os.path.isfile(os.path.join(directories.brushesDir, '__temp__.preset')):
            self.loadBrushPreset('__temp__')
        else:
            print 'No __temp__ file found.'
            self.showPanel()
            self.setupPreview()
        if getattr(self.brushMode, 'addPasteButton', False):
            stack = self.editor.copyStack
            if len(stack) == 0:
                self.importPaste()
            else:
                self.loadLevel(stack[0])

        Applies options of BrushToolOptions.
        It then imports all brush modes from their files,
        sets up the panel,
        and sets up the brush preview.
        Called on pressing "2" or pressing the brush button in the hotbar when brush is not selected.
        
editortools/brush.py