File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ import './mods/saveProjectActionMod'
44
44
import './mods/saveProjectAsActionMod'
45
45
import './mods/variantPreviewCubeFaceMod'
46
46
import './mods/showDefaultPoseMod'
47
+ import './mods/addLocatorActionMod'
47
48
// Outliner
48
49
import './outliner/textDisplay'
49
50
import './outliner/vanillaItemDisplay'
Original file line number Diff line number Diff line change
1
+ import { isCurrentFormat } from '../blueprintFormat'
2
+ import { PACKAGE } from '../constants'
3
+ import { createBlockbenchMod } from '../util/moddingTools'
4
+
5
+ createBlockbenchMod (
6
+ `${ PACKAGE . name } :addLocatorAction` ,
7
+ {
8
+ action : BarItems . add_locator as Action ,
9
+ originalCondition : ( BarItems . add_locator as Action ) . condition ,
10
+ } ,
11
+ context => {
12
+ context . action . condition = ( ) => {
13
+ if ( isCurrentFormat ( ) ) return true
14
+ return ! ! context . originalCondition ?.( )
15
+ }
16
+
17
+ Toolbars . outliner . add ( context . action , 0 )
18
+
19
+ return context
20
+ } ,
21
+ context => {
22
+ context . action . condition = context . originalCondition
23
+ Toolbars . outliner . remove ( context . action )
24
+ }
25
+ )
You can’t perform that action at this time.
0 commit comments