|
@@ -1,4 +1,4 @@
|
|
|
-import { UIPanel, UIDiv, UIBreak, UISelect, UIButton, UIText } from './libs/ui.js';
|
|
|
+import { UIPanel, UIBreak, UISelect, UIButton, UIText, UINumber, UIRow } from './libs/ui.js';
|
|
|
|
|
|
function SidebarAnimation( editor ) {
|
|
|
|
|
@@ -30,6 +30,7 @@ function SidebarAnimation( editor ) {
|
|
|
|
|
|
animationsSelect.setOptions( options );
|
|
|
animationsSelect.setValue( firstAnimation );
|
|
|
+ mixerTimeScaleNumber.setValue( mixer.timeScale );
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -63,6 +64,12 @@ function SidebarAnimation( editor ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function changeTimeScale() {
|
|
|
+
|
|
|
+ mixer.timeScale = mixerTimeScaleNumber.getValue();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
var container = new UIPanel();
|
|
|
container.setDisplay( 'none' );
|
|
|
|
|
@@ -70,13 +77,26 @@ function SidebarAnimation( editor ) {
|
|
|
container.add( new UIBreak() );
|
|
|
container.add( new UIBreak() );
|
|
|
|
|
|
- var div = new UIDiv();
|
|
|
- container.add( div );
|
|
|
+ //
|
|
|
+
|
|
|
+ var animationsRow = new UIRow();
|
|
|
|
|
|
var animationsSelect = new UISelect().setFontSize( '12px' );
|
|
|
- div.add( animationsSelect );
|
|
|
- div.add( new UIButton( strings.getKey( 'sidebar/animations/play' ) ).setMarginLeft( '4px' ).onClick( playAction ) );
|
|
|
- div.add( new UIButton( strings.getKey( 'sidebar/animations/stop' ) ).setMarginLeft( '4px' ).onClick( stopAction ) );
|
|
|
+ animationsRow.add( animationsSelect );
|
|
|
+ animationsRow.add( new UIButton( strings.getKey( 'sidebar/animations/play' ) ).setMarginLeft( '4px' ).onClick( playAction ) );
|
|
|
+ animationsRow.add( new UIButton( strings.getKey( 'sidebar/animations/stop' ) ).setMarginLeft( '4px' ).onClick( stopAction ) );
|
|
|
+
|
|
|
+ container.add( animationsRow );
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
+ var mixerTimeScaleRow = new UIRow();
|
|
|
+ var mixerTimeScaleNumber = new UINumber( 0.5 ).setWidth( '60px' ).setRange( - 10, 10 ).onChange( changeTimeScale );
|
|
|
+
|
|
|
+ mixerTimeScaleRow.add( new UIText( strings.getKey( 'sidebar/animations/timescale' ) ).setWidth( '90px' ) );
|
|
|
+ mixerTimeScaleRow.add( mixerTimeScaleNumber );
|
|
|
+
|
|
|
+ container.add( mixerTimeScaleRow );
|
|
|
|
|
|
return container;
|
|
|
|