Skip to content

Commit

Permalink
Merge pull request #13 from Exabyte-io/feature/SOF-6044
Browse files Browse the repository at this point in the history
Feature/sof 6044
  • Loading branch information
timurbazhirov committed Oct 13, 2022
2 parents 4dd1949 + 5594fb5 commit 5d24291
Show file tree
Hide file tree
Showing 14 changed files with 3,054 additions and 9,317 deletions.
764 changes: 764 additions & 0 deletions editor/examples/rotation.app.json

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions editor/js/Codemirror.js
@@ -0,0 +1,30 @@
import { basicSetup } from 'codemirror';
import { EditorView, keymap } from '@codemirror/view';
import { javascript, esLint } from '@codemirror/lang-javascript';
import { EditorState } from '@codemirror/state';
import { oneDark } from '@codemirror/theme-one-dark';
import { lintGutter, linter } from '@codemirror/lint';
import { indentWithTab } from '@codemirror/commands';
import Linter from 'eslint4b-prebuilt';

const doc = '';
export const Codemirror = ( { container, extensions = [], ...other } ) => {

return new EditorView( {
state: EditorState.create( {
doc,
extensions: [
basicSetup,
javascript(),
oneDark,
keymap.of( [ indentWithTab ] ),
linter( esLint( new Linter() ) ),
lintGutter(),
...extensions
]
} ),
parent: container,
...other
} );

};
4 changes: 2 additions & 2 deletions editor/js/Menubar.Edit.js
Expand Up @@ -151,7 +151,7 @@ function MenubarEdit( editor ) {

//

// options.add( new UIHorizontalRule() );
options.add( new UIHorizontalRule() );

// Set textures to sRGB. See #15903

Expand All @@ -163,7 +163,7 @@ function MenubarEdit( editor ) {
editor.scene.traverse( fixColorMap );

} );
// options.add( option );
options.add( option );

const colorMaps = [ 'map', 'envMap', 'emissiveMap' ];

Expand Down
19 changes: 4 additions & 15 deletions editor/js/Menubar.Examples.js
@@ -1,6 +1,5 @@
import * as THREE from 'three';

import { UIPanel, UIRow } from './libs/ui.js';
import rotation from '../examples/rotation.app.json';

function MenubarExamples( editor ) {

Expand All @@ -21,15 +20,9 @@ function MenubarExamples( editor ) {
// Examples

const items = [
{ title: 'menubar/examples/Arkanoid', file: 'arkanoid.app.json' },
{ title: 'menubar/examples/Camera', file: 'camera.app.json' },
{ title: 'menubar/examples/Particles', file: 'particles.app.json' },
{ title: 'menubar/examples/Pong', file: 'pong.app.json' },
{ title: 'menubar/examples/Shaders', file: 'shaders.app.json' }
{ title: 'menubar/examples/Rotation', file: rotation },
];

const loader = new THREE.FileLoader();

for ( let i = 0; i < items.length; i ++ ) {

( function ( i ) {
Expand All @@ -43,12 +36,8 @@ function MenubarExamples( editor ) {

if ( confirm( 'Any unsaved data will be lost. Are you sure?' ) ) {

loader.load( 'examples/' + item.file, function ( text ) {

editor.clear();
editor.fromJSON( JSON.parse( text ) );

} );
editor.clear();
editor.fromJSON( item.file );

}

Expand Down
8 changes: 4 additions & 4 deletions editor/js/Menubar.File.js
Expand Up @@ -36,11 +36,11 @@ function MenubarFile( editor ) {
}

} );
// options.add( option );
options.add( option );

//

// options.add( new UIHorizontalRule() );
options.add( new UIHorizontalRule() );

// Import

Expand All @@ -67,11 +67,11 @@ function MenubarFile( editor ) {
fileInput.click();

} );
// options.add( option );
options.add( option );

//

// options.add( new UIHorizontalRule() );
options.add( new UIHorizontalRule() );

// Export Geometry

Expand Down
8 changes: 4 additions & 4 deletions editor/js/Menubar.js
Expand Up @@ -3,10 +3,10 @@ import { UIPanel } from './libs/ui.js';
import { MenubarAdd } from './Menubar.Add.js';
import { MenubarEdit } from './Menubar.Edit.js';
import { MenubarFile } from './Menubar.File.js';
//import { MenubarExamples } from './Menubar.Examples.js';
import { MenubarExamples } from './Menubar.Examples.js';
//import { MenubarView } from './Menubar.View.js';
//import { MenubarHelp } from './Menubar.Help.js';
//import { MenubarPlay } from './Menubar.Play.js';
import { MenubarPlay } from './Menubar.Play.js';
import { MenubarStatus } from './Menubar.Status.js';

function Menubar( editor ) {
Expand All @@ -17,8 +17,8 @@ function Menubar( editor ) {
container.add( new MenubarFile( editor ) );
container.add( new MenubarEdit( editor ) );
container.add( new MenubarAdd( editor ) );
// container.add( new MenubarPlay( editor ) );
// container.add( new MenubarExamples( editor ) );
container.add( new MenubarPlay( editor ) );
container.add( new MenubarExamples( editor ) );
// container.add( new MenubarView( editor ) );
// container.add( new MenubarHelp( editor ) );

Expand Down
3 changes: 1 addition & 2 deletions editor/js/Player.js
Expand Up @@ -30,8 +30,7 @@ function Player( editor ) {
signals.startPlayer.add( function () {

container.setDisplay( '' );

player.load( editor.toJSON() );
player.load( editor );
player.setSize( container.dom.clientWidth, container.dom.clientHeight );
player.play();

Expand Down

0 comments on commit 5d24291

Please sign in to comment.