Skip to content

Commit bcf28f5

Browse files
committed
Merge branch 'patch' into next
2 parents 16e486f + b324699 commit bcf28f5

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

js/boot_loader.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { loadThemes } from "./interface/themes";
44
import { translateUI } from "./languages";
55
import { loadInstalledPlugins } from "./plugin_loader";
66
import { animate } from "./preview/preview";
7-
import { ipcRenderer, process, SystemInfo } from "./native_apis";
7+
import { ipcRenderer, SystemInfo } from "./native_apis";
88
import { initializeDesktopApp, loadOpenWithBlockbenchFile } from "./desktop";
99
import { AutoBackup } from "./auto_backup";
10+
import { initReferenceImages } from "./preview/reference_images";
1011

1112
Interface.page_wrapper = document.getElementById('page_wrapper');
1213
Interface.work_screen = document.getElementById('work_screen');
@@ -57,6 +58,7 @@ BARS.setupVue()
5758
MenuBar.setup()
5859
translateUI()
5960
loadThemes()
61+
initReferenceImages()
6062

6163
console.log(`Three.js r${THREE.REVISION}`)
6264
console.log('%cBlockbench ' + Blockbench.version + (isApp

js/native_apis.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const REQUESTABLE_APIS = [
5555
'v8',
5656
'dialog',
5757
'clipboard',
58+
'shell',
5859
];
5960
const API_DESCRIPTIONS = {
6061
fs: 'access and change files on your computer',
@@ -65,6 +66,7 @@ const API_DESCRIPTIONS = {
6566
https: 'create servers and talk to other servers',
6667
dialog: 'open native dialogs',
6768
clipboard: 'read and write to the clipboard',
69+
shell: 'open files, folders, and links, and move objects to trash',
6870
};
6971
type PluginPermissions = {
7072
allowed: Record<string, boolean|any>
@@ -185,6 +187,8 @@ function getModule(module_name: string, plugin_id: string, plugin: PluginOrDevTo
185187
return process;
186188
} else if (no_namespace_name == 'clipboard') {
187189
return clipboard;
190+
} else if (no_namespace_name == 'shell') {
191+
return shell;
188192
} else if (no_namespace_name == 'dialog') {
189193
let api = {};
190194
for (let key in dialog) {

js/preview/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ export class Preview {
14811481
let rect_start = [c.ax, c.ay];
14821482
let rect_end = [c.bx, c.by];
14831483
let extend_selection = (event.shiftKey || Pressing.overrides.shift) ||
1484-
((event.ctrlOrCmd || Pressing.overrides.ctrl) && !Keybinds.extra.preview_area_select.keybind.ctrl)
1484+
((event.ctrlOrCmd || Pressing.overrides.ctrl) && !Keybinds.extra.preview_area_select.keybind.ctrl && !Keybinds.extra.preview_area_select.keybind.meta)
14851485
let selection_mode = BarItems.selection_mode.value;
14861486
let spline_selection_mode = BarItems.spline_selection_mode.value;
14871487

js/preview/reference_images.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,9 +922,11 @@ ReferenceImage.updateAll = function() {
922922
}
923923

924924
StateMemory.init('global_reference_images', 'array');
925-
StateMemory.global_reference_images.forEach(template => {
926-
new ReferenceImage(template).addAsGlobalReference();
927-
});
925+
export async function initReferenceImages() {
926+
StateMemory.global_reference_images.forEach(template => {
927+
new ReferenceImage(template).addAsGlobalReference();
928+
});
929+
}
928930

929931
SharedActions.add('delete', {
930932
condition: () => ReferenceImageMode.active && ReferenceImage.selected,

js/texturing/painter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export const Painter = {
116116
return;
117117
}
118118
let [x, y] = Painter.getCanvasToolPixelCoords(data.intersects[0].uv, texture);
119+
UVEditor.vue.texture = texture;
119120

120121
Painter.startPaintTool(texture, x, y, data.element.faces[data.face].uv, e, data)
121122

js/uv/uv.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4626,6 +4626,8 @@ Interface.definePanels(function() {
46264626
return [x * dir_x, y * dir_y];
46274627
},
46284628
onEnd: () => {
4629+
this.texture.updateLayerChanges(true);
4630+
this.texture.saved = false;
46294631
Undo.finishEdit('Resize layer');
46304632
Blockbench.setCursorTooltip();
46314633
if (dir_x && dir_y) Interface.removeSuggestedModifierKey('alt', 'modifier_actions.no_uniform_scaling');

0 commit comments

Comments
 (0)