From 3208e0e9bdc726e50a2781bee01df1c4c9523423 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Sat, 17 Oct 2020 15:17:27 +0200 Subject: [PATCH] Visual tweaks Fix keyframe copy-pasting --- css/general.css | 6 +++--- js/animations/animation.js | 5 ++--- js/animations/keyframe.js | 2 +- js/interface/actions.js | 2 +- js/interface/keyboard.js | 6 +++--- lang/en.json | 12 ++++++------ 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/css/general.css b/css/general.css index 6e973163..c35b730c 100644 --- a/css/general.css +++ b/css/general.css @@ -442,11 +442,11 @@ position: absolute; background-color: var(--color-ui); color: var(--color-text); + border: 1px solid var(--color-bright_ui); padding: 2px 6px; - box-shadow: 0 0 4px black; - margin-top: 4px; + margin-top: 1px; font-size: 0.84em; - margin-left: -6px; + margin-left: -5px; opacity: 0; } .tool:hover > .tooltip .tooltip_description { diff --git a/js/animations/animation.js b/js/animations/animation.js index 360be3de..c771c9c0 100644 --- a/js/animations/animation.js +++ b/js/animations/animation.js @@ -1227,12 +1227,11 @@ const Animator = { } } }, - showMotionTrail() { - let target = Group.selected; + showMotionTrail(target = Group.selected) { let animation = Animation.selected; let currentTime = Timeline.time; let step = Timeline.getStep(); - let max_time = Math.max(Timeline.time, animation.length); + let max_time = Math.max(Timeline.time, animation.getMaxLength()); if (!max_time) max_time = 1; let start_time = 0; if (max_time > 20) { diff --git a/js/animations/keyframe.js b/js/animations/keyframe.js index c0f8d869..d108d315 100644 --- a/js/animations/keyframe.js +++ b/js/animations/keyframe.js @@ -653,7 +653,7 @@ BARS.defineActions(function() { } }) new Action('change_keyframe_file', { - icon: 'fa-file-audio', + icon: 'fa-file', category: 'animation', condition: () => (isApp && Animator.open && Timeline.selected.length && ['sound', 'particle'].includes(Timeline.selected[0].channel)), click: function () { diff --git a/js/interface/actions.js b/js/interface/actions.js index f477fd9e..67accf4d 100644 --- a/js/interface/actions.js +++ b/js/interface/actions.js @@ -94,7 +94,7 @@ class BarItem { // description if (!description.length) return; - description.css('margin-left', '-6px') + description.css('margin-left', '-5px') var offset = description?.offset() offset.right = offset.left + parseInt(description.css('width').replace(/px/, '')) - $(window).width() diff --git a/js/interface/keyboard.js b/js/interface/keyboard.js index 2d88e7ca..0e138426 100644 --- a/js/interface/keyboard.js +++ b/js/interface/keyboard.js @@ -380,7 +380,7 @@ window.addEventListener('focus', event => { setTimeout(remove_func, 100); }) -function getInputFocusElement() { +function getFocusedTextInput() { return $('input[type="text"]:focus, input[type="number"]:focus, *[contenteditable="true"]:focus, textarea:focus').get(0) } @@ -395,7 +395,7 @@ $(document).on('keydown mousedown', function(e) { } var used = false; - var input_focus = getInputFocusElement() + var input_focus = getFocusedTextInput() if (input_focus) { //User Editing Anything @@ -509,7 +509,7 @@ $(document).on('keydown mousedown', function(e) { } }) document.addEventListener('wheel', (e) => { - if (getInputFocusElement()) return; + if (getFocusedTextInput()) return; let used = false; Keybinds.actions.forEach(function(action) { if ( diff --git a/lang/en.json b/lang/en.json index 192eb33c..5b0abf16 100644 --- a/lang/en.json +++ b/lang/en.json @@ -871,13 +871,13 @@ "action.move_back.desc": "Move the selected cubes back relative to the current camera angle", "action.fullscreen": "Fullscreen", - "action.fullscreen.desc": "Toggles fullscreen mode.", + "action.fullscreen.desc": "Toggles fullscreen mode", "action.zoom_in": "Zoom In", - "action.zoom_in.desc": "Zoom in to scale up the interface.", + "action.zoom_in.desc": "Zoom in to scale up the interface", "action.zoom_out": "Zoom Out", - "action.zoom_out.desc": "Zoom out to scale down the interface.", + "action.zoom_out.desc": "Zoom out to scale down the interface", "action.zoom_reset": "Reset Zoom", - "action.zoom_reset.desc": "Reset zoom to the default 100%.", + "action.zoom_reset.desc": "Reset zoom to the default 100%", "action.reset_interface": "Reset Interface", "action.reset_interface.desc": "Reset size and positions of the GUI", "action.toggle_wireframe": "Toggle Wireframe", @@ -977,8 +977,8 @@ "action.keyframe_interpolation.desc": "Select the keyframe interpolation mode", "action.keyframe_interpolation.linear": "Linear", "action.keyframe_interpolation.catmullrom": "Smooth", - "action.change_keyframe_file": "Select File", - "action.change_keyframe_file.desc": "Select an audio file to preview a sound effect.", + "action.change_keyframe_file": "Select Keyframe File", + "action.change_keyframe_file.desc": "Select an audio or particle file to preview an effect", "action.reset_keyframe": "Reset Keyframe", "action.reset_keyframe.desc": "Reset all values of the selected keyframes", "action.resolve_keyframe_expressions": "Resolve Keyframe",