Skip to content

Commit

Permalink
Hide disabled addons
Browse files Browse the repository at this point in the history
  • Loading branch information
ltouroumov committed Sep 21, 2024
1 parent 7074bc9 commit 8759182
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
8 changes: 8 additions & 0 deletions components/viewer/ViewProjectObj.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
disabled: !isEnabled,
notSelectable: obj.isNotSelectable || row.isInfoRow,
canToggle: canToggle,
hideDisabledAddons: $props.hideDisabledAddons,
}"
@click="toggle"
>
Expand Down Expand Up @@ -90,6 +91,7 @@ const $props = defineProps<{
width?: string;
forceWidth?: string;
template?: string;
hideDisabledAddons?: boolean;
}>();
const objClass = computed(() => {
Expand Down Expand Up @@ -192,6 +194,12 @@ const decrement = () => {
display: flex;
flex-direction: column;
&.hideDisabledAddons {
.addon.disabled {
display: none;
}
}
.project-obj-content {
overflow: auto;
Expand Down
39 changes: 27 additions & 12 deletions components/viewer/modal/BackpackModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,31 @@
<div class="pack-scores">
<ViewScoreStatus vertical />
</div>
<div class="form-check form-switch pack-selection-controls">
<input
id="packRowDisabledSwitch"
v-model="lockBackpackObjects"
class="form-check-input"
type="checkbox"
role="switch"
/>
<label class="form-check-label" for="packRowDisabledSwitch">
Lock Objects in the Backpack
</label>
<div class="d-flex flex-column pack-selection-controls">
<div class="form-check form-switch">
<input
id="packRowDisabledSwitch"
v-model="lockBackpackObjects"
class="form-check-input"
type="checkbox"
role="switch"
/>
<label class="form-check-label" for="packRowDisabledSwitch">
Lock Objects in the Backpack
</label>
</div>
<div class="form-check form-switch">
<input
id="hideDisabledAddons"
v-model="hideDisabledAddons"
class="form-check-input"
type="checkbox"
role="switch"
/>
<label class="form-check-label" for="hideDisabledAddons">
Hide Disabled Addons
</label>
</div>
</div>
</div>
<div
Expand All @@ -39,6 +53,7 @@
:row="row"
:width="packRow.objectWidth"
:view-object="objectMode"
:hide-disabled-addons="hideDisabledAddons"
/>
</div>
</div>
Expand Down Expand Up @@ -93,7 +108,7 @@ const packRows = computed(() => {
backpack.value,
);
});
const hideDisabledAddons = ref(true);
const lockBackpackObjects = ref(true);
const objectMode = computed(() => {
if (lockBackpackObjects.value) return ViewContext.BackpackDisabled;
Expand Down

0 comments on commit 8759182

Please sign in to comment.