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 Nov 2, 2024
2 parents c87d6ab + cd266d7 commit 95bc867
Show file tree
Hide file tree
Showing 43 changed files with 716 additions and 360 deletions.
Binary file modified assets/missing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 15 additions & 14 deletions css/dialogs.css
Original file line number Diff line number Diff line change
Expand Up @@ -1559,8 +1559,9 @@
overflow: hidden;
max-width: unset;
}
#plugin_browser_details {
.plugin_browser_tabbed_page {
padding: 8px 24px;
overflow-y: auto;
}
#plugin_browser_details tr:nth-child(even) {
background-color: var(--color-back);
Expand All @@ -1569,10 +1570,6 @@
padding: 5px 2px;
line-height: 20px;
}
#plugin_browser_changelog {
padding: 4px 20px;
overflow-y: auto;
}
#plugin_browser_changelog > li {
padding: 7px 8px;
}
Expand Down Expand Up @@ -1608,12 +1605,6 @@
font-size: 20px;
margin-right: 2px;
}
#plugin_browser_page .settings_list {
padding: 4px 20px;
}
#plugin_browser_page .features_list {
padding: 4px 20px;
}
li.plugin_feature_entry {
display: flex;
gap: 8px;
Expand Down Expand Up @@ -2336,14 +2327,24 @@
align-items: center;
cursor: pointer;
padding: 2px;
position: relative;
}
.flipbook_frame:hover {
background-color: var(--color-hover);
color: var(--color-light);
background-color: var(--color-back);
}
.flipbook_frame.viewing::before {
content: "";
position: absolute;
left: 0;
top: 10px;
bottom: 10px;
border-top: 40px solid transparent;
border-bottom: 40px solid transparent;
border-left: 8px solid var(--color-accent);
}
.flipbook_frame.viewing {
background-color: var(--color-accent);
color: var(--color-accent_text);
background-color: var(--color-back);
}
.flipbook_frame.selected {
background-color: var(--color-accent);
Expand Down
5 changes: 1 addition & 4 deletions css/setup.css
Original file line number Diff line number Diff line change
Expand Up @@ -738,15 +738,12 @@
display: inline-block;
width: 20px;
height: 24px;
margin-top: -28px;
margin-top: -29px;
user-select: none;
margin-left: -42px;
overflow: hidden;
text-align: center;
}
div.nslide_arrow.na_right {
margin-left: 16px;
}
div.nslide.editing {
cursor: text;
}
Expand Down
3 changes: 2 additions & 1 deletion js/animations/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const Timeline = {
return
};

if (Timeline.selector.interval) clearInterval(Timeline.selector.interval);
Timeline.selector.interval = setInterval(Timeline.selector.move, 1000/60);
document.addEventListener('mouseup', Timeline.selector.end, false);

Expand Down Expand Up @@ -195,8 +196,8 @@ const Timeline = {
end(e) {
e.stopPropagation();
document.removeEventListener('mousemove', Timeline.selector.move);
clearInterval(Timeline.selector.interval);
document.removeEventListener('mouseup', Timeline.selector.end);
clearInterval(Timeline.selector.interval);

if (!Timeline.selector.selecting) {
if (settings.canvas_unselect.value) {
Expand Down
29 changes: 25 additions & 4 deletions js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,35 @@ const Blockbench = {
showMessageBox(options = 0, cb) {
return new MessageBox(options, cb).show();
},
async textPrompt(title, value, callback, placeholder = null) {
/**
*
* @param {*} title
* @param {*} value
* @param {*} callback
* @param {object} options Options
* @param {string} options.info Info text
* @param {string} options.description Description for the text input
* @returns {Promise<string>} Input value
*/
async textPrompt(title, value, callback, options = 0) {
if (typeof options == 'string') {
options = {placeholder: options};
console.warn('textPrompt: 4th argument is expected to be a string');
}
let answer = await new Promise((resolve) => {
let form = {
text: {full_width: true, placeholder: options.placeholder, value, description: options.description}
};
if (options.info) {
form.description = {
type: 'info',
text: tl(options.info)
}
}
new Dialog({
id: 'text_input',
title: title || 'dialog.input.title',
form: {
text: {full_width: true, placeholder, value}
},
form,
onConfirm({text}) {
if (callback) callback(text);
resolve(text);
Expand Down
5 changes: 5 additions & 0 deletions js/display_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ class refModel {
setDisplayArea(0, 0, -6, 90, 180, 0, 1, 1, 1);
}
break;
case 'block':
this.updateBasePosition = function() {
setDisplayArea(8, 4, 8, 0, 0, 0, 1, 1, 1)
}
break;
case 'zombie':
this.updateBasePosition = function() {
if (display_slot === 'thirdperson_righthand') {
Expand Down
6 changes: 3 additions & 3 deletions js/interface/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,15 +853,15 @@ class NumSlider extends Widget {
'<div class="nslide_arrow na_right"><i class="material-icons">navigate_next</i></div>'
)

var n = limitNumber(scope.node.clientWidth/2-24, 6, 1000)
var n = limitNumber(scope.node.clientWidth/2-22, 6, 1000)

scope.jq_outer.find('.nslide_arrow.na_left').click(function(e) {
scope.arrow(-1, e)
}).css('margin-left', (-n-24)+'px')
}).css('margin-left', (-n-22)+'px')

scope.jq_outer.find('.nslide_arrow.na_right').click(function(e) {
scope.arrow(1, e)
}).css('margin-left', n+'px')
}).css('margin-left', (n)+'px')
})
.on('mouseleave', function() {
scope.jq_outer.find('.nslide_arrow').remove()
Expand Down
5 changes: 4 additions & 1 deletion js/interface/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -1053,10 +1053,13 @@ BARS.defineActions(function() {
panel.resetCustomLayout();
}

Prop.show_left_bar = true;
Prop.show_right_bar = true;

Blockbench.dispatchEvent('reset_layout', {});

updateInterface();
updateSidebarOrder();
resizeWindow();
}
})
})
6 changes: 4 additions & 2 deletions js/interface/menu_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,12 @@ const MenuBar = {

new BarMenu('timeline', Timeline.menu.structure, {
name: 'panel.timeline',
icon: 'timeline',
condition: {modes: ['animate'], method: () => !AnimationController.selected},
onOpen() {
setActivePanel('timeline');
}
}, {icon: 'timeline'})
})

new BarMenu('display', [
new MenuSeparator('copypaste'),
Expand Down Expand Up @@ -455,6 +456,7 @@ const MenuBar = {
'pixel_grid',
'painting_grid',
new MenuSeparator('references'),
'bedrock_animation_mode',
'preview_scene',
'edit_reference_images',
new MenuSeparator('interface'),
Expand Down Expand Up @@ -507,7 +509,6 @@ const MenuBar = {
singleButton: true
}).show();
}},
'reset_layout',
{name: 'menu.help.developer.reset_storage', icon: 'fas.fa-hdd', click: () => {
factoryResetAndReload();
}},
Expand All @@ -526,6 +527,7 @@ const MenuBar = {
}},
'reload',
]},
'reset_layout',
'about_window'
], {icon: 'help'})
MenuBar.update();
Expand Down
1 change: 1 addition & 0 deletions js/interface/panels.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Panel extends EventSystem {
this.toolbars = [];

if (!Interface.data.panels[this.id]) Interface.data.panels[this.id] = {};
if (!Interface.getModeData().panels[this.id]) Interface.getModeData().panels[this.id] = {};
this.position_data = Interface.getModeData().panels[this.id];
let defaultp = this.default_position = data.default_position || 0;
if (defaultp && defaultp.slot) this.previous_slot = defaultp.slot;
Expand Down
1 change: 1 addition & 0 deletions js/interface/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ const Settings = {
}
Settings.dialog.show();
if (options.search_term) Settings.dialog.content_vue.search_term = options.search_term;
if (options.profile) Settings.dialog.content_vue.profile = options.profile;
Settings.dialog.content_vue.$forceUpdate();
},
old: {}
Expand Down
2 changes: 1 addition & 1 deletion js/io/formats/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var codec = new Codec('obj', {
output.push(`o ${element.name||'cube'}`)

element.getGlobalVertexPositions().forEach((coords) => {
vertex.set(...coords.V3_subtract(8, 8, 8)).divideScalar(export_scale);
vertex.set(...coords).divideScalar(export_scale);
output.push('v ' + vertex.x + ' ' + vertex.y + ' ' + vertex.z);
nbVertex++;
})
Expand Down
Loading

0 comments on commit 95bc867

Please sign in to comment.