|
@@ -4,18 +4,19 @@ enum ToolType {
|
|
|
Toggle;
|
|
|
Range;
|
|
|
Color;
|
|
|
+ Menu;
|
|
|
}
|
|
|
class ToolsObject {
|
|
|
static public var level3D : hide.view.l3d.Level3D;
|
|
|
static var texContent : Element = null;
|
|
|
- static public var tools : Map<String, {title : String, ?icon : String, type : ToolType, ?iconTransform : String, ?rightClick : Void -> Void, ?buttonFunction : Void -> Void, ?toggleFunction : Bool -> Void, ?rangeFunction : Float -> Void, ?colorFunction : Int -> Void}> = [
|
|
|
+ static public var tools : Map<String, {title : String, ?icon : String, type : ToolType, ?iconTransform : String, ?rightClick : Void -> Void, ?buttonFunction : Void -> Void, ?toggleFunction : Bool -> Void, ?rangeFunction : Float -> Void, ?colorFunction : Int -> Void, ?menuItems : () -> Array<hide.comp.ContextMenu.ContextMenuItem>}> = [
|
|
|
"perspectiveCamera" => {title : "Perspective camera", icon : "video-camera", type : Button, buttonFunction : () -> @:privateAccess level3D.resetCamera(false)},
|
|
|
"topCamera" => {title : "Top camera", icon : "video-camera", type : Button, iconTransform : "rotateZ(90deg)", buttonFunction : () -> @:privateAccess level3D.resetCamera(true)},
|
|
|
"snapToGroundToggle" => {title : "Snap to ground", icon : "anchor", type : Toggle, toggleFunction : (v) -> level3D.sceneEditor.snapToGround = v},
|
|
|
"localTransformsToggle"=> {title : "Local transforms", icon : "compass", type : Toggle, toggleFunction : (v) -> level3D.sceneEditor.localTransform = v},
|
|
|
"gridToggle" => {title : "Toggle grid", icon : "th", type : Toggle, toggleFunction : (v) -> { @:privateAccess level3D.showGrid = v; @:privateAccess level3D.updateGrid(); }},
|
|
|
"bakeLights" => {title : "Bake lights", icon : "lightbulb-o", type : Button, buttonFunction : () -> @:privateAccess level3D.bakeLights()},
|
|
|
- "sceneeditor.sceneInformationToggle" => {title : "Scene information", icon : "info-circle", type : Toggle, toggleFunction : (b) -> @:privateAccess level3D.statusText.visible = b, rightClick : () -> {
|
|
|
+ "sceneInformationToggle" => {title : "Scene information", icon : "info-circle", type : Toggle, toggleFunction : (b) -> @:privateAccess level3D.statusText.visible = b, rightClick : () -> {
|
|
|
if( texContent != null ) {
|
|
|
texContent.remove();
|
|
|
texContent = null;
|
|
@@ -44,11 +45,14 @@ class ToolsObject {
|
|
|
}
|
|
|
]);
|
|
|
}},
|
|
|
- "sceneeditor.autoSyncToggle" => {title : "Auto synchronize", icon : "refresh", type : Toggle, toggleFunction : (b) -> @:privateAccess level3D.autoSync = b},
|
|
|
- "sceneeditor.backgroundColor" => {title : "Background Color", type : Color, colorFunction : function(v) {
|
|
|
+ "autoSyncToggle" => {title : "Auto synchronize", icon : "refresh", type : Toggle, toggleFunction : (b) -> @:privateAccess level3D.autoSync = b},
|
|
|
+ "graphicsFilters" => {title : "Graphics filters", type : Menu, menuItems : () -> @:privateAccess level3D.filtersToMenuItem(level3D.graphicsFilters, "Graphics")},
|
|
|
+ "sceneFilters" => {title : "Scene filters", type : Menu, menuItems : () -> @:privateAccess level3D.filtersToMenuItem(level3D.sceneFilters, "Scene")},
|
|
|
+ "backgroundColor" => {title : "Background Color", type : Color, colorFunction : function(v) {
|
|
|
@:privateAccess level3D.scene.engine.backgroundColor = v;
|
|
|
@:privateAccess level3D.updateGrid();}},
|
|
|
- "sceneeditor.sceneSpeed" => {title : "Speed", type : Range, rangeFunction : function(v) @:privateAccess level3D.scene.speed = v}
|
|
|
+ "sceneSpeed" => {title : "Speed", type : Range, rangeFunction : function(v) @:privateAccess level3D.scene.speed = v},
|
|
|
+
|
|
|
];
|
|
|
}
|
|
|
typedef ToolToggle = {
|