Add event hook for adding model loaders

Fix #1568 "Other" menu category appears when nothing is inside it
Add how to set source to Copy Brush description
This commit is contained in:
JannisX11 2022-09-16 15:16:22 +02:00
parent 2143cca0a4
commit 49f2fed12c
2 changed files with 10 additions and 4 deletions

View File

@ -237,10 +237,14 @@ onVueSetup(function() {
categories[format.category].entries.push(format);
}
for (let key in this.formats) {
add(key, this.formats[key])
if (this.formats[key].show_on_start_screen != false) {
add(key, this.formats[key]);
}
}
for (let key in this.loaders) {
add(key, this.loaders[key])
if (this.loaders[key].show_on_start_screen != false) {
add(key, this.loaders[key]);
}
}
return categories;
},
@ -289,7 +293,7 @@ onVueSetup(function() {
class="format_entry" :class="{[format_entry instanceof ModelFormat ? 'format' : 'loader']: true, selected: format_entry.id == selected_format_id}"
:title="format_entry.description"
:format="format_entry.id"
v-if="format_entry.show_on_start_screen && (!redact_names || !format_entry.confidential)"
v-if="(!redact_names || !format_entry.confidential)"
@click="loadFormat(format_entry)"
@dblclick="confirmSetupScreen(format_entry)"
>
@ -435,12 +439,14 @@ class ModelLoader {
if (this.format_page && this.format_page.component) {
Vue.component(`format_page_${this.id}`, this.format_page.component)
}
Blockbench.dispatchEvent('construct_model_loader', {loader: this});
}
new() {
this.onStart();
}
delete() {
delete ModelLoader.loaders[this.id];
Blockbench.dispatchEvent('delete_model_loader', {loader: this});
}
}
ModelLoader.loaders = {};

View File

@ -939,7 +939,7 @@
"action.brush_tool": "Paint Brush",
"action.brush_tool.desc": "Colored brush to draw on textures",
"action.copy_brush": "Copy Brush",
"action.copy_brush.desc": "Brush to clone parts of your texture or draw patterns",
"action.copy_brush.desc": "Brush to clone parts of your texture or draw patterns. Hold Ctrl and click to select a copy source.",
"action.fill_tool": "Paint Bucket",
"action.fill_tool.desc": "Paint bucket to fill entire faces with one color",
"action.eraser": "Eraser",