Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisX11 committed May 10, 2024
2 parents 05012c7 + 2ed39e2 commit 45903dc
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 12 deletions.
4 changes: 3 additions & 1 deletion css/panels.css
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,9 @@
padding-top: 3px;
width: 34px;
text-align: center;
height: 0;
}
#keyframe_bar_effect .tool > i {
margin-top: 0;
}

.bar.flex > .prism-editor-component {
Expand Down
4 changes: 2 additions & 2 deletions css/window.css
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@
#mode_selector li.selected {
border-bottom: 3px solid var(--color-accent);
}
#update_menu {
padding-top: 2px;
#update_menu .tool > .icon {
margin-top: 3px;
}

/* Tab Bar */
Expand Down
9 changes: 4 additions & 5 deletions js/animations/timeline_animators.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ class EffectAnimator extends GeneralAnimator {
if (diff < 0) return;

let media = Timeline.playing_sounds.find(s => s.keyframe_id == kf.uuid);
if (diff >= 0 && diff < (1/60) * (Timeline.playback_speed/100) && !media) {
if (diff >= 0 && diff < (1/30) * (Timeline.playback_speed/100) && !media) {
if (kf.data_points[0].file && !kf.cooldown) {
media = new Audio(kf.data_points[0].file);
media.keyframe_id = kf.uuid;
Expand All @@ -766,12 +766,11 @@ class EffectAnimator extends GeneralAnimator {
delete kf.cooldown;
}, 400)
}
} else if (diff > 0) {
media = Timeline.playing_sounds.find(s => s.keyframe_id == kf.uuid);
if (Math.abs(media.currentTime - diff) > 0.08) {
} else if (diff > 0 && media) {
if (Math.abs(media.currentTime - diff) > 0.18 && diff < media.duration) {
console.log('Resyncing sound')
// Resync
media.currentTime = diff;
media.currentTime = Math.clamp(diff + 0.08, 0, media.duration);
media.playbackRate = Math.clamp(Timeline.playback_speed/100, 0.1, 4.0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/interface/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ class NumSlider extends Widget {

var scope = this;
this.node = Interface.createElement('div', {class: 'tool wide widget nslide_tool', toolbar_item: this.id}, [
Interface.createElement('div', {class: 'nslide tab_target', inputmode: 'decimal', 'n-action': this.id})
Interface.createElement('div', {class: 'nslide tab_target', inputmode: this.settings?.min >= 0 ? 'decimal' : '', 'n-action': this.id})
])
this.jq_outer = $(this.node)
this.jq_inner = this.jq_outer.find('.nslide');
Expand Down
2 changes: 1 addition & 1 deletion js/interface/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ Interface.CustomElements.SelectInput = function(id, data) {
this.set = setKey;
}
Interface.CustomElements.NumericInput = function(id, data) {
let input = Interface.createElement('input', {id, class: 'dark_bordered focusable_input', value: data.value || 0, inputmode: 'decimal'});
let input = Interface.createElement('input', {id, class: 'dark_bordered focusable_input', value: data.value || 0, inputmode: data.min >= 0 ? 'decimal' : ''});
let slider = Interface.createElement('div', {class: 'tool numeric_input_slider'}, Blockbench.getIconNode('code'));
this.node = Interface.createElement('div', {class: 'numeric_input'}, [
input, slider
Expand Down
2 changes: 1 addition & 1 deletion js/interface/vue_components.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Vue.component('numeric-input', {
},
template: `
<div class="numeric_input">
<input class="dark_bordered focusable_input" :value="string_value" @input="change($event.target.value)" inputmode="decimal" lang="en" @focusout="resolve($event)" @dblclick="resolve($event)">
<input class="dark_bordered focusable_input" :value="string_value" @input="change($event.target.value)" :inputmode="min >= 0 ? 'decimal' : ''" lang="en" @focusout="resolve($event)" @dblclick="resolve($event)">
<div class="tool numeric_input_slider" @mousedown="slide($event)" @touchstart="slide($event)"><i class="material-icons">code</i></div>
</div>
`,
Expand Down
5 changes: 5 additions & 0 deletions js/plugin_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ class Plugin {
this.dependencies.empty();
Plugins.all.remove(this);
this.details = null;
let had_changelog = this.changelog_fetched;
this.changelog_fetched = false;

if (this.source == 'file') {
this.loadFromFile({path: this.path}, false)
Expand All @@ -460,6 +462,9 @@ class Plugin {
}

this.fetchAbout(true);
if (had_changelog && this.has_changelog) {
this.fetchChangelog(true);
}

return this;
}
Expand Down
9 changes: 8 additions & 1 deletion js/preview/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,14 @@ class Preview {
intersect.distance -= depth_offset * 1.4;
}
}
intersects.sort((a, b) => a.distance - b.distance);
if (Toolbox.selected.id == 'vertex_snap_tool') {
intersects.sort((a, b) => {
if (a.object.isPoints != b.object.isPoints) return a.object.isPoints ? -100 : 100;
return a.distance - b.distance;
});
} else {
intersects.sort((a, b) => a.distance - b.distance);
}

let intersect = intersects[0];
let intersect_object = intersect.object;
Expand Down

0 comments on commit 45903dc

Please sign in to comment.