Save color picker tab between sessions

Fix plugin install message
Fix issue with gimbal controls in display mode locked slots
This commit is contained in:
JannisX11 2021-02-28 00:42:01 +01:00
parent 486acea2b8
commit 2b8852421a
4 changed files with 10 additions and 5 deletions

View File

@ -596,7 +596,6 @@
}
#start_screen section#start-files left {
width: 38%;
overflow: hidden;
padding: 20px 24px 0px 24px;
position: relative;
display: flex;

View File

@ -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()

View File

@ -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;

View File

@ -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')
}
}
})