From 2b8852421a83624f20d687c399b9b6732b58c56e Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Sun, 28 Feb 2021 00:42:01 +0100 Subject: [PATCH] Save color picker tab between sessions Fix plugin install message Fix issue with gimbal controls in display mode locked slots --- css/window.css | 1 - js/plugin_loader.js | 4 ++-- js/preview/preview.js | 2 +- js/texturing/color.js | 8 +++++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/css/window.css b/css/window.css index e0176d1d..ce2f5d81 100644 --- a/css/window.css +++ b/css/window.css @@ -596,7 +596,6 @@ } #start_screen section#start-files left { width: 38%; - overflow: hidden; padding: 20px 24px 0px 24px; position: relative; display: flex; diff --git a/js/plugin_loader.js b/js/plugin_loader.js index 7d643e2b..eab30ffd 100644 --- a/js/plugin_loader.js +++ b/js/plugin_loader.js @@ -68,7 +68,7 @@ class Plugin { var scope = this; Plugins.registered[this.id] = this; return await new Promise((resolve, reject) => { - $.getScript(Plugins.path + scope.id + '.js', function() { + $.getScript(Plugins.path + scope.id + '.js', () => { if (cb) cb.bind(scope)() scope.bindGlobalData(first) if (first && scope.oninstall) { @@ -76,7 +76,7 @@ class Plugin { } if (first) Blockbench.showQuickMessage(tl('message.installed_plugin', [this.title])); resolve() - }).fail(function() { + }).fail(() => { if (isApp) { console.log('Could not find file of plugin "'+scope.id+'". Uninstalling it instead.') scope.uninstall() diff --git a/js/preview/preview.js b/js/preview/preview.js index c3bae813..cf78a157 100644 --- a/js/preview/preview.js +++ b/js/preview/preview.js @@ -1290,7 +1290,7 @@ class GimbalControls { // Interact addEventListeners(this.node, 'mousedown touchstart', e1 => { - if (!scope.preview.controls.enableRotate && scope.preview.angle == null) return; + if (!scope.preview.controls.enableRotate || !scope.preview.controls.enabled || scope.preview.angle != null) return; convertTouchEvent(e1); let last_event = e1; let move_calls = 0; diff --git a/js/texturing/color.js b/js/texturing/color.js index 023ab9ce..bb2879bb 100644 --- a/js/texturing/color.js +++ b/js/texturing/color.js @@ -45,6 +45,8 @@ function colorDistance(color1, color2) { ] } Interface.definePanels(() => { + + StateMemory.init('color_picker_tab', 'string') ColorPanel = Interface.Panels.color = new Panel({ id: 'color', icon: 'palette', @@ -84,7 +86,7 @@ Interface.definePanels(() => { Interface.Panels.color.vue = new Vue({ el: '#color_panel_wrapper', data: { - open_tab: 'picker', + open_tab: StateMemory.color_picker_tab || 'picker', main_color: '#000000', hover_color: '', get color_code() {return this.hover_color || this.main_color}, @@ -149,6 +151,10 @@ Interface.definePanels(() => { BarItems.slider_color_v.update(); $('#main_colorpicker').spectrum('set', value); this.text_input = value; + }, + open_tab(tab) { + StateMemory.color_picker_tab = tab; + StateMemory.save('color_picker_tab') } } })