Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisX11 committed Dec 16, 2023
2 parents 0c6c6d7 + eeae5d2 commit 5fd4d33
Show file tree
Hide file tree
Showing 22 changed files with 587 additions and 420 deletions.
2 changes: 1 addition & 1 deletion css/panels.css
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ span.controller_state_section_info {
--color-uv-background: transparent;
--uv-line-width: 1px;
}
#uv_frame.overlay_mode * {
#uv_frame.overlay_mode .uv_face {
pointer-events: none;
}

Expand Down
16 changes: 13 additions & 3 deletions js/display_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2136,8 +2136,13 @@ BARS.defineActions(function() {

let player_skin_setup = false;
function updateBase(mode) {
let root_has_binding = Outliner.root.find(g => g instanceof Group && g.bedrock_binding)
if (mode == 'attachable_first') {
Project.model_3d.position.set(-20, 21, 0);
if (root_has_binding) {
Project.model_3d.position.set(-20, 21, 0);
} else {
Project.model_3d.position.set(-8, 6, -18);
}
Project.model_3d.rotation.set(
Math.degToRad(-95),
Math.degToRad(45),
Expand All @@ -2151,8 +2156,13 @@ BARS.defineActions(function() {

if (mode == 'attachable_third') {
let angle = Math.degToRad(15);
let arm_offset = Reusable.vec1.set(1, -31, 1).applyAxisAngle(Reusable.vec2.set(1, 0, 0), angle);
Project.model_3d.position.set(5, 22, 0).add(arm_offset);
if (root_has_binding) {
let arm_offset = Reusable.vec1.set(1, -31, 1).applyAxisAngle(Reusable.vec2.set(1, 0, 0), angle);
Project.model_3d.position.set(5, 22, 0).add(arm_offset);
} else {
let arm_offset = Reusable.vec1.set(1, -7, 1).applyAxisAngle(Reusable.vec2.set(1, 0, 0), angle);
Project.model_3d.position.set(5, 22, 0).add(arm_offset);
}
Project.model_3d.rotation.set(angle, 0, 0);
player_preview_model.enable()

Expand Down
2 changes: 2 additions & 0 deletions js/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ Blockbench.DisplaySlot = DisplaySlot;
Blockbench.Reusable = Reusable;

Blockbench.Texture = Texture;
Blockbench.TextureLayer = TextureLayer;
Blockbench.SharedActions = SharedActions;
2 changes: 1 addition & 1 deletion js/interface/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function buildForm(dialog) {
case 'save':
if (data.type == 'folder' && !isApp) break;

let input = $(`<input class="dark_bordered half" class="focusable_input" type="text" id="${form_id}" disabled>`);
let input = $(`<input class="dark_bordered half" class="focusable_input" type="text" id="${form_id}" style="pointer-events: none;" disabled>`);
input[0].value = settings.streamer_mode.value ? `[${tl('generic.redacted')}]` : data.value || '';
let input_wrapper = $('<div class="input_wrapper"></div>');
input_wrapper.append(input);
Expand Down
3 changes: 3 additions & 0 deletions js/interface/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,9 @@ Interface.CustomElements.SelectInput = function(id, data) {
let value = data.value || data.default || Object.keys(options)[0];
let select = Interface.createElement('bb-select', {id, class: 'half', value: value}, getNameFor(options[value]));
function setKey(key, options) {
if (!options) {
options = typeof data.options == 'function' ? data.options() : data.options;
}
value = key;
select.setAttribute('value', key);
select.textContent = getNameFor(options[key]);
Expand Down
10 changes: 10 additions & 0 deletions js/interface/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,16 @@ addEventListeners(document, 'keydown mousedown', function(e) {
ReferenceImageMode.deactivate();
used = true;
}
} else if (Prop.active_panel == 'uv' && Modes.paint && Texture.selected && Texture.selected.selection.is_custom) {
if (Keybinds.extra.cancel.keybind.isTriggered(e)) {
SharedActions.run('unselect_all', e);
used = true;
}
} else if (Modes.paint && TextureLayer.selected && TextureLayer.selected.in_limbo) {
if (Keybinds.extra.confirm.keybind.isTriggered(e)) {
TextureLayer.selected.resolveLimbo(false);
used = true;
}
}
if (ActionControl.open) {
used = ActionControl.handleKeys(e) || used
Expand Down
2 changes: 1 addition & 1 deletion js/interface/shared_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const SharedActions = {

return {
delete() {
lsit.remove(handler);
list.remove(handler);
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion js/interface/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const CustomTheme = {
CustomTheme.data.colors[scope_key] = last_color;
field.spectrum('set', last_color);
},
beforeShow(a, b) {
beforeShow() {
last_color = CustomTheme.data.colors[scope_key];
field.spectrum('set', last_color);
}
Expand Down
6 changes: 3 additions & 3 deletions js/io/formats/bbmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,10 @@ var codec = new Codec('project', {
ani.uuid = guid();
}
if (base_ani.animators) {
for (let key in animators) {
for (let key in base_ani.animators) {
if (uuid_map[key]) {
animators[uuid_map[key]] = animators[key];
delete animators[key];
base_ani.animators[uuid_map[key]] = base_ani.animators[key];
delete base_ani.animators[key];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/io/formats/bedrock.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ var codec = new Codec('bedrock', {
return;
}
}
if (data && index !== undefined) {
if (data) {

if (Group.all.find(group => group.bedrock_binding)) {
data.format_version = '1.16.0';
Expand Down
Loading

0 comments on commit 5fd4d33

Please sign in to comment.