Skip to content

Commit

Permalink
Fix properties display and reduce some labels
Browse files Browse the repository at this point in the history
  • Loading branch information
4ian committed Sep 25, 2024
1 parent fc054de commit e34b3ba
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 35 deletions.
36 changes: 18 additions & 18 deletions Extensions/3D/JsExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,15 +908,15 @@ module.exports = {
.setValue(objectContent.frontFaceResourceName || '')
.setType('resource')
.addExtraInfo('image')
.setLabel(_('Front face image'))
.setLabel(_('Front face'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('backFaceResourceName')
.setValue(objectContent.backFaceResourceName || '')
.setType('resource')
.addExtraInfo('image')
.setLabel(_('Back face image'))
.setLabel(_('Back face'))
.setGroup(_('Textures'));

objectProperties
Expand All @@ -939,120 +939,120 @@ module.exports = {
.setValue(objectContent.leftFaceResourceName || '')
.setType('resource')
.addExtraInfo('image')
.setLabel(_('Left face image'))
.setLabel(_('Left face'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('rightFaceResourceName')
.setValue(objectContent.rightFaceResourceName || '')
.setType('resource')
.addExtraInfo('image')
.setLabel(_('Right face image'))
.setLabel(_('Right face'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('topFaceResourceName')
.setValue(objectContent.topFaceResourceName || '')
.setType('resource')
.addExtraInfo('image')
.setLabel(_('Top face image'))
.setLabel(_('Top face'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('bottomFaceResourceName')
.setValue(objectContent.bottomFaceResourceName || '')
.setType('resource')
.addExtraInfo('image')
.setLabel(_('Bottom face image'))
.setLabel(_('Bottom face'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('frontFaceResourceRepeat')
.setValue(objectContent.frontFaceResourceRepeat ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Tile front face image'))
.setLabel(_('Tile'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('backFaceResourceRepeat')
.setValue(objectContent.backFaceResourceRepeat ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Tile back face image'))
.setLabel(_('Tile'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('leftFaceResourceRepeat')
.setValue(objectContent.leftFaceResourceRepeat ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Tile left face image'))
.setLabel(_('Tile'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('rightFaceResourceRepeat')
.setValue(objectContent.rightFaceResourceRepeat ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Tile right face image'))
.setLabel(_('Tile'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('topFaceResourceRepeat')
.setValue(objectContent.topFaceResourceRepeat ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Tile top face image'))
.setLabel(_('Tile'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('bottomFaceResourceRepeat')
.setValue(objectContent.bottomFaceResourceRepeat ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Tile bottom face image'))
.setLabel(_('Tile'))
.setGroup(_('Textures'));

objectProperties
.getOrCreate('frontFaceVisible')
.setValue(objectContent.frontFaceVisible ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Show front face'))
.setLabel(_('Front face'))
.setGroup(_('Face visibility'))
.setAdvanced(true);

objectProperties
.getOrCreate('backFaceVisible')
.setValue(objectContent.backFaceVisible ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Show back face'))
.setLabel(_('Back face'))
.setGroup(_('Face visibility'))
.setAdvanced(true);

objectProperties
.getOrCreate('leftFaceVisible')
.setValue(objectContent.leftFaceVisible ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Show left face'))
.setLabel(_('Left face'))
.setGroup(_('Face visibility'))
.setAdvanced(true);

objectProperties
.getOrCreate('rightFaceVisible')
.setValue(objectContent.rightFaceVisible ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Show right face'))
.setLabel(_('Right face'))
.setGroup(_('Face visibility'))
.setAdvanced(true);

objectProperties
.getOrCreate('topFaceVisible')
.setValue(objectContent.topFaceVisible ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Show top face'))
.setLabel(_('Top face'))
.setGroup(_('Face visibility'))
.setAdvanced(true);

objectProperties
.getOrCreate('bottomFaceVisible')
.setValue(objectContent.bottomFaceVisible ? 'true' : 'false')
.setType('boolean')
.setLabel(_('Show bottom face'))
.setLabel(_('Bottom face'))
.setGroup(_('Face visibility'))
.setAdvanced(true);

Expand Down
8 changes: 4 additions & 4 deletions Extensions/AnchorBehavior/AnchorBehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
.AddExtraInfo(_("Window center"))
.AddExtraInfo(_("Window right"))
.AddExtraInfo(_("Proportional"))
.SetLabel(_("Left edge anchor"))
.SetLabel(_("Left edge"))
.SetDescription(_("Anchor the left edge of the object on X axis."));

properties["rightEdgeAnchor"]
Expand All @@ -87,7 +87,7 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
.AddExtraInfo(_("Window center"))
.AddExtraInfo(_("Window right"))
.AddExtraInfo(_("Proportional"))
.SetLabel(_("Right edge anchor"))
.SetLabel(_("Right edge"))
.SetDescription(_("Anchor the right edge of the object on X axis."));

properties["topEdgeAnchor"]
Expand All @@ -99,7 +99,7 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
.AddExtraInfo(_("Window center"))
.AddExtraInfo(_("Window bottom"))
.AddExtraInfo(_("Proportional"))
.SetLabel(_("Top edge anchor"))
.SetLabel(_("Top edge"))
.SetDescription(_("Anchor the top edge of the object on Y axis."));

properties["bottomEdgeAnchor"]
Expand All @@ -111,7 +111,7 @@ std::map<gd::String, gd::PropertyDescriptor> AnchorBehavior::GetProperties(
.AddExtraInfo(_("Window center"))
.AddExtraInfo(_("Window bottom"))
.AddExtraInfo(_("Proportional"))
.SetLabel(_("Bottom edge anchor"))
.SetLabel(_("Bottom edge"))
.SetDescription(_("Anchor the bottom edge of the object on Y axis."));

properties["useLegacyBottomAndRightAnchors"]
Expand Down
4 changes: 2 additions & 2 deletions Extensions/BitmapText/JsExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = {
.addExtraInfo('left')
.addExtraInfo('center')
.addExtraInfo('right')
.setLabel(_('Alignment, when multiple lines are displayed'))
.setLabel(_('Alignment'))
.setGroup(_('Appearance'));

objectProperties
Expand All @@ -80,7 +80,7 @@ module.exports = {
.setValue(objectContent.textureAtlasResourceName)
.setType('resource')
.addExtraInfo('image')
.setLabel(_('Bitmap atlas image'))
.setLabel(_('Bitmap Atlas'))
.setGroup(_('Font'));

objectProperties
Expand Down
3 changes: 2 additions & 1 deletion Extensions/DestroyOutsideBehavior/DestroyOutsideBehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ DestroyOutsideBehavior::GetProperties(
behaviorContent.GetDoubleAttribute("extraBorder", 0)))
.SetType("Number")
.SetMeasurementUnit(gd::MeasurementUnit::GetPixel())
.SetLabel(_("Margin before deleting the object, in pixels"));
.SetLabel(_("Deletion margin"))
.SetDescription(_("Margin before deleting the object, in pixels"));

return properties;
}
Expand Down
2 changes: 1 addition & 1 deletion Extensions/DraggableBehavior/DraggableBehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ std::map<gd::String, gd::PropertyDescriptor> DraggableBehavior::GetProperties(
? "true"
: "false")
.SetType("Boolean")
.SetLabel(_("Do a precision check against the object's collision mask"))
.SetLabel(_("Precise check"))
.SetDescription(
_("Use the object (custom) collision mask instead of the bounding "
"box, making the behavior more precise at the cost of "
Expand Down
8 changes: 4 additions & 4 deletions Extensions/PathfindingBehavior/PathfindingBehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,28 @@ std::map<gd::String, gd::PropertyDescriptor> PathfindingBehavior::GetProperties(
.SetValue(
gd::String::From(behaviorContent.GetDoubleAttribute("angleOffset")));
properties["CellWidth"]
.SetLabel(_("Virtual cell width"))
.SetLabel(_("Cell width"))
.SetGroup(_("Virtual Grid"))
.SetType("Number")
.SetMeasurementUnit(gd::MeasurementUnit::GetPixel())
.SetValue(
gd::String::From(behaviorContent.GetDoubleAttribute("cellWidth", 0)));
properties["CellHeight"]
.SetLabel(_("Virtual cell height"))
.SetLabel(_("Cell height"))
.SetGroup(_("Virtual Grid"))
.SetType("Number")
.SetMeasurementUnit(gd::MeasurementUnit::GetPixel())
.SetValue(gd::String::From(
behaviorContent.GetDoubleAttribute("cellHeight", 0)));
properties["GridOffsetX"]
.SetLabel(_("Virtual grid X offset"))
.SetLabel(_("X offset"))
.SetGroup(_("Virtual Grid"))
.SetType("Number")
.SetMeasurementUnit(gd::MeasurementUnit::GetPixel())
.SetValue(gd::String::From(
behaviorContent.GetDoubleAttribute("gridOffsetX", 0)));
properties["GridOffsetY"]
.SetLabel(_("Virtual grid Y offset"))
.SetLabel(_("Y offset"))
.SetGroup(_("Virtual Grid"))
.SetType("Number")
.SetMeasurementUnit(gd::MeasurementUnit::GetPixel())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ const propertiesMapToSchema = ({
object,
visibility = 'All',
quickCustomizationVisibilities,
}: {
}: {|
properties: gdMapStringPropertyDescriptor,
getProperties: (instance: Instance) => any,
onUpdateProperty: (
Expand All @@ -343,7 +343,7 @@ const propertiesMapToSchema = ({
object?: gdObject,
visibility?: 'All' | 'Basic' | 'Advanced' | 'Deprecated' | 'Basic-Quick',
quickCustomizationVisibilities?: gdQuickCustomizationVisibilitiesContainer,
}): Schema => {
|}): Schema => {
const propertyNames = properties.keys();
// Aggregate field by groups to be able to build field groups with a title.
const fieldsByGroups = new Map<string, Array<Field>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const ChildObjectPropertiesEditor = ({
objectConfiguration.getProperties(),
onUpdateProperty: ({ object, objectConfiguration }, name, value) =>
objectConfiguration.updateProperty(name, value),
visilibility: 'Basic',
visibility: 'Basic',
});

return schema;
Expand All @@ -72,7 +72,7 @@ export const ChildObjectPropertiesEditor = ({
objectConfiguration.getProperties(),
onUpdateProperty: ({ object, objectConfiguration }, name, value) =>
objectConfiguration.updateProperty(name, value),
visilibility: 'Advanced',
visibility: 'Advanced',
});

return schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const CompactBehaviorPropertiesEditor = ({
behavior.updateProperty(name, value);
},
object,
visilibility: 'Advanced',
visibility: 'Advanced',
});
},
[behavior, object, schemaRecomputeTrigger]
Expand Down

0 comments on commit e34b3ba

Please sign in to comment.