Add hidden tools info text in toolbar dialog

Fix #830 Texture turns white when importing project with same texture
Improve performance
This commit is contained in:
JannisX11 2021-03-04 14:06:39 +01:00
parent 2c0f6d39d3
commit 0beeed5c67
9 changed files with 16 additions and 49 deletions

View File

@ -54,6 +54,9 @@
.small_text {
font-size: 0.94em;
}
.subtle {
color: var(--color-subtle_text);
}
.color_x {
color: var(--color-axis-x);
}

View File

@ -174,6 +174,8 @@
</li>
</ul>
<p class="tl small_text subtle">dialog.toolbar_edit.hidden_tools</p>
<div class="bar" style="margin: 4px 0;">
<search-bar v-model="search_term"></search-bar>
</div>

View File

@ -612,7 +612,7 @@ class NumSlider extends Widget {
} else {
width = this.width
}
$(this.node).width(width)
this.node.style.width = width + 'px';
return this;
}
getInterval(e) {

View File

@ -259,13 +259,6 @@ var codec = new Codec('project', {
},
merge(model, path) {
/**
* Todo
*
* texture merging
* UV handling
*/
processHeader(model);
processCompatibility(model);
@ -298,6 +291,10 @@ var codec = new Codec('project', {
let height = model.resolution.height || Project.texture_height;
function loadTexture(tex) {
if (isApp && Texture.all.find(tex2 => tex.path == tex2.path)) {
new_textures.push(Texture.all.find(tex2 => tex.path == tex2.path));
return;
}
var tex_copy = new Texture(tex, tex.uuid).add(false);
if (isApp && tex.path && fs.existsSync(tex.path) && !model.meta.backup) {
tex_copy.fromPath(tex.path)

View File

@ -40,43 +40,6 @@ function setupDragHandlers() {
}
)
}
function loadModelFile(file) {
if (showSaveDialog()) {
resetProject();
(function() {
var extension = pathToExtension(file.path);
// Text
for (var id in Codecs) {
let codec = Codecs[id];
if (codec.load_filter && codec.load_filter.type == 'text') {
if (codec.load_filter.extensions.includes(extension) && Condition(codec.load_filter.condition, file.content)) {
codec.load(file.content, file);
return;
}
}
}
// JSON
var model = autoParseJSON(file.content);
for (var id in Codecs) {
let codec = Codecs[id];
if (codec.load_filter && codec.load_filter.type == 'json') {
if (codec.load_filter.extensions.includes(extension) && Condition(codec.load_filter.condition, model)) {
codec.load(model, file);
return;
}
}
}
})();
EditSession.initNewModel()
if (!Format) {
Modes.options.start.select()
Modes.vue.$forceUpdate()
Blockbench.dispatchEvent('close_project');
}
}
}
var Extruder = {
drawImage: function(file) {
Extruder.canvas = $('#extrusion_canvas').get(0)

View File

@ -681,9 +681,9 @@ class UVEditor {
var old_size = this.size;
var size = input_size;
this.size = size;
this.jquery.frame.width(this.inner_width);
this.jquery.viewport.width(size+8);
this.jquery.main.width(size+8);
this.jquery.frame[0].style.width = (this.inner_width) + 'px';
this.jquery.viewport[0].style.width = (size+8) + 'px';
this.jquery.main[0].style.width = (size+8) + 'px';
for (var id in this.sliders) {
this.sliders[id].setWidth(size/(Project.box_uv?2:4)-1)

View File

@ -591,6 +591,7 @@ function moveElementsInSpace(difference, axis) {
g.origin[axis] += difference
}, Group, true)
}
Canvas.updateAllBones([Group.selected]);
}
selected.forEach(el => {

File diff suppressed because one or more lines are too long

View File

@ -333,6 +333,7 @@
"dialog.toolbar_edit.title": "Customize Toolbar",
"dialog.toolbar_edit.hidden": "Hidden",
"dialog.toolbar_edit.hidden_tools": "Some tools might be hidden because they are not available in the current mode, format, or situation.",
"dialog.entitylist.title": "Open Entity Model",
"dialog.entitylist.text": "Select the model you want to import",