This commit is contained in:
JannisX11 2020-04-27 11:16:52 +02:00
parent f4f02c6b25
commit ae75a1f474
17 changed files with 3125 additions and 109 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
/dist/
index.php
package-lock.json
node_modules/

View File

@ -24,7 +24,7 @@
<script>
if (typeof module === 'object') {window.module = module; module = undefined;}//jQuery Fix
const isApp = typeof require !== 'undefined';
const appVersion = '3.5.0';
const appVersion = '3.5.1';
</script>
<div id="loading_error_message" style="display: none;">
<div>An error occurred while loading Blockbench</div>

View File

@ -92,43 +92,6 @@ const Blockbench = {
}
}
return node
/*
if (icon === undefined) {
//Missing
jq = $('<i class="material-icons icon">help_outline</i>')
} else if (icon instanceof HTMLElement) {
//Node
jq = $(icon)
} else if (icon.substr(0, 2) === 'fa') {
//Font Awesome
if (icon.substr(3, 1) == '.') {
jq = $(`<i class="icon ${icon.substr(0, 3)} fa_big ${icon.substr(4)}"></i>`)
} else {
jq = $('<i class="icon fa fa_big ' + icon + '"></i>')
}
} else if (icon.substr(0, 5) === 'icon-') {
//Icomoon
jq = $('<i class="' + icon + '"></i>')
} else if (icon.substr(0, 14) === 'data:image/png') {
//Data URL
jq = $('<img class="icon" src="'+icon+'">')
} else {
//Material Icon
jq = $('<i class="material-icons icon">' + icon + '</i>')
}
if (color) {
if (color === 'x') {
jq.addClass('color_x')
} else if (color === 'y') {
jq.addClass('color_y')
} else if (color === 'z') {
jq.addClass('color_z')
} else if (typeof color === 'string') {
jq.css('color', color)
}
}
return jq.get(0)
*/
},
showQuickMessage(message, time) {
$('#quick_message_box').remove()

View File

@ -33,6 +33,7 @@ const Language = {
fr: 'Fran\u00E7ais (French)',
it: 'Italiano (Italian)',
ja: '\u65E5\u672C\u8A9E (Japanese)',//日本語
ko: '\uD55C\uAD6D\uC5B4 (Korean)',//日本語
nl: 'Nederlands (Dutch)',
pl: 'Polski (Polish)',
pt: 'Portugu\u00EAs (Portuguese)',

View File

@ -297,7 +297,7 @@ function parseGeometry(data) {
material: b.material
}).init()
group.createUniqueName();
bones[group.name] = group
bones[b.name] = group
if (b.pivot) {
group.origin[0] *= -1
}

View File

@ -382,8 +382,9 @@ var codec = new Codec('modded_entity', {
} else if (scope == 1) {
line = line.replace(/public |static |final |private |void /g, '').trim();
if (line.substr(0, 13) == 'ModelRenderer' || line.substr(0, 13) == 'RendererModel') {
bones[line.split(' ')[1]] = new Group({
name: line.split(' ')[1],
let name = line.split(' ')[1];
bones[name] = new Group({
name,
origin: [0, 24, 0]
}).init();
} else if (line.substr(0, geo_name.length) == geo_name) {

View File

@ -216,10 +216,14 @@ class Cube extends NonGroup {
}
size(axis, floored) {
var scope = this;
let epsilon = 0.0000001;
function getA(axis) {
if (floored === true) {
var n = Math.floor(0.0000001 + scope.to[axis] - scope.from[axis])
return n;
if (floored == TextureGenerator && Format.id === 'modded_entity') {
return Math.ceil(scope.to[axis] - scope.from[axis] - epsilon);
} else if (floored && Format.id !== 'modded_entity') {
return Math.floor(scope.to[axis] - scope.from[axis] + epsilon);
} else {
return scope.to[axis] - scope.from[axis]
}

View File

@ -388,7 +388,7 @@ class Group extends OutlinerElement {
Group.prototype.type = 'group';
Group.prototype.icon = 'fa fa-folder';
Group.prototype.isParent = true;
Group.prototype.name_regex = () => Format.bone_rig ? 'a-z0-9_' : false;
Group.prototype.name_regex = () => Format.bone_rig ? 'a-zA-Z0-9_' : false;
Group.prototype.buttons = [
Outliner.buttons.visibility,
Outliner.buttons.locked,
@ -403,14 +403,6 @@ class Group extends OutlinerElement {
'duplicate',
'_',
'add_locator',
/*
{icon: 'content_copy', name: 'menu.group.duplicate', click: function(group) {
var cubes_before = elements.length
Undo.initEdit({outliner: true, elements: [], selection: true})
group.duplicate().sortInBefore(this, 1).select()
Undo.finishEdit('duplicate_group', {outliner: true, elements: elements.slice(cubes_before), selection: true})
}},
*/
'rename',
{icon: 'sort_by_alpha', name: 'menu.group.sort', condition: {modes: ['edit']}, click: function(group) {group.sortContent()}},
{icon: 'fa-leaf', name: 'menu.group.resolve', condition: {modes: ['edit']}, click: function(group) {
@ -418,6 +410,7 @@ class Group extends OutlinerElement {
group.resolve()
Undo.finishEdit('group resolve')
}},
'delete'
]);
Group.selected;
Group.all = [];

View File

@ -298,7 +298,7 @@ class OutlinerElement {
var name = this.name.replace(/\d+$/, '').replace(/\s+/g, '_');
function check(n) {
for (var i = 0; i < others.length; i++) {
if (others[i] !== scope && others[i].name == n) return false;
if (others[i] !== scope && others[i].name.toLowerCase() == n.toLowerCase()) return false;
}
return true;
}

View File

@ -449,6 +449,7 @@ const Painter = {
//calculate new point
if (face.uv[0] > face.uv[0+2] == uvTag[0] > uvTag[0+2]) {
point_on_uv[0] = Math.max(face.uv[0], face.uv[0+2]) * uvFactorX - point_on_uv[0] - 1;
if (BarItems.slider_brush_size.get()%2 == 0 && Toolbox.selected.brushTool) point_on_uv[0] += 1
} else {
point_on_uv[0] = Math.min(face.uv[0], face.uv[0+2]) * uvFactorX + point_on_uv[0];
}

View File

@ -138,13 +138,13 @@ const TextureGenerator = {
},
//constructor
boxUVCubeTemplate: function(obj, min_size) {
this.x = obj.size(0, true) || min_size;
this.y = obj.size(1, true) || min_size;
this.z = obj.size(2, true) || min_size;
this.x = obj.size(0, TextureGenerator) || min_size;
this.y = obj.size(1, 'template') || min_size;
this.z = obj.size(2, TextureGenerator) || min_size;
this.posx = obj.uv_offset[0];
this.posy = obj.uv_offset[1];
this.obj = obj;
this.template_size = (obj.size(2, true) + obj.size(1, true))+ (obj.size(2, true) + obj.size(0, true))*2;
this.template_size = (obj.size(2, TextureGenerator) + obj.size(1, 'template'))+ (obj.size(2, TextureGenerator) + obj.size(0, TextureGenerator))*2;
this.height = this.z + this.y;
this.width = 2* (this.x + this.z);
@ -170,7 +170,7 @@ const TextureGenerator = {
if (obj.visibility === true) {
var template = new TextureGenerator.boxUVCubeTemplate(obj, min_size);
if (options.double_use && Project.box_uv && textures.length) {
var double_key = [...obj.uv_offset, ...obj.size(undefined, true), ].join('_')
var double_key = [...obj.uv_offset, ...obj.size(undefined, TextureGenerator), ].join('_')
if (doubles[double_key]) {
// improve chances that original is not mirrored
if (doubles[double_key][0].obj.mirror_uv && !obj.mirror_uv) {

View File

@ -1087,27 +1087,27 @@
"dialog.skin.pose": "Pose",
"layout.color.frame": "Fensterrahmen",
"layout.color.frame.desc": "Rand und Titelleiste des Fensters",
"settings.large_grid_size": "Block Grid Size",
"settings.large_grid_size.desc": "Size of the block grid",
"action.load_plugin_from_url": "Load Plugin from URL",
"action.load_plugin_from_url.desc": "Load a plugin from a server by specifying the URL",
"action.cube_counter.desc": "Displays the current number of cubes and other statistics",
"action.unlock_everything": "Unlock Everything",
"action.unlock_everything.desc": "Unlock all groups and elements in the outliner.",
"settings.large_grid_size": "Blockgitter-Größe",
"settings.large_grid_size.desc": "Die Größe des Blockgitters",
"action.load_plugin_from_url": "Plugin über URL laden",
"action.load_plugin_from_url.desc": "Ein Plugin von einen Server laden durch die Eingabe der URL",
"action.cube_counter.desc": "Zeigt die aktuelle Anzahl an Elementen und andere Statistiken an",
"action.unlock_everything": "Alle entsperren",
"action.unlock_everything.desc": "Entsperrt alle Gruppen und Elemente im Outliner",
"action.load_palette": "Palette laden",
"action.load_palette.desc": "Eine der mitgelieferten Paletten laden",
"action.toggle_locked": "Toggle Lock",
"action.toggle_locked.desc": "Toggle whether the selected elements are locked",
"action.apply_display_preset": "Apply Preset",
"action.apply_display_preset.desc": "Apply a default or custom display setting preset",
"action.apply_display_preset.here": "Apply To This Slot",
"action.apply_display_preset.everywhere": "Apply To All Slots",
"action.resolve_keyframe_expressions": "Resolve Keyframe",
"action.resolve_keyframe_expressions.desc": "Resolves the math expressions of the selected keyframes",
"action.fold_all_animations": "Fold All Animators",
"action.toggle_locked": "Sperren/Entsperren",
"action.toggle_locked.desc": "Sperrt oder entsperrt das Objekt",
"action.apply_display_preset": "Vorlage anwenden",
"action.apply_display_preset.desc": "Wendet eine Display Settings Vorlage an",
"action.apply_display_preset.here": "Auf ausgewählte Position anwenden",
"action.apply_display_preset.everywhere": "Auf alle Positionen anwenden",
"action.resolve_keyframe_expressions": "Keyframe ausrechnen",
"action.resolve_keyframe_expressions.desc": "Rechnet die mathematischen Ausdrücke eines Keyframes aus, um sie in Zahlen umzuwandeln",
"action.fold_all_animations": "Alle Animatoren einklappen",
"action.timeline_focus.used": "Verwendet",
"menu.palette.load.empty": "Leer",
"switches.lock": "Lock",
"camera_angle.isometric_right": "Isometric Right",
"camera_angle.isometric_left": "Isometric Left"
"switches.lock": "Sperren",
"camera_angle.isometric_right": "Isometrisch Rechts",
"camera_angle.isometric_left": "Isometrisch Links"
}

View File

@ -745,7 +745,7 @@
"action.delete.desc": "Deletes the selected cubes or group",
"action.sort_outliner": "Sort Outliner",
"action.sort_outliner.desc": "Sort the outliner alphabetically",
"action.unlock_everything": "Unlock Everything",
"action.unlock_everything": "Unlock All",
"action.unlock_everything.desc": "Unlock all groups and elements in the outliner.",
"action.element_colors": "Cube Colors",
"action.element_colors.desc": "Show cube colors in the outliner",

View File

@ -1081,33 +1081,33 @@
"uv_editor.copy_paste_tool.mirror_x": "Invertir X",
"uv_editor.copy_paste_tool.mirror_y": "Invertir Y",
"uv_editor.copy_paste_tool.rotate": "Rotar 90 Grados",
"dialog.project.modded_entity_version": "Export Version",
"dialog.save_angle.position": "Camera Position",
"dialog.save_angle.target": "Focal Point",
"dialog.project.modded_entity_version": "Exportar Versión",
"dialog.save_angle.position": "Posición de la Cámara",
"dialog.save_angle.target": "Punto Focal",
"dialog.skin.pose": "Pose",
"layout.color.frame": "Window Frame",
"layout.color.frame.desc": "Border and title bar of the window",
"settings.large_grid_size": "Block Grid Size",
"settings.large_grid_size.desc": "Size of the block grid",
"action.load_plugin_from_url": "Load Plugin from URL",
"action.load_plugin_from_url.desc": "Load a plugin from a server by specifying the URL",
"action.cube_counter.desc": "Displays the current number of cubes and other statistics",
"action.unlock_everything": "Unlock Everything",
"action.unlock_everything.desc": "Unlock all groups and elements in the outliner.",
"action.load_palette": "Load Palette",
"action.load_palette.desc": "Load one of the built-in palette presets",
"action.toggle_locked": "Toggle Lock",
"action.toggle_locked.desc": "Toggle whether the selected elements are locked",
"action.apply_display_preset": "Apply Preset",
"action.apply_display_preset.desc": "Apply a default or custom display setting preset",
"action.apply_display_preset.here": "Apply To This Slot",
"action.apply_display_preset.everywhere": "Apply To All Slots",
"action.resolve_keyframe_expressions": "Resolve Keyframe",
"action.resolve_keyframe_expressions.desc": "Resolves the math expressions of the selected keyframes",
"action.fold_all_animations": "Fold All Animators",
"action.timeline_focus.used": "In Use",
"menu.palette.load.empty": "Blank",
"switches.lock": "Lock",
"camera_angle.isometric_right": "Isometric Right",
"camera_angle.isometric_left": "Isometric Left"
"layout.color.frame": "Marco de Ventana",
"layout.color.frame.desc": "Borde y barra de título de la ventana",
"settings.large_grid_size": "Tamaño del Bloque de Cuadrícula",
"settings.large_grid_size.desc": "Tamaño del bloque de la cuadrícula",
"action.load_plugin_from_url": "Cargar Plugin desde URL",
"action.load_plugin_from_url.desc": "Carga un plugin desde un servidor a través de una URL",
"action.cube_counter.desc": "Muestra el número actual de cubos y otras estadísticas",
"action.unlock_everything": "Desbloquear Todo",
"action.unlock_everything.desc": "Desbloquea todos los grupos y elementos en el Esquema",
"action.load_palette": "Cargar Paleta",
"action.load_palette.desc": "Carga una de las plantillas de paletas predeterminadas",
"action.toggle_locked": "Cambiar Bloqueo",
"action.toggle_locked.desc": "Cambiar si los elementos actuales están bloqueados o no",
"action.apply_display_preset": "Aplicar Plantilla",
"action.apply_display_preset.desc": "Aplica una plantilla de ajustes de visualización por defecto o personalizada",
"action.apply_display_preset.here": "Aplicar A Este Apartado",
"action.apply_display_preset.everywhere": "Aplicar A Todos los Apartados",
"action.resolve_keyframe_expressions": "Resolver Frame Clave",
"action.resolve_keyframe_expressions.desc": "Resuelve las expresiones matemáticas de los frames clave seleccionados",
"action.fold_all_animations": "Plegar Todos los Animadores",
"action.timeline_focus.used": "En Uso",
"menu.palette.load.empty": "Vacío",
"switches.lock": "Bloquear",
"camera_angle.isometric_right": "Derecha Isométrica",
"camera_angle.isometric_left": "Izquierda Isométrica"
}

1113
lang/ko.json Normal file

File diff suppressed because it is too large Load Diff

1941
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "Blockbench",
"description": "Model editing and animation software",
"version": "3.5.0",
"version": "3.5.1",
"license": "MIT",
"author": {
"name": "JannisX11",