-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add buttons to edit animations for Sprite, Spine, tilemap
- Loading branch information
Showing
11 changed files
with
113 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
newIDE/app/src/ObjectEditor/CompactObjectPropertiesEditor/CompactObjectPropertiesSchema.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// @flow | ||
import * as React from 'react'; | ||
import { type Schema, type ActionButton } from '../../CompactPropertiesEditor'; | ||
import ShareExternal from '../../UI/CustomSvgIcons/ShareExternal'; | ||
|
||
export const getSchemaWithOpenFullEditorButton = ({ | ||
schema, | ||
fullEditorLabel, | ||
object, | ||
onEditObject, | ||
}: {| | ||
schema: Schema, | ||
fullEditorLabel: ?string, | ||
object: gdObject, | ||
onEditObject: (object: gdObject) => void, | ||
|}): Schema => { | ||
if (!fullEditorLabel) return schema; | ||
|
||
const actionButton: ActionButton = { | ||
label: fullEditorLabel, | ||
disabled: 'onValuesDifferent', | ||
nonFieldType: 'button', | ||
showRightIcon: true, | ||
getIcon: style => <ShareExternal style={style} />, | ||
getValue: ({ object }) => object.getName(), | ||
onClick: ({ object }) => onEditObject(object), | ||
}; | ||
|
||
let added = false; | ||
schema.forEach(field => { | ||
if (field.children && field.name === '') { | ||
field.children.push(actionButton); | ||
added = true; | ||
} | ||
}); | ||
|
||
if (!added) schema.push(actionButton); | ||
|
||
return schema; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters