Skip to content

Commit 0f0d261

Browse files
authored
fix several issues (#1072)
* fix scroll on assets catalog * fix tooltip link on Action & Trigger components * deprecate alphaTexture on PBR & add it to unlit materials * replace 'ctrl' for '⌘' on shortcuts when necessary * add 'global' prop to AudioSource
1 parent 5fc6a9d commit 0f0d261

File tree

8 files changed

+24
-19
lines changed

8 files changed

+24
-19
lines changed

packages/@dcl/inspector/src/components/AssetsCatalog/Categories/Categories.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
overflow: scroll;
66
overflow-y: auto;
77
overflow-x: hidden;
8-
padding: 0 24px;
8+
padding: 0 24px 40px 0;
99
gap: 16px;
1010
}
1111

packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ActionInspector.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ export default withSdk<Props>(({ sdk, entity: entityId }) => {
944944
rightContent={
945945
<InfoTooltip
946946
text="Actions list the capabilities of entities, from playing animations to changing visibility. Customize or add new actions, which are activated by triggers."
947-
link="https://docs.decentraland.org/creator/smart-items/#actions"
947+
link="https://docs.decentraland.org/creator/editor/smart-items-advanced/"
948948
type="help"
949949
/>
950950
}

packages/@dcl/inspector/src/components/EntityInspector/AudioSourceInspector/AudioSourceInspector.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default withSdk<Props>(({ sdk, entity }) => {
5858

5959
const playing = getInputProps('playing', (e) => e.target.checked)
6060
const loop = getInputProps('loop', (e) => e.target.checked)
61+
const global = getInputProps('global', (e) => e.target.checked)
6162
const volume = getInputProps('volume', (e) => e.target.value)
6263

6364
return (
@@ -75,6 +76,7 @@ export default withSdk<Props>(({ sdk, entity }) => {
7576
<Block label="Playback">
7677
<CheckboxField label="Start playing" checked={!!playing.value} {...playing} />
7778
<CheckboxField label="Loop" checked={!!loop.value} {...loop} />
79+
<CheckboxField label="Global" checked={!!global.value} {...global} />
7880
</Block>
7981
<Block className="volume">
8082
<RangeField {...volume} label="Volume" isValidValue={isValidVolume} />

packages/@dcl/inspector/src/components/EntityInspector/AudioSourceInspector/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ export type AudioSourceInput = {
99
playing?: boolean
1010
loop?: boolean
1111
volume?: string
12+
global?: boolean
1213
}

packages/@dcl/inspector/src/components/EntityInspector/MaterialInspector/MaterialInspector.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ export default withSdk<Props>(({ sdk, entity }) => {
5353
<Block>
5454
<RangeField label="Alpha test" max={1} step={0.1} {...getInputProps('alphaTest')} />
5555
</Block>
56+
<Texture
57+
label="Alpha texture"
58+
texture={TextureType.TT_ALPHA_TEXTURE}
59+
files={files}
60+
getInputProps={getTextureProps}
61+
/>
5662
</>
5763
)}
5864
{materialType.value === MaterialType.MT_PBR && (
@@ -91,12 +97,6 @@ export default withSdk<Props>(({ sdk, entity }) => {
9197
<Block>
9298
<RangeField label="Alpha test" max={1} step={0.1} {...getInputProps('alphaTest')} />
9399
</Block>
94-
<Texture
95-
label="Alpha texture"
96-
texture={TextureType.TT_ALPHA_TEXTURE}
97-
files={files}
98-
getInputProps={getTextureProps}
99-
/>
100100
</Container>
101101

102102
<Container label="Emissive" border>

packages/@dcl/inspector/src/components/EntityInspector/TriggerInspector/TriggerInspector.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ export default withSdk<Props>(({ sdk, entity: entityId }) => {
308308
rightContent={
309309
<InfoTooltip
310310
text={`Triggers activate actions based on player interactions like clicks, entering/exiting areas, or global events like "on spawn".`}
311-
link="https://docs.decentraland.org/creator/smart-items/#triggers"
311+
link="https://docs.decentraland.org/creator/editor/smart-items-advanced/"
312312
type="help"
313313
/>
314314
}

packages/@dcl/inspector/src/components/Renderer/Shortcuts/Shortcuts.tsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { Props } from './types'
1616
import './Shortcuts.css'
1717

1818
const ICON_SIZE = 18
19+
const isMac = /Mac|iPhone|iPod|iPad/.test(navigator.userAgent)
20+
const prefixKey = isMac ? '⌘' : 'ctrl'
1921

2022
const Shortcuts: React.FC<Props> = ({ canvas, onResetCamera, onZoomIn, onZoomOut }) => {
2123
const [showShortcuts, setShowShortcuts] = React.useState(false)
@@ -87,37 +89,37 @@ const Shortcuts: React.FC<Props> = ({ canvas, onResetCamera, onZoomIn, onZoomOut
8789
<div className="Item">
8890
<div className="Title">Select Multiple Items</div>
8991
<div className="Description">
90-
Hold<span className="Key">ctrl</span>and click
92+
Hold<span className="Key">{prefixKey}</span>and click
9193
</div>
9294
</div>
9395
<div className="Item">
9496
<div className="Title">Save</div>
9597
<div className="Description">
96-
<span className="Key">ctrl</span>+<span className="Key">S</span>
98+
<span className="Key">{prefixKey}</span>+<span className="Key">S</span>
9799
</div>
98100
</div>
99101
<div className="Item">
100102
<div className="Title">Undo</div>
101103
<div className="Description">
102-
<span className="Key">ctrl</span>+<span className="Key">Z</span>
104+
<span className="Key">{prefixKey}</span>+<span className="Key">Z</span>
103105
</div>
104106
</div>
105107
<div className="Item">
106108
<div className="Title">Redo</div>
107109
<div className="Description">
108-
<span className="Key">ctrl</span>+<span className="Key">Y</span>
110+
<span className="Key">{prefixKey}</span>+<span className="Key">Y</span>
109111
</div>
110112
</div>
111113
<div className="Item">
112114
<div className="Title">Copy</div>
113115
<div className="Description">
114-
<span className="Key">ctrl</span>+<span className="Key">C</span>
116+
<span className="Key">{prefixKey}</span>+<span className="Key">C</span>
115117
</div>
116118
</div>
117119
<div className="Item">
118120
<div className="Title">Paste</div>
119121
<div className="Description">
120-
<span className="Key">ctrl</span>+<span className="Key">V</span>
122+
<span className="Key">{prefixKey}</span>+<span className="Key">V</span>
121123
</div>
122124
</div>
123125
<div className="Item">
@@ -156,7 +158,7 @@ const Shortcuts: React.FC<Props> = ({ canvas, onResetCamera, onZoomIn, onZoomOut
156158
<div className="Item">
157159
<div className="Title">Duplicate</div>
158160
<div className="Description">
159-
<span className="Key">ctrl</span>+<span className="Key">D</span>
161+
<span className="Key">{prefixKey}</span>+<span className="Key">D</span>
160162
</div>
161163
</div>
162164
<div className="Item">

packages/@dcl/inspector/src/lib/babylon/decentraland/sdkComponents/material.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export const putMaterialComponent: ComponentOperation = (entity, component) => {
6969
m.alphaCutOff = pbr.alphaTest ?? 0.5
7070

7171
void loadTexture(entity, pbr.texture?.tex).then((texture) => (m.albedoTexture = texture))
72-
void loadTexture(entity, pbr.alphaTexture?.tex).then((texture) => (m.opacityTexture = texture))
7372
void loadTexture(entity, pbr.bumpTexture?.tex).then((texture) => (m.bumpTexture = texture))
7473
void loadTexture(entity, pbr.emissiveTexture?.tex).then((texture) => (m.emissiveTexture = texture))
7574
})
@@ -80,6 +79,7 @@ export const putMaterialComponent: ComponentOperation = (entity, component) => {
8079
m.alphaCutOff = unlit.alphaTest ?? 0.5
8180
unlit.diffuseColor && m.diffuseColor.set(unlit.diffuseColor.r, unlit.diffuseColor.g, unlit.diffuseColor.b) // unlit.albedoColor.a?
8281
void loadTexture(entity, unlit.texture?.tex).then((texture) => (m.diffuseTexture = texture))
82+
void loadTexture(entity, unlit.alphaTexture?.tex).then((texture) => (m.opacityTexture = texture))
8383
})
8484
}
8585

@@ -128,13 +128,13 @@ function disposeTextures(material?: StandardMaterial | PBRMaterial) {
128128
if (material instanceof StandardMaterial) {
129129
material.diffuseTexture?.dispose()
130130
material.diffuseTexture = null
131+
material.opacityTexture?.dispose()
132+
material.opacityTexture = null
131133
}
132134

133135
if (material instanceof PBRMaterial) {
134136
material.albedoTexture?.dispose()
135137
material.albedoTexture = null
136-
material.opacityTexture?.dispose()
137-
material.opacityTexture = null
138138
material.bumpTexture?.dispose()
139139
material.bumpTexture = null
140140
material.emissiveTexture?.dispose()

0 commit comments

Comments
 (0)