Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix several issues #1072

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
overflow: scroll;
overflow-y: auto;
overflow-x: hidden;
padding: 0 24px;
padding: 0 24px 40px 0;
gap: 16px;
}

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

const playing = getInputProps('playing', (e) => e.target.checked)
const loop = getInputProps('loop', (e) => e.target.checked)
const global = getInputProps('global', (e) => e.target.checked)
const volume = getInputProps('volume', (e) => e.target.value)

return (
Expand All @@ -75,6 +76,7 @@ export default withSdk<Props>(({ sdk, entity }) => {
<Block label="Playback">
<CheckboxField label="Start playing" checked={!!playing.value} {...playing} />
<CheckboxField label="Loop" checked={!!loop.value} {...loop} />
<CheckboxField label="Global" checked={!!global.value} {...global} />
</Block>
<Block className="volume">
<RangeField {...volume} label="Volume" isValidValue={isValidVolume} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export type AudioSourceInput = {
playing?: boolean
loop?: boolean
volume?: string
global?: boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export default withSdk<Props>(({ sdk, entity }) => {
<Block>
<RangeField label="Alpha test" max={1} step={0.1} {...getInputProps('alphaTest')} />
</Block>
<Texture
label="Alpha texture"
texture={TextureType.TT_ALPHA_TEXTURE}
files={files}
getInputProps={getTextureProps}
/>
</>
)}
{materialType.value === MaterialType.MT_PBR && (
Expand Down Expand Up @@ -91,12 +97,6 @@ export default withSdk<Props>(({ sdk, entity }) => {
<Block>
<RangeField label="Alpha test" max={1} step={0.1} {...getInputProps('alphaTest')} />
</Block>
<Texture
label="Alpha texture"
texture={TextureType.TT_ALPHA_TEXTURE}
files={files}
getInputProps={getTextureProps}
/>
</Container>

<Container label="Emissive" border>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default withSdk<Props>(({ sdk, entity: entityId }) => {
rightContent={
<InfoTooltip
text={`Triggers activate actions based on player interactions like clicks, entering/exiting areas, or global events like "on spawn".`}
link="https://docs.decentraland.org/creator/smart-items/#triggers"
link="https://docs.decentraland.org/creator/editor/smart-items-advanced/"
type="help"
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { Props } from './types'
import './Shortcuts.css'

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

const Shortcuts: React.FC<Props> = ({ canvas, onResetCamera, onZoomIn, onZoomOut }) => {
const [showShortcuts, setShowShortcuts] = React.useState(false)
Expand Down Expand Up @@ -87,37 +89,37 @@ const Shortcuts: React.FC<Props> = ({ canvas, onResetCamera, onZoomIn, onZoomOut
<div className="Item">
<div className="Title">Select Multiple Items</div>
<div className="Description">
Hold<span className="Key">ctrl</span>and click
Hold<span className="Key">{prefixKey}</span>and click
</div>
</div>
<div className="Item">
<div className="Title">Save</div>
<div className="Description">
<span className="Key">ctrl</span>+<span className="Key">S</span>
<span className="Key">{prefixKey}</span>+<span className="Key">S</span>
</div>
</div>
<div className="Item">
<div className="Title">Undo</div>
<div className="Description">
<span className="Key">ctrl</span>+<span className="Key">Z</span>
<span className="Key">{prefixKey}</span>+<span className="Key">Z</span>
</div>
</div>
<div className="Item">
<div className="Title">Redo</div>
<div className="Description">
<span className="Key">ctrl</span>+<span className="Key">Y</span>
<span className="Key">{prefixKey}</span>+<span className="Key">Y</span>
</div>
</div>
<div className="Item">
<div className="Title">Copy</div>
<div className="Description">
<span className="Key">ctrl</span>+<span className="Key">C</span>
<span className="Key">{prefixKey}</span>+<span className="Key">C</span>
</div>
</div>
<div className="Item">
<div className="Title">Paste</div>
<div className="Description">
<span className="Key">ctrl</span>+<span className="Key">V</span>
<span className="Key">{prefixKey}</span>+<span className="Key">V</span>
</div>
</div>
<div className="Item">
Expand Down Expand Up @@ -156,7 +158,7 @@ const Shortcuts: React.FC<Props> = ({ canvas, onResetCamera, onZoomIn, onZoomOut
<div className="Item">
<div className="Title">Duplicate</div>
<div className="Description">
<span className="Key">ctrl</span>+<span className="Key">D</span>
<span className="Key">{prefixKey}</span>+<span className="Key">D</span>
</div>
</div>
<div className="Item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export const putMaterialComponent: ComponentOperation = (entity, component) => {
m.alphaCutOff = pbr.alphaTest ?? 0.5

void loadTexture(entity, pbr.texture?.tex).then((texture) => (m.albedoTexture = texture))
void loadTexture(entity, pbr.alphaTexture?.tex).then((texture) => (m.opacityTexture = texture))
void loadTexture(entity, pbr.bumpTexture?.tex).then((texture) => (m.bumpTexture = texture))
void loadTexture(entity, pbr.emissiveTexture?.tex).then((texture) => (m.emissiveTexture = texture))
})
Expand All @@ -80,6 +79,7 @@ export const putMaterialComponent: ComponentOperation = (entity, component) => {
m.alphaCutOff = unlit.alphaTest ?? 0.5
unlit.diffuseColor && m.diffuseColor.set(unlit.diffuseColor.r, unlit.diffuseColor.g, unlit.diffuseColor.b) // unlit.albedoColor.a?
void loadTexture(entity, unlit.texture?.tex).then((texture) => (m.diffuseTexture = texture))
void loadTexture(entity, unlit.alphaTexture?.tex).then((texture) => (m.opacityTexture = texture))
})
}

Expand Down Expand Up @@ -128,13 +128,13 @@ function disposeTextures(material?: StandardMaterial | PBRMaterial) {
if (material instanceof StandardMaterial) {
material.diffuseTexture?.dispose()
material.diffuseTexture = null
material.opacityTexture?.dispose()
material.opacityTexture = null
}

if (material instanceof PBRMaterial) {
material.albedoTexture?.dispose()
material.albedoTexture = null
material.opacityTexture?.dispose()
material.opacityTexture = null
material.bumpTexture?.dispose()
material.bumpTexture = null
material.emissiveTexture?.dispose()
Expand Down
Loading