before_code stringlengths 30 149k | reviewer_comment stringlengths 16 20.6k | after_code stringlengths 30 163k | diff_context stringlengths 0 22.4k | file_path stringlengths 6 155 | comment_line int64 0 26 | language stringclasses 19
values | quality_score float64 0.07 1 | comment_type stringclasses 9
values | comment_length int64 16 20.6k | before_lines int64 2 4.61k | after_lines int64 2 4.4k | is_negative bool 2
classes | pr_title stringlengths 7 140 | pr_number int64 18 61.2k | repo_name stringclasses 29
values | repo_stars int64 321 56k | repo_language stringclasses 14
values | reviewer_username stringclasses 378
values | author_username stringclasses 739
values | user stringlengths 361 200k | assistant stringlengths 16 20.6k | system stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bool isAnyBehaviorMissing = false;
gd::ParameterMetadataTools::IterateOverParametersWithIndex(
instruction.GetParameters(), instrInfos.parameters,
[this, &isAnyBehaviorMissing,
&instrInfos](const gd::ParameterMetadata ¶meterMetadata,
const gd::Expression ¶meterVal... | I think it's safe to stop generating the instruction in this case because:
- the only built-in functions which has an `objectList` and a `behavior` are Physics collision conditions
- the diagnostic report bullied users to make them fix their groups
- the events-functions crashed so it was not usable for them | bool isAnyBehaviorMissing = false;
gd::ParameterMetadataTools::IterateOverParametersWithIndex(
instruction.GetParameters(), instrInfos.parameters,
[this, &isAnyBehaviorMissing,
&instrInfos](const gd::ParameterMetadata ¶meterMetadata,
const gd::Expression ¶meterVal... | @@ -506,13 +512,24 @@ void EventsCodeGenerator::CheckBehaviorParameters(
if (!expectedBehaviorType.empty() &&
actualBehaviorType != expectedBehaviorType) {
+ const auto &objectParameterMetadata =
+ instrInfos.GetParameter(lastObjectIndex);
+ // Event... | Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.cpp | 26 | C++ | 0.643 | bug | 312 | 51 | 51 | false | Fix a crash at runtime when behaviors are missing in functions | 7,830 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.cpp
PR Title: Fix a crash at runtime when behaviors are missing in functions
BEFORE CODE: bool isAnyBehaviorMissing = false;
gd::ParameterMetadataTools::IterateOverParametersWithIndex(
instruction.... | I think it's safe to stop generating the instruction in this case because:
- the only built-in functions which has an `objectList` and a `behavior` are Physics collision conditions
- the diagnostic report bullied users to make them fix their groups
- the events-functions crashed so it was not usable for them | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
bool EventsCodeGenerator::CheckBehaviorParameters(
const gd::Instruction &instruction,
const gd::InstructionMetadata &instrInfos) {
bool isAnyBehaviorMissing = false;
gd::ParameterMetadataTools::IterateOverParametersWithIndex(
instruction.GetParameters(), instrInfos.parameters,
[this, &isA... | "Lose sight" is not super clear. Maybe:
```suggestion
// Event functions crash if some objects in a group are missing
// the required behaviors, since they lose reference to the original objects.
// Missing behaviors are considered "fatal" only for ObjectList parameters,
... | bool EventsCodeGenerator::CheckBehaviorParameters(
const gd::Instruction &instruction,
const gd::InstructionMetadata &instrInfos) {
bool isAnyBehaviorMissing = false;
gd::ParameterMetadataTools::IterateOverParametersWithIndex(
instruction.GetParameters(), instrInfos.parameters,
[this, &isA... | @@ -506,13 +512,24 @@ void EventsCodeGenerator::CheckBehaviorParameters(
if (!expectedBehaviorType.empty() &&
actualBehaviorType != expectedBehaviorType) {
+ const auto &objectParameterMetadata =
+ instrInfos.GetParameter(lastObjectIndex);
+ // Event... | Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.cpp | 26 | C++ | 0.857 | bug | 384 | 51 | 51 | false | Fix a crash at runtime when behaviors are missing in functions | 7,830 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.cpp
PR Title: Fix a crash at runtime when behaviors are missing in functions
BEFORE CODE: bool EventsCodeGenerator::CheckBehaviorParameters(
const gd::Instruction &instruction,
const gd::InstructionM... | "Lose sight" is not super clear. Maybe:
```suggestion
// Event functions crash if some objects in a group are missing
// the required behaviors, since they lose reference to the original objects.
// Missing behaviors are considered "fatal" only for ObjectList parameters,
... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.getOrCreate('top')
.setValue('Z+')
.setLabel(_('3D world top'))
.setType('choice')
.addExtraInfo('Z+')
.addExtraInfo('Y-')
.setGroup(_('Orientation'));
properties
.getOrCreate('elevation')
.setValue('90')
.setLabel(_('Elevation (in d... | See if chatgpt can give you a more user friendly description? | .getOrCreate('top')
.setValue('Z+')
.setLabel(_('3D world top'))
.setType('choice')
.addExtraInfo('Z+')
.addExtraInfo('Y-')
.setGroup(_('Orientation'));
properties
.getOrCreate('elevation')
.setValue('90')
.setLabel(_('Elevation (in d... | @@ -2063,6 +2063,46 @@ module.exports = {
.setType('number')
.setGroup(_('Orientation'));
}
+ {
+ const effect = extension
+ .addEffect('Skybox')
+ .setFullName(_('Skybox'))
+ .setDescription(_('A background cube which surrounds the scene.')) | Extensions/3D/JsExtension.js | 26 | JavaScript | 0.286 | question | 61 | 51 | 51 | false | Add a skybox filter | 7,843 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: Extensions/3D/JsExtension.js
PR Title: Add a skybox filter
BEFORE CODE: .getOrCreate('top')
.setValue('Z+')
.setLabel(_('3D world top'))
.setType('choice')
.addExtraInfo('Z+')
.addExtraInfo('Y-')
.set... | See if chatgpt can give you a more user friendly description? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
eventsFunctionsExtension={eventsFunctionsExtension}
eventsBasedObject={eventsBasedObject}
eventsBasedObjectVariant={eventsBasedObjectVariant}
layersContainer={this.props.layersContainer}
globalObjectsContainer={this.props.globalObjectsConta... | you can probably create a method `this._onSelectLayer` that does this logic | onOpenSceneProperties={this.openSceneProperties}
onEditObjectGroup={this._editObjectGroup}
onEditLayerEffects={this.editLayerEffects}
onEditLayer={this.editLayer}
/>
<EditorsDisplay
ref={ref => (this.editorDispla... | @@ -2044,7 +2049,13 @@ export default class SceneEditor extends React.Component<Props, State> {
onLayerRenamed={this._onLayerRenamed}
onRemoveLayer={this._onRemoveLayer}
onSelectLayer={(layer: string) =>
- this.setState({ selectedLayer: layer })
+ ... | newIDE/app/src/SceneEditor/index.js | 26 | JavaScript | 0.357 | suggestion | 75 | 51 | 51 | false | fix(instances-editor): persist selected layer across sessions | 7,879 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | Digvijay-x1 | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/SceneEditor/index.js
PR Title: fix(instances-editor): persist selected layer across sessions
BEFORE CODE: eventsFunctionsExtension={eventsFunctionsExtension}
eventsBasedObject={eventsBasedObject}
... | you can probably create a method `this._onSelectLayer` that does this logic | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
selectedLayer: string,
tileMapTileSelection: ?TileMapTileSelection,
lastSelectionType: 'instance' | 'object',
|};
type CopyCutPasteOptions = {|
useLastCursorPosition?: boolean,
pasteInTheForeground?: boolean,
|};
const editSceneIconReactNode = <EditSceneIcon />;
export default class SceneEditor extends R... | props.getInitialInstancesEditorSettings is guaranteed to be always passed, no need to check for its existence. | selectedLayer: string,
tileMapTileSelection: ?TileMapTileSelection,
lastSelectionType: 'instance' | 'object',
|};
type CopyCutPasteOptions = {|
useLastCursorPosition?: boolean,
pasteInTheForeground?: boolean,
|};
const editSceneIconReactNode = <EditSceneIcon />;
export default class SceneEditor extends R... | @@ -208,6 +208,11 @@ export default class SceneEditor extends React.Component<Props, State> {
super(props);
this.instancesSelection = new InstancesSelection();
+
+ const initialInstancesEditorSettings = props.getInitialInstancesEditorSettings | newIDE/app/src/SceneEditor/index.js | 26 | JavaScript | 0.357 | suggestion | 110 | 51 | 51 | false | fix(instances-editor): persist selected layer across sessions | 7,879 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Digvijay-x1 | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/SceneEditor/index.js
PR Title: fix(instances-editor): persist selected layer across sessions
BEFORE CODE: selectedLayer: string,
tileMapTileSelection: ?TileMapTileSelection,
lastSelectionType: 'instance' | 'object',
|};
type CopyCut... | props.getInitialInstancesEditorSettings is guaranteed to be always passed, no need to check for its existence. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.MarkAsAdvanced();
extension
.AddAction(
"AjoutHasard",
_("Pick a random object"),
_("Pick one object from all the specified objects. When an object "
"is picked, the next conditions and actions of this event work "
"only on that object."),
... | **AddAction**, but the description is about **condition**. | .MarkAsAdvanced();
extension
.AddAction("AjoutHasard",
_("Pick a random object"),
_("Pick one instance from all the specified objects. When an "
"instance is picked, the next conditions and actions of "
"this event work only on that ... | @@ -1645,6 +1664,23 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
.AddParameter("objectList", _("Object"))
.MarkAsSimple();
+ extension
+ .AddAction(
+ "PickNearest",
+ _("Pick nearest object"),
+ _("Pick the object of this type that is... | Core/GDCore/Extensions/Builtin/BaseObjectExtension.cpp | 26 | C++ | 0.214 | suggestion | 58 | 51 | 51 | false | Add "Pick Nearest" and "Rotate toward object" action | 7,883 | 4ian/GDevelop | 10,154 | JavaScript | Bouh | 4ian | Review this pull request change.
Language: C++
File: Core/GDCore/Extensions/Builtin/BaseObjectExtension.cpp
PR Title: Add "Pick Nearest" and "Rotate toward object" action
BEFORE CODE: .MarkAsAdvanced();
extension
.AddAction(
"AjoutHasard",
_("Pick a random object"),
_("P... | **AddAction**, but the description is about **condition**. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
return makeGenericFailure(
`Could not find an object in the asset store to replace "${object_name}" in scene "${scene_name}". Instead, inspect properties of the object and modify it until it matches what you want it to be.`
);
};
const duplicateExistingObject = (duplicatedObjectNam... | As discussed, reverse this (duplicated_object_name is the source object that will be copied and used as the source for the new one. The new one name is "object_name") | }
return makeGenericFailure(
`Could not find an object in the asset store to replace "${object_name}" in scene "${scene_name}". Instead, inspect properties of the object and modify it until it matches what you want it to be.`
);
};
const duplicateExistingObject = (duplicatedObjectNam... | @@ -662,7 +691,45 @@ const createOrReplaceObject: EditorFunction = {
);
};
- if (!shouldReplaceExistingObject) {
+ const duplicateExistingObject = (duplicatedObjectName: string) => {
+ const object = objectsContainer.getObject(object_name);
+ const serializedObject = serializeToJSObject(ob... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.429 | refactor | 167 | 51 | 51 | false | Adapt editor function to duplicate object | 7,889 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: Adapt editor function to duplicate object
BEFORE CODE: }
return makeGenericFailure(
`Could not find an object in the asset store to replace "${object_name}" in scene "${scene_name}". In... | As discussed, reverse this (duplicated_object_name is the source object that will be copied and used as the source for the new one. The new one name is "object_name") | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
return makeGenericFailure(
`Could not find an object in the asset store to replace "${object_name}" in scene "${scene_name}". Instead, inspect properties of the object and modify it until it matches what you want it to be.`
);
};
const duplicateExistingObject = (duplicatedObjectNam... | ```suggestion
`Duplicated object "${duplicatedObjectName}" as "${newObject.getName()}". The new object "{newObject.getName()}" has the same type, behaviors, properties and effects as the one it was duplicated from.`
``` | }
return makeGenericFailure(
`Could not find an object in the asset store to replace "${object_name}" in scene "${scene_name}". Instead, inspect properties of the object and modify it until it matches what you want it to be.`
);
};
const duplicateExistingObject = (duplicatedObjectNam... | @@ -662,7 +691,45 @@ const createOrReplaceObject: EditorFunction = {
);
};
- if (!shouldReplaceExistingObject) {
+ const duplicateExistingObject = (duplicatedObjectName: string) => {
+ const object = objectsContainer.getObject(duplicatedObjectName);
+ const serializedObject = serializeToJS... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.929 | refactor | 227 | 51 | 51 | false | Adapt editor function to duplicate object | 7,889 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: Adapt editor function to duplicate object
BEFORE CODE: }
return makeGenericFailure(
`Could not find an object in the asset store to replace "${object_name}" in scene "${scene_name}". In... | ```suggestion
`Duplicated object "${duplicatedObjectName}" as "${newObject.getName()}". The new object "{newObject.getName()}" has the same type, behaviors, properties and effects as the one it was duplicated from.`
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
logger.warn(
'Unable to find bitmap font for resource "' + resourceName + '".'
);
return;
}
if (this._loadedFontsData.get(resource)) {
return;
}
try {
const response = await fetch(
this._resourceLoader.getFullUrl(resource.file),
... | ```suggestion
// Sanitize: remove lines starting with # (acting as comments)
``` | logger.warn(
'Unable to find bitmap font for resource "' + resourceName + '".'
);
return;
}
if (this._loadedFontsData.get(resource)) {
return;
}
try {
const response = await fetch(
this._resourceLoader.getFullUrl(resource.file),
... | @@ -278,8 +278,15 @@ namespace gdjs {
'same-origin',
}
);
- const fontData = await response.text();
- this._loadedFontsData.set(resource, fontData);
+ const fontDataRaw = await response.text();
+
+ // Sanitize : remove the lines staring with # | GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts | 26 | TypeScript | 0.643 | security | 88 | 51 | 51 | false | Sanitize the .fnt before loading in PixiJS | 7,909 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts
PR Title: Sanitize the .fnt before loading in PixiJS
BEFORE CODE: logger.warn(
'Unable to find bitmap font for resource "' + resourceName + '".'
);
return;
}
... | ```suggestion
// Sanitize: remove lines starting with # (acting as comments)
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
);
const deleteThisGroup = SafeExtractor.extractBooleanProperty(
changed_group,
'delete_this_group'
);
const objects = SafeExtractor.extractArrayProperty(
changed_group,
'objects'
);
if (groupName === null) {
warnings.push... | This will probably crash the app/mess up the memory because you release an object that is still owned by the list of groups. You need to call `remove` on the ObjectGroupsContainer | }
changes.push(
`Modified "${propertyName}" property of the "${effectName}" effect to "${newValue}".`
);
});
}
if (newlyCreatedEffect) {
const effectMetadata = gd.MetadataProvider.getEffectMetadata(
project.getCurrentPla... | @@ -3891,6 +3934,94 @@ const changeScenePropertiesLayersEffects: EditorFunction = {
});
}
+ if (changed_groups) {
+ const groups = project
+ .getLayout(scene_name)
+ .getObjects()
+ .getObjectGroups();
+ changed_groups.forEach(changed_group => {
+ const groupName =... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.714 | bug | 179 | 51 | 51 | false | New Editor function to update scene groups | 7,910 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: New Editor function to update scene groups
BEFORE CODE: );
const deleteThisGroup = SafeExtractor.extractBooleanProperty(
changed_group,
'delete_this_group'
);
... | This will probably crash the app/mess up the memory because you release an object that is still owned by the list of groups. You need to call `remove` on the ObjectGroupsContainer | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
project
.getLayout(scene_name)
.getObjects()
.hasObjectNamed(objectName)
) {
foundGroup.addObject(objectName);
} else {
warnings.push(
`Object "${objectNa... | Need to do a whole project refactoring, check how it's done for objects. | return;
}
let foundGroup: gdObjectGroup;
if (!groups.has(groupName)) {
// Create the group if it does not exist yet.
foundGroup = groups.insertNew(groupName, groups.count());
} else {
foundGroup = groups.get(groupName);
}
if (dele... | @@ -3891,6 +3934,94 @@ const changeScenePropertiesLayersEffects: EditorFunction = {
});
}
+ if (changed_groups) {
+ const groups = project
+ .getLayout(scene_name)
+ .getObjects()
+ .getObjectGroups();
+ changed_groups.forEach(changed_group => {
+ const groupName =... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.286 | refactor | 72 | 51 | 51 | false | New Editor function to update scene groups | 7,910 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: New Editor function to update scene groups
BEFORE CODE: project
.getLayout(scene_name)
.getObjects()
.hasObjectNamed(objectName)... | Need to do a whole project refactoring, check how it's done for objects. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
} else {
if (newGroupName) {
foundGroup.setName(newGroupName);
changes.push(
`Renamed group "${groupName}" to "${newGroupName}" in scene "${scene_name}".`
);
}
if (objects) {
const newObjectNames = objects
... | Let's also handle global objects, which are exposed to the AI. | }
if (changed_groups) {
const groups = scene.getObjects().getObjectGroups();
changed_groups.forEach(changed_group => {
const groupName = SafeExtractor.extractStringProperty(
changed_group,
'group_name'
);
const newGroupName = SafeExtractor.extractStringPr... | @@ -3891,6 +3934,94 @@ const changeScenePropertiesLayersEffects: EditorFunction = {
});
}
+ if (changed_groups) {
+ const groups = project
+ .getLayout(scene_name)
+ .getObjects()
+ .getObjectGroups();
+ changed_groups.forEach(changed_group => {
+ const groupName =... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.357 | suggestion | 62 | 51 | 51 | false | New Editor function to update scene groups | 7,910 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: New Editor function to update scene groups
BEFORE CODE: } else {
if (newGroupName) {
foundGroup.setName(newGroupName);
changes.push(
`Renamed group "$... | Let's also handle global objects, which are exposed to the AI. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
foundGroup.getName(),
newGroupName,
/* isObjectGroup=*/ true
);
foundGroup.setName(newGroupName);
changes.push(
`Renamed group "${groupName}" to "${newGroupName}" in scene "${scene_name}".`
);
}
i... | You already have it?
```suggestion
const sceneObjects = scene.getObjects();
```
I see any get as suspicious if I don't see a check before for existence. | foundGroup.getName(),
newGroupName,
/* isObjectGroup=*/ true
);
foundGroup.setName(newGroupName);
changes.push(
`Renamed group "${groupName}" to "${newGroupName}" in scene "${scene_name}".`
);
}
i... | @@ -3891,6 +3978,103 @@ const changeScenePropertiesLayersEffects: EditorFunction = {
});
}
+ if (changed_groups) {
+ const groups = scene.getObjects().getObjectGroups();
+ changed_groups.forEach(changed_group => {
+ const groupName = SafeExtractor.extractStringProperty(
+ chan... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.714 | suggestion | 165 | 51 | 51 | false | New Editor function to update scene groups | 7,910 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: New Editor function to update scene groups
BEFORE CODE: foundGroup.getName(),
newGroupName,
/* isObjectGroup=*/ true
);
foundGroup.setName(n... | You already have it?
```suggestion
const sceneObjects = scene.getObjects();
```
I see any get as suspicious if I don't see a check before for existence. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
ResourcesLoader,
objectConfiguration
);
else if (project.hasEventsBasedObject(objectType)) {
return RenderedCustomObjectInstance.getThumbnail(
project,
ResourcesLoader,
objectConfiguration
);
} else {
return this.renderers['unknownObjectType'].getT... | Might be worth a comment in RenderedUnknownInstance that this thing is null? | ResourcesLoader,
objectConfiguration
);
else if (project.hasEventsBasedObject(objectType)) {
return RenderedCustomObjectInstance.getThumbnail(
project,
ResourcesLoader,
objectConfiguration
);
} else {
return this.renderers['unknownObjectType'].getT... | @@ -78,6 +78,20 @@ const ObjectsRenderingService = {
);
}
},
+ createNewUnknownInstanceRenderer: function(
+ project: gdProject,
+ instance: gdInitialInstance,
+ pixiContainer: PIXI.Container
+ ): RenderedInstance | Rendered3DInstance {
+ return new this.renderers['unknownObjectType'](
+ ... | newIDE/app/src/ObjectsRendering/ObjectsRenderingService.js | 26 | JavaScript | 0.357 | question | 76 | 51 | 51 | false | Display a placeholder for instances with unknown objects in the editor | 7,933 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ObjectsRendering/ObjectsRenderingService.js
PR Title: Display a placeholder for instances with unknown objects in the editor
BEFORE CODE: ResourcesLoader,
objectConfiguration
);
else if (project.hasEventsBasedObject... | Might be worth a comment in RenderedUnknownInstance that this thing is null? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return makeGenericFailure(
`Object with name "${object_name}" already exists in scene "${scene_name}" but with a different type ("${object_type}").`
);
}
// /!\ Tell the editor that some objects have potentially been modified (and even removed).
// This will forc... | For me, this scope should not be needed here: the function itself should do the work of searching the object wherever it is.
This is similar to events btw, you search in scene then in global objects. |
if (!existingObject) {
// No existing object to duplicate, create a new one.
return createNewObject();
}
const objectsContainerWhereObjectWasFound = isGlobalObject
? globalObjects
: layoutObjects;
const targetObjectsContainer =
target_object_scope === 'g... | @@ -790,15 +817,22 @@ const createOrReplaceObject: EditorFunction = {
};
/**
- * Retrieves the properties of a specific object in a scene
+ * Retrieves the properties of a specific object (global or in a scene)
*/
const inspectObjectProperties: EditorFunction = {
renderForEditor: ({ args, editorCallbacks }) =... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.5 | suggestion | 201 | 51 | 51 | false | Object Editor Functions handle global scope | 7,959 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: Object Editor Functions handle global scope
BEFORE CODE: return makeGenericFailure(
`Object with name "${object_name}" already exists in scene "${scene_name}" but with a different type... | For me, this scope should not be needed here: the function itself should do the work of searching the object wherever it is.
This is similar to events btw, you search in scene then in global objects. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
!objectConfiguration.updateProperty(
foundPropertyName,
sanitizePropertyNewValue(foundProperty, newValue)
)
) {
warnings.push(
`Could not change property "${foundPropertyName}" of object "${object_name}". The value might be invalid, of the wrong type or not al... | Same as the other, the name should be enough | const objectConfiguration = object.getConfiguration();
const objectProperties = objectConfiguration.getProperties();
const { foundPropertyName, foundProperty } = findPropertyByName({
properties: objectProperties,
name: propertyName,
});
if (!foundPropertyName) {
w... | @@ -1150,6 +1212,7 @@ const changeObjectProperty: EditorFunction = {
*/
const addBehavior: EditorFunction = {
renderForEditor: ({ project, args, editorCallbacks }) => {
+ const scope = extractRequiredString(args, 'scope'); | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.143 | suggestion | 44 | 51 | 51 | false | Object Editor Functions handle global scope | 7,959 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: Object Editor Functions handle global scope
BEFORE CODE: !objectConfiguration.updateProperty(
foundPropertyName,
sanitizePropertyNewValue(foundProperty, newValue)
)
... | Same as the other, the name should be enough | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return renderChanges(changes);
},
launchFunction: async ({ project, args }) => {
const scene_name = extractRequiredString(args, 'scene_name');
const object_name = extractRequiredString(args, 'object_name');
const changed_properties =
SafeExtractor.extractArrayProperty(args, 'changed_properties... | This seems to be always left at false and so will break when trying to refactor the project for a global object? |
return {
label: foundProperty ? foundProperty.getLabel() : propertyName,
newValue: newValue,
};
})
.filter(Boolean);
return renderChanges(changes);
},
launchFunction: async ({ project, args }) => {
const scene_name = extractRequiredString(args, 'scene_name')... | @@ -1019,15 +1087,16 @@ const changeObjectProperty: EditorFunction = {
}
const layout = project.getLayout(scene_name);
+ const layoutObjects = layout.getObjects();
+ const globalObjects = project.getObjects();
- let isGlobalObject = false;
let object: gdObject | null = null;
+ let isGloba... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.429 | refactor | 112 | 51 | 51 | false | Object Editor Functions handle global scope | 7,959 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: Object Editor Functions handle global scope
BEFORE CODE: return renderChanges(changes);
},
launchFunction: async ({ project, args }) => {
const scene_name = extractRequiredString(args, 'scene_na... | This seems to be always left at false and so will break when trying to refactor the project for a global object? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
', '
)}.`;
return propertiesText;
};
const createNewObject = async () => {
// Check if object already exists.
let existingObject: gdObject | null = null;
if (layoutObjects.hasObjectNamed(object_name)) {
existingObject = layoutObjects.getObject(object_name);
... | Might be worth writing something like
```suggestion
`Object with name "${object_name}" already exists globally but with a different type ("${object_type}").`
```
(needs a boolean to remember or check where it's coming from, but worth it I think for a LLM that is freaking out) | ', '
)}.`;
return propertiesText;
};
const createNewObject = async () => {
// Check if object already exists.
let existingObject: gdObject | null = null;
let isGlobalObject = false;
if (layoutObjects.hasObjectNamed(object_name)) {
existingObject = layoutObje... | @@ -553,11 +558,39 @@ const createOrReplaceObject: EditorFunction = {
};
const createNewObject = async () => {
+ // Check if object already exists.
+ let existingObject: gdObject | null = null;
+
+ if (layoutObjects.hasObjectNamed(object_name)) {
+ existingObject = layoutObjects.getObj... | newIDE/app/src/EditorFunctions/index.js | 26 | JavaScript | 0.929 | suggestion | 289 | 51 | 51 | false | Object Editor Functions handle global scope | 7,959 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/index.js
PR Title: Object Editor Functions handle global scope
BEFORE CODE: ', '
)}.`;
return propertiesText;
};
const createNewObject = async () => {
// Check if object already exists.
... | Might be worth writing something like
```suggestion
`Object with name "${object_name}" already exists globally but with a different type ("${object_type}").`
```
(needs a boolean to remember or check where it's coming from, but worth it I think for a LLM that is freaking out) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
}
/**
* To be called when the game is disposed.
* Uninstall all the fonts from memory and clear cache of loaded fonts.
*/
dispose(): void {
for (const bitmapFontInstallKey in this._pixiBitmapFontsInUse) {
PIXI.BitmapFont.uninstall(bitmapFontInstallKey);
}
f... | I think that should be
```suggestion
if (bitmapFontInstallKey.startsWith(resourceData.name + '@')) {
```
to avoid issues when a resource name is a prefix of another (not that unlikely, it can happen if a resource name is "MyBitmapText" and another is "MyBitmapTextSpecial" or "MyBitmapText2", etc...) | }
}
/**
* To be called when the game is disposed.
* Uninstall all the fonts from memory and clear cache of loaded fonts.
*/
dispose(): void {
for (const bitmapFontInstallKey in this._pixiBitmapFontsInUse) {
PIXI.BitmapFont.uninstall(bitmapFontInstallKey);
}
f... | @@ -316,19 +316,27 @@ namespace gdjs {
}
unloadResource(resourceData: ResourceData): void {
- const loadedFont = this._loadedFontsData.getFromName(resourceData.name);
- if (loadedFont) {
- this._loadedFontsData.delete(resourceData);
- }
+ this._loadedFontsData.delete(resourceData)... | GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts | 26 | TypeScript | 0.857 | suggestion | 310 | 51 | 51 | false | Fix Bitmap text not being displayed after a 1st unload | 7,977 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts
PR Title: Fix Bitmap text not being displayed after a 1st unload
BEFORE CODE: }
}
/**
* To be called when the game is disposed.
* Uninstall all the fonts from memory and clear ... | I think that should be
```suggestion
if (bitmapFontInstallKey.startsWith(resourceData.name + '@')) {
```
to avoid issues when a resource name is a prefix of another (not that unlikely, it can happen if a resource name is "MyBitmapText" and another is "MyBitmapTextSpecial" or "MyBitmapText2", etc...) | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
PIXI.BitmapFont.uninstall(bitmapFontInstallKey);
}
this._pixiBitmapFontsInUse = {};
this._pixiBitmapFontsToUninstall.length = 0;
this._loadedFontsData.clear();
}
unloadResource(resourceData: ResourceData): void {
this._loadedFontsData.delete(resourceData);
for (con... | Same, probably safer to add the delimiter:
```suggestion
if (bitmapFontInstallKey.startsWith(resourceData.name + '@')) {
``` | PIXI.BitmapFont.uninstall(bitmapFontInstallKey);
}
this._pixiBitmapFontsInUse = {};
this._pixiBitmapFontsToUninstall.length = 0;
this._loadedFontsData.clear();
}
unloadResource(resourceData: ResourceData): void {
this._loadedFontsData.delete(resourceData);
for (con... | @@ -316,19 +316,27 @@ namespace gdjs {
}
unloadResource(resourceData: ResourceData): void {
- const loadedFont = this._loadedFontsData.getFromName(resourceData.name);
- if (loadedFont) {
- this._loadedFontsData.delete(resourceData);
- }
+ this._loadedFontsData.delete(resourceData)... | GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts | 26 | TypeScript | 0.714 | suggestion | 132 | 39 | 39 | false | Fix Bitmap text not being displayed after a 1st unload | 7,977 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts
PR Title: Fix Bitmap text not being displayed after a 1st unload
BEFORE CODE: PIXI.BitmapFont.uninstall(bitmapFontInstallKey);
}
this._pixiBitmapFontsInUse = {};
this._pixiBi... | Same, probably safer to add the delimiter:
```suggestion
if (bitmapFontInstallKey.startsWith(resourceData.name + '@')) {
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const selectedInstanceObjectName = this.instancesSelection
.getSelectedInstances()[0]
.getObjectName();
this.editObjectByName(selectedInstanceObjectName);
};
editLayerEffects = (layer: ?gdLayer) => {
this.setState({ editedLayer: layer, editedLayerInitialTab: 'effects' });
};
editLayer ... | ```suggestion
callback?: () => void
``` | const selectedInstanceObjectName = this.instancesSelection
.getSelectedInstances()[0]
.getObjectName();
this.editObjectByName(selectedInstanceObjectName);
};
editLayerEffects = (layer: ?gdLayer) => {
this.setState({ editedLayer: layer, editedLayerInitialTab: 'effects' });
};
editLayer ... | @@ -809,21 +809,31 @@ export default class SceneEditor extends React.Component<Props, State> {
this.setState({ layoutVariablesDialogOpen: open });
};
- editObject = (editedObject: ?gdObject, initialTab: ?ObjectEditorTab) => {
+ editObject = (
+ editedObject: ?gdObject,
+ initialTab: ?ObjectEditorTab,
... | newIDE/app/src/SceneEditor/index.js | 26 | JavaScript | 0.429 | suggestion | 43 | 51 | 51 | false | Fix object editor dialog not hot-reloading the editor | 7,991 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/SceneEditor/index.js
PR Title: Fix object editor dialog not hot-reloading the editor
BEFORE CODE: const selectedInstanceObjectName = this.instancesSelection
.getSelectedInstances()[0]
.getObjectName();
this.editObjectByNa... | ```suggestion
callback?: () => void
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/IDE/Events/ExpressionVa... | GetParameter does not do any bound checking nor return a "null object", so let's check the bound to avoid a crash in case a wrong parameterIndex is passed. Better be safe. |
#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/IDE/Events/ExpressionVa... | @@ -0,0 +1,141 @@
+/*
+ * GDevelop Core
+ * Copyright 2008-2025 Florian Rival (Florian.Rival@gmail.com). All rights
+ * reserved. This project is released under the MIT License.
+ */
+#include "InstructionValidator.h"
+
+#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
+#include "GDCore/Extensions/Metad... | Core/GDCore/IDE/InstructionValidator.cpp | 26 | C++ | 0.571 | bug | 171 | 51 | 51 | false | Show object parameters in red if any behavior parameter is wrongly filled | 7,997 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/InstructionValidator.cpp
PR Title: Show object parameters in red if any behavior parameter is wrongly filled
BEFORE CODE:
#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#i... | GetParameter does not do any bound checking nor return a "null object", so let's check the bound to avoid a crash in case a wrong parameterIndex is passed. Better be safe. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/IDE/Events/ExpressionVal... | ```suggestion
// TODO Remove the ternary when all parameter declarations use
``` | #include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/Platform.h"
#include "GDCore/IDE/Events/ExpressionVal... | @@ -0,0 +1,141 @@
+/*
+ * GDevelop Core
+ * Copyright 2008-2025 Florian Rival (Florian.Rival@gmail.com). All rights
+ * reserved. This project is released under the MIT License.
+ */
+#include "InstructionValidator.h"
+
+#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
+#include "GDCore/Extensions/Metad... | Core/GDCore/IDE/InstructionValidator.cpp | 26 | C++ | 0.643 | suggestion | 82 | 51 | 51 | false | Show object parameters in red if any behavior parameter is wrongly filled | 7,997 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/InstructionValidator.cpp
PR Title: Show object parameters in red if any behavior parameter is wrongly filled
BEFORE CODE: #include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
#include "GDCore/Extensions/Metadata/BehaviorMetadata.h"
#in... | ```suggestion
// TODO Remove the ternary when all parameter declarations use
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
std::size_t parameterIndex, const gd::String &value) {
auto ¶meterMetadata = metadata.GetParameter(parameterIndex);
// TODO Remove the ternary when any parameter declaration uses
// "number" instead of "expression".
auto ¶meterType = parameterMetadata.GetType() == "expression"
... | ```suggestion
// declared while legacy ones don't.
// This is why it's done here instead of in the parser directly.
``` | std::size_t parameterIndex, const gd::String &value) {
if (parameterIndex >= instruction.GetParametersCount() ||
parameterIndex >= metadata.GetParametersCount()) {
return false;
}
const auto ¶meterMetadata = metadata.GetParameter(parameterIndex);
// TODO Remove the ternary when all parameter d... | @@ -0,0 +1,141 @@
+/*
+ * GDevelop Core
+ * Copyright 2008-2025 Florian Rival (Florian.Rival@gmail.com). All rights
+ * reserved. This project is released under the MIT License.
+ */
+#include "InstructionValidator.h"
+
+#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
+#include "GDCore/Extensions/Metad... | Core/GDCore/IDE/InstructionValidator.cpp | 26 | C++ | 0.786 | suggestion | 127 | 51 | 51 | false | Show object parameters in red if any behavior parameter is wrongly filled | 7,997 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/InstructionValidator.cpp
PR Title: Show object parameters in red if any behavior parameter is wrongly filled
BEFORE CODE: std::size_t parameterIndex, const gd::String &value) {
auto ¶meterMetadata = metadata.GetParameter(parameterIndex);... | ```suggestion
// declared while legacy ones don't.
// This is why it's done here instead of in the parser directly.
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
auto ¶meterType = parameterMetadata.GetType() == "expression"
? "number"
: parameterMetadata.GetType();
bool shouldNotBeValidated = parameterType == "layer" && value.empty();
if (shouldNotBeValidated) {
return true;
}
if (gd::ParameterMetadata::I... | ```suggestion
// Check at least the name of the root variable, it's the best we can
``` | }
const auto ¶meterMetadata = metadata.GetParameter(parameterIndex);
// TODO Remove the ternary when all parameter declarations use
// "number" instead of "expression".
const auto ¶meterType = parameterMetadata.GetType() == "expression"
? "number"
... | @@ -0,0 +1,141 @@
+/*
+ * GDevelop Core
+ * Copyright 2008-2025 Florian Rival (Florian.Rival@gmail.com). All rights
+ * reserved. This project is released under the MIT License.
+ */
+#include "InstructionValidator.h"
+
+#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
+#include "GDCore/Extensions/Metad... | Core/GDCore/IDE/InstructionValidator.cpp | 26 | C++ | 0.571 | suggestion | 93 | 51 | 51 | false | Show object parameters in red if any behavior parameter is wrongly filled | 7,997 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/InstructionValidator.cpp
PR Title: Show object parameters in red if any behavior parameter is wrongly filled
BEFORE CODE: auto ¶meterType = parameterMetadata.GetType() == "expression"
? "number"
... | ```suggestion
// Check at least the name of the root variable, it's the best we can
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
: parameterMetadata.GetType();
bool shouldNotBeValidated = parameterType == "layer" && value.empty();
if (shouldNotBeValidated) {
return true;
}
if (gd::ParameterMetadata::IsExpression("number", parameterType) ||
gd::ParameterMetadata::IsExpression("string", parameterType) ... | Try to use `const auto&` as possible, better to ensure we don't mutate these things. | // TODO Remove the ternary when all parameter declarations use
// "number" instead of "expression".
const auto ¶meterType = parameterMetadata.GetType() == "expression"
? "number"
: parameterMetadata.GetType();
bool shouldNotBeValidated = pa... | @@ -0,0 +1,141 @@
+/*
+ * GDevelop Core
+ * Copyright 2008-2025 Florian Rival (Florian.Rival@gmail.com). All rights
+ * reserved. This project is released under the MIT License.
+ */
+#include "InstructionValidator.h"
+
+#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
+#include "GDCore/Extensions/Metad... | Core/GDCore/IDE/InstructionValidator.cpp | 26 | C++ | 0.429 | suggestion | 84 | 51 | 51 | false | Show object parameters in red if any behavior parameter is wrongly filled | 7,997 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/InstructionValidator.cpp
PR Title: Show object parameters in red if any behavior parameter is wrongly filled
BEFORE CODE: : parameterMetadata.GetType();
bool shouldNotBeValidated = parameterType == "layer" && value.em... | Try to use `const auto&` as possible, better to ensure we don't mutate these things. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
return true;
}
gd::String InstructionValidator::GetRootVariableName(const gd::String &name) {
auto dotPosition = name.find('.');
auto squareBracketPosition = name.find('[');
if (dotPosition == gd::String::npos &&
squareBracketPosition == gd::String::npos) {
return name;
}
return name.substr(0... | Here and below, try to const everything:
```suggestion
const auto &behaviorParameter = instructionMetadata.GetParameter(index);
``` | const auto &resourceName =
instruction.GetParameter(parameterIndex).GetPlainString();
return projectScopedContainers.GetResourcesContainersList()
.HasResourceNamed(resourceName);
}
return true;
}
gd::String InstructionValidator::GetRootVariableName(const gd::String &name) {
const auto dot... | @@ -0,0 +1,141 @@
+/*
+ * GDevelop Core
+ * Copyright 2008-2025 Florian Rival (Florian.Rival@gmail.com). All rights
+ * reserved. This project is released under the MIT License.
+ */
+#include "InstructionValidator.h"
+
+#include "GDCore/Extensions/Metadata/AbstractFunctionMetadata.h"
+#include "GDCore/Extensions/Metad... | Core/GDCore/IDE/InstructionValidator.cpp | 26 | C++ | 0.714 | suggestion | 136 | 51 | 51 | false | Show object parameters in red if any behavior parameter is wrongly filled | 7,997 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/InstructionValidator.cpp
PR Title: Show object parameters in red if any behavior parameter is wrongly filled
BEFORE CODE: }
return true;
}
gd::String InstructionValidator::GetRootVariableName(const gd::String &name) {
auto dotPosition = nam... | Here and below, try to const everything:
```suggestion
const auto &behaviorParameter = instructionMetadata.GetParameter(index);
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
<SelectOption
key={effectMetadata.type}
value={effectMetadata.type}
label={effectMetadata.fullName}
disabled={
target === 'object' &&
effectMetadata.i... | Maybe I should have kept "Hide" and "Show" like for layers | <SelectOption
key={effectMetadata.type}
value={effectMetadata.type}
label={effectMetadata.fullName}
disabled={
target === 'object' &&
effectMetadata.i... | @@ -300,6 +303,24 @@ const Effect = React.forwardRef(
/>
))}
</SelectField>
+ <InlineCheckbox
+ id="layer-visibility"
+ paddingSize="small"
+ checkedIcon={<VisibilityIcon />}
+ ... | newIDE/app/src/EffectsList/index.js | 26 | JavaScript | 0.286 | suggestion | 58 | 51 | 51 | false | Allow to set effects as initially disabled | 8,002 | 4ian/GDevelop | 10,154 | JavaScript | D8H | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EffectsList/index.js
PR Title: Allow to set effects as initially disabled
BEFORE CODE: <SelectOption
key={effectMetadata.type}
value={effectMetadata.type}
... | Maybe I should have kept "Hide" and "Show" like for layers | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "GDCore/Project/Effect.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Serialization/SerializerElement.h"
namespace gd {
gd::String Effect::bad... | could that be:
```suggestion
element.SetBoolAttribute("disabled", true);
```
? | /*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "GDCore/Project/Effect.h"
#include "GDCore/CommonTools.h"
#include "GDCore/Serialization/SerializerElement.h"
namespace gd {
gd::String Effect::bad... | @@ -15,7 +15,9 @@ void Effect::SerializeTo(SerializerElement& element) const {
element.SetAttribute("name", GetName());
element.SetAttribute("effectType", GetEffectType());
if (IsFolded()) element.SetBoolAttribute("folded", true);
-
+ if (!IsEnabled()) {
+ element.SetBoolAttribute("isDisabled", true); | Core/GDCore/Project/Effect.cpp | 19 | C++ | 0.643 | question | 82 | 44 | 44 | false | Allow to set effects as initially disabled | 8,002 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/Project/Effect.cpp
PR Title: Allow to set effects as initially disabled
BEFORE CODE: /*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#inclu... | could that be:
```suggestion
element.SetBoolAttribute("disabled", true);
```
? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
extensionName,
onWillInstallExtension,
onExtensionInstalled,
onOpenEventsFunctionsExtension,
}: Props) {
const [isInstalling, setIsInstalling] = React.useState<boolean>(false);
const installExtension = useInstallExtension();
const {
translatedExtensionShortHeadersByName: extensionShortHeadersByName,
... | why is the array `missingExtensionShortHeaders` not returning the assetShortHeader when it has been installed before? should it always return it instead of pushing it afterwards? | extensionName,
onWillInstallExtension,
onExtensionInstalled,
onOpenEventsFunctionsExtension,
}: Props) {
const [isInstalling, setIsInstalling] = React.useState<boolean>(false);
const installExtension = useInstallExtension();
const {
translatedExtensionShortHeadersByName: extensionShortHeadersByName,
... | @@ -51,6 +51,16 @@ function InstalledExtensionDetails({
extensionShortHeadersByName,
}
);
+ if (
+ !requiredExtensionInstallation.missingExtensionShortHeaders.includes( | newIDE/app/src/ProjectManager/InstalledExtensionDetails.js | 26 | JavaScript | 0.571 | question | 178 | 51 | 51 | false | Fix extension reinstall wasn't doing anything | 8,017 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ProjectManager/InstalledExtensionDetails.js
PR Title: Fix extension reinstall wasn't doing anything
BEFORE CODE: extensionName,
onWillInstallExtension,
onExtensionInstalled,
onOpenEventsFunctionsExtension,
}: Props) {
const [isInst... | why is the array `missingExtensionShortHeaders` not returning the assetShortHeader when it has been installed before? should it always return it instead of pushing it afterwards? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
>
{props.firstIndex + index + 1}
</Button>
))}
</ButtonGroup>
</div>
);
};
const isBitEnabled = (bitsValue: number, pos: number) => {
return !!(bitsValue & (1 << pos));
};
const enableBit = (bitsValue: number, pos: number, enable: boolean) => {
if (enable) bitsV... | Is there a risk these are "bad metadata"? Should we protect against this? | >
{props.firstIndex + index + 1}
</Button>
))}
</ButtonGroup>
</div>
);
};
const isBitEnabled = (bitsValue: number, pos: number) => {
return !!(bitsValue & (1 << pos));
};
const enableBit = (bitsValue: number, pos: number, enable: boolean) => {
if (enable) bitsV... | @@ -64,7 +66,20 @@ const Physics3DEditor = (props: Props) => {
const forceUpdate = useForceUpdate();
const areAdvancedPropertiesExpandedByDefault = React.useMemo(
- () => areAdvancedPropertiesModified(behavior),
+ () => {
+ const behaviorMetadata = gd.MetadataProvider.getBehaviorMetadata( | newIDE/app/src/BehaviorsEditor/Editors/Physics3DEditor/index.js | 26 | JavaScript | 0.286 | question | 73 | 51 | 51 | false | Collapse advanced properties in the object editor | 8,028 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/BehaviorsEditor/Editors/Physics3DEditor/index.js
PR Title: Collapse advanced properties in the object editor
BEFORE CODE: >
{props.firstIndex + index + 1}
</Button>
))}
</ButtonGroup>
</div>
... | Is there a risk these are "bad metadata"? Should we protect against this? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
<ColumnStackLayout noMargin>
{renderObjectNameField && renderObjectNameField()}
{tutorialIds.map(tutorialId => (
<DismissableTutorialMessage
key={tutorialId}
tutorialId={tutorialId}
/>
))}
... | Let's protect against propertyName not being present in the map of properties. | <ColumnStackLayout noMargin>
{renderObjectNameField && renderObjectNameField()}
{tutorialIds.map(tutorialId => (
<DismissableTutorialMessage
key={tutorialId}
tutorialId={tutorialId}
/>
))}
... | @@ -469,15 +457,36 @@ const CustomObjectPropertiesEditor = (props: Props) => {
</ColumnStackLayout>
</Line>
) : null}
- <PropertiesEditor
- unsavedChanges={unsavedChanges}
- schema={propertiesSchema}
- ... | newIDE/app/src/ObjectEditor/Editors/CustomObjectPropertiesEditor/index.js | 26 | JavaScript | 0.214 | suggestion | 78 | 51 | 51 | false | Collapse advanced properties in the object editor | 8,028 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ObjectEditor/Editors/CustomObjectPropertiesEditor/index.js
PR Title: Collapse advanced properties in the object editor
BEFORE CODE: <ColumnStackLayout noMargin>
{renderObjectNameField && renderObjectNameField()}
... | Let's protect against propertyName not being present in the map of properties. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
import { type BehaviorEditorProps } from './BehaviorEditorProps.flow';
import { Column } from '../../UI/Grid';
const gd: libGDevelop = global.gd;
type Props = BehaviorEditorProps;
const BehaviorPropertiesEditor = ({
project,
behavior,
object,
onBehaviorUpdated,
resourceManagementProps,
projectScopedConta... | Let's protect against propertyName not being present in the map of properties. | import { type BehaviorEditorProps } from './BehaviorEditorProps.flow';
import { Column } from '../../UI/Grid';
const gd: libGDevelop = global.gd;
type Props = BehaviorEditorProps;
const BehaviorPropertiesEditor = ({
project,
behavior,
object,
onBehaviorUpdated,
resourceManagementProps,
projectScopedConta... | @@ -52,131 +18,33 @@ const BehaviorPropertiesEditor = ({
resourceManagementProps,
projectScopedContainersAccessor,
}: Props) => {
- const [
- shouldShowDeprecatedProperties,
- setShouldShowDeprecatedProperties,
- ] = React.useState<boolean>(false);
-
- const basicPropertiesSchema = React.useMemo(
- (... | newIDE/app/src/BehaviorsEditor/Editors/BehaviorPropertiesEditor.js | 26 | JavaScript | 0.214 | suggestion | 78 | 48 | 48 | false | Collapse advanced properties in the object editor | 8,028 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/BehaviorsEditor/Editors/BehaviorPropertiesEditor.js
PR Title: Collapse advanced properties in the object editor
BEFORE CODE: import { type BehaviorEditorProps } from './BehaviorEditorProps.flow';
import { Column } from '../../UI/Grid';
cons... | Let's protect against propertyName not being present in the map of properties. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
};
const isBitEnabled = (bitsValue: number, pos: number) => {
return !!(bitsValue & (1 << pos));
};
const enableBit = (bitsValue: number, pos: number, enable: boolean) => {
if (enable) bitsValue |= 1 << pos;
else bitsValue &= ~(1 << pos);
return bitsValue;
};
const Physics3DEditor = (props: Props) => {
con... | As for the rest, probably check if propertyName exists? | };
const isBitEnabled = (bitsValue: number, pos: number) => {
return !!(bitsValue & (1 << pos));
};
const enableBit = (bitsValue: number, pos: number, enable: boolean) => {
if (enable) bitsValue |= 1 << pos;
else bitsValue &= ~(1 << pos);
return bitsValue;
};
const Physics3DEditor = (props: Props) => {
con... | @@ -64,7 +66,20 @@ const Physics3DEditor = (props: Props) => {
const forceUpdate = useForceUpdate();
const areAdvancedPropertiesExpandedByDefault = React.useMemo(
- () => areAdvancedPropertiesModified(behavior),
+ () => {
+ const behaviorMetadata = gd.MetadataProvider.getBehaviorMetadata(
+ gd... | newIDE/app/src/BehaviorsEditor/Editors/Physics3DEditor/index.js | 26 | JavaScript | 0.214 | question | 55 | 51 | 51 | false | Collapse advanced properties in the object editor | 8,028 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/BehaviorsEditor/Editors/Physics3DEditor/index.js
PR Title: Collapse advanced properties in the object editor
BEFORE CODE: };
const isBitEnabled = (bitsValue: number, pos: number) => {
return !!(bitsValue & (1 << pos));
};
const enableBit... | As for the rest, probably check if propertyName exists? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// Notifications on Microsoft Windows platforms show the app user model id.
// If not set, defaults to `electron.app.{app.name}`.
if (process.platform === 'win32') {
app.setAppUserModelId('gdevelop.ide');
}
// Quit when all windows are closed.
app.on('window-all-closed', function() {
app.quit();
});
// This meth... | Could you run Prettier on this file (if you use VS Code, use the "Format document" command in the command palette)?
|
// Notifications on Microsoft Windows platforms show the app user model id.
// If not set, defaults to `electron.app.{app.name}`.
if (process.platform === 'win32') {
app.setAppUserModelId('gdevelop.ide');
}
// Quit when all windows are closed.
app.on('window-all-closed', function() {
app.quit();
});
// This meth... | @@ -94,27 +94,9 @@ app.on('ready', function() {
registerGdideProtocol({ isDev });
// Create the browser window.
- const options = {
- width: args.width || 800,
- height: args.height || 600,
- x: args.x,
- y: args.y,
- titleBarStyle: 'hidden',
- titleBarOverlay: {
- color: '#000000',
- ... | newIDE/electron-app/app/main.js | 26 | JavaScript | 0.429 | question | 116 | 51 | 51 | false | feat: Add "window-maximize-toggle" for macOS | 8,053 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: JavaScript
File: newIDE/electron-app/app/main.js
PR Title: feat: Add "window-maximize-toggle" for macOS
BEFORE CODE:
// Notifications on Microsoft Windows platforms show the app user model id.
// If not set, defaults to `electron.app.{app.name}`.
if (process.platform === ... | Could you run Prettier on this file (if you use VS Code, use the "Format document" command in the command palette)?
| You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
private _loadingSpineAtlases = new gdjs.ResourceCache<
Promise<pixi_spine.TextureAtlas>
>();
/**
* @param resourceLoader The resources loader of the game.
* @param imageManager The image manager of the game.
*/
constructor(
resourceLoader: gdjs.ResourceLoader,
imageMana... | This one might be unnecessary unless you have an idea like making it very clear it can throw? | private _loadingSpineAtlases = new gdjs.ResourceCache<
Promise<pixi_spine.TextureAtlas>
>();
/**
* @param resourceLoader The resources loader of the game.
* @param imageManager The image manager of the game.
*/
constructor(
resourceLoader: gdjs.ResourceLoader,
imageMana... | @@ -50,7 +50,11 @@ namespace gdjs {
}
async loadResource(resourceName: string): Promise<void> {
- await this.getOrLoad(resourceName);
+ try { | Extensions/Spine/managers/pixi-spine-atlas-manager.ts | 26 | TypeScript | 0.214 | question | 93 | 51 | 51 | false | Fix throw error from load resource in managers for support retries logic | 8,060 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: TypeScript
File: Extensions/Spine/managers/pixi-spine-atlas-manager.ts
PR Title: Fix throw error from load resource in managers for support retries logic
BEFORE CODE: private _loadingSpineAtlases = new gdjs.ResourceCache<
Promise<pixi_spine.TextureAtlas>
>();... | This one might be unnecessary unless you have an idea like making it very clear it can throw? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
logger.warn(
'There was an error while preloading an audio file: ' + error
);
throw error;
}
} else if (
resource.preloadInCache ||
// Force downloading of sounds.
// TODO Decide if sounds should be allowed to be downloaded after the scene ... | I suggest an exception that gives more context to ease debugging:
```suggestion
reject(`HTTP error while preloading audio file in cache. Status is ${sound.status}.`);
``` | logger.warn(
'There was an error while preloading an audio file: ' + error
);
throw error;
}
} else if (
resource.preloadInCache ||
// Force downloading of sounds.
// TODO Decide if sounds should be allowed to be downloaded after the scene ... | @@ -1059,7 +1068,13 @@ namespace gdjs {
const sound = new XMLHttpRequest();
sound.withCredentials =
this._resourceLoader.checkIfCredentialsRequired(file);
- sound.addEventListener('load', resolve);
+ sound.addEventListener('load', () => {
+ if ... | GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts | 26 | TypeScript | 0.857 | bug | 186 | 51 | 51 | false | Fix throw error from load resource in managers for support retries logic | 8,060 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/howler-sound-manager/howler-sound-manager.ts
PR Title: Fix throw error from load resource in managers for support retries logic
BEFORE CODE: logger.warn(
'There was an error while preloading an audio file: ' + error
... | I suggest an exception that gives more context to ease debugging:
```suggestion
reject(`HTTP error while preloading audio file in cache. Status is ${sound.status}.`);
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (!resource) {
logger.warn(
'Unable to find bitmap font for resource "' + resourceName + '".'
);
return;
}
if (this._loadedFontsData.get(resource)) {
return;
}
try {
const response = await fetch(
this._resourceLoader.getFullUrl... | ```suggestion
throw new Error(`HTTP error while loading bitmap font. Status is ${sound.status}.`);
``` | if (!resource) {
logger.warn(
'Unable to find bitmap font for resource "' + resourceName + '".'
);
return;
}
if (this._loadedFontsData.get(resource)) {
return;
}
try {
const response = await fetch(
this._resourceLoader.getFullUrl... | @@ -278,6 +278,10 @@ namespace gdjs {
'same-origin',
}
);
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`); | GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts | 26 | TypeScript | 0.857 | suggestion | 112 | 51 | 51 | false | Fix throw error from load resource in managers for support retries logic | 8,060 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/pixi-renderers/pixi-bitmapfont-manager.ts
PR Title: Fix throw error from load resource in managers for support retries logic
BEFORE CODE: if (!resource) {
logger.warn(
'Unable to find bitmap font for resource "' + resou... | ```suggestion
throw new Error(`HTTP error while loading bitmap font. Status is ${sound.status}.`);
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
? resource
: null;
};
/**
* Return a PIXI texture which can be used as a placeholder when no
* suitable texture can be found.
*/
getInvalidPIXITexture() {
return this._invalidTexture;
}
/**
* Load the specified resources, so that textures are loaded and ca... | Same comment here: this looks unnecessary? | ? resource
: null;
};
/**
* Return a PIXI texture which can be used as a placeholder when no
* suitable texture can be found.
*/
getInvalidPIXITexture() {
return this._invalidTexture;
}
/**
* Load the specified resources, so that textures are loaded and ca... | @@ -400,7 +400,12 @@ namespace gdjs {
);
return;
}
- await this._loadTexture(resource);
+
+ try { | GDJS/Runtime/pixi-renderers/pixi-image-manager.ts | 26 | TypeScript | 0.071 | question | 42 | 51 | 51 | false | Fix throw error from load resource in managers for support retries logic | 8,060 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/pixi-renderers/pixi-image-manager.ts
PR Title: Fix throw error from load resource in managers for support retries logic
BEFORE CODE: ? resource
: null;
};
/**
* Return a PIXI texture which can be used as a placeho... | Same comment here: this looks unnecessary? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
})
.on('error', (error) => {
reject(error);
});
});
} else {
// If the file has no extension, PIXI.assets.load cannot find
// an adequate load parser and does not load the file although
// we would like to force it... | Have you observed this to be useful? I wonder if this will work because the internal texture id used by PixiJS could be different than the resourceUrl? | } else {
// If the file has no extension, PIXI.assets.load cannot find
// an adequate load parser and does not load the file although
// we would like to force it to load (we are confident it's an image).
// TODO: When PIXI v8+ is used, PIXI.Assets.load can be used becaus... | @@ -479,6 +479,9 @@ namespace gdjs {
}
} catch (error) {
logFileLoadingError(resource.file, error);
+ PIXI.Texture.removeFromCache(resourceUrl); | GDJS/Runtime/pixi-renderers/pixi-image-manager.ts | 26 | TypeScript | 0.429 | question | 151 | 51 | 51 | false | Fix throw error from load resource in managers for support retries logic | 8,060 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/pixi-renderers/pixi-image-manager.ts
PR Title: Fix throw error from load resource in managers for support retries logic
BEFORE CODE: })
.on('error', (error) => {
reject(error);
});
... | Have you observed this to be useful? I wonder if this will work because the internal texture id used by PixiJS could be different than the resourceUrl? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
alignItems: 'stretch',
overflowY: 'auto',
},
planCardsLineContainer: {
display: 'inline-flex',
flexDirection: 'row',
alignItems: 'stretch',
gap: 8,
overflowY: 'auto',
},
currentPlanPaper: {
padding: '8px 12px',
},
};
const cancelConfirmationTexts = {
title: t`Cancel your sub... | should this be danger / warning too? | overflowY: 'auto',
},
planCardsLineContainer: {
display: 'inline-flex',
flexDirection: 'row',
alignItems: 'stretch',
gap: 8,
overflowY: 'auto',
},
currentPlanPaper: {
padding: '8px 12px',
},
};
const cancelConfirmationTexts = {
level: 'normal',
dialogTexts: {
title: t`Canc... | @@ -94,32 +93,34 @@ const styles = {
};
const cancelConfirmationTexts = {
- title: t`Cancel your subscription?`,
- message: t`By canceling your subscription, you will lose all your premium features at the end of the period you already paid for. Continue?`,
- confirmButtonLabel: t`Continue`,
- dismissButtonLabel... | newIDE/app/src/Profile/Subscription/SubscriptionDialog.js | 26 | JavaScript | 0.143 | question | 36 | 51 | 51 | false | Make clearer warning when stopping subscription with a redemption code | 8,070 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | 4ian | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/Profile/Subscription/SubscriptionDialog.js
PR Title: Make clearer warning when stopping subscription with a redemption code
BEFORE CODE: alignItems: 'stretch',
overflowY: 'auto',
},
planCardsLineContainer: {
display: 'inline-... | should this be danger / warning too? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import { type ProjectSettings } from './ProjectSettingsReader';
import { type Preferences } from '../MainFrame/Preferences/PreferencesContext';
/**
* Applies project-specific settings from a settings.ini file to the editor preferences.
* This allows projects to override certain editor preferences when they ... | This is fairly verbose. I wonder if we could reduce everything to a few key concepts:
- ProjectSettings renamed to "ProjectSpecificPreferences". It can be a "Partial<Preferences>" (or in Flow, I think it's `$Shape<Preferences>`).
- An "allowlist" of names of preferences that can be overwritten.
- When a project is loa... | // @flow
import { type ParsedProjectSettings } from './ProjectSettingsReader';
import {
type Preferences,
type ProjectSpecificPreferencesValues,
} from '../MainFrame/Preferences/PreferencesContext';
/** Allowlist of preference keys that can be overridden per-project. */
const allowedPreferenceKeys: $ReadOnlyArray<... | @@ -0,0 +1,117 @@
+// @flow
+import { type ProjectSettings } from './ProjectSettingsReader';
+import { type Preferences } from '../MainFrame/Preferences/PreferencesContext';
+
+/**
+ * Applies project-specific settings from a settings.ini file to the editor preferences.
+ * This allows projects to override certain edit... | newIDE/app/src/Utils/ApplyProjectSettings.js | 16 | JavaScript | 0.643 | suggestion | 496 | 41 | 41 | false | feat: Project-specific Editor Settings | 8,101 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | malec-palec | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/Utils/ApplyProjectSettings.js
PR Title: feat: Project-specific Editor Settings
BEFORE CODE: // @flow
import { type ProjectSettings } from './ProjectSettingsReader';
import { type Preferences } from '../MainFrame/Preferences/PreferencesContex... | This is fairly verbose. I wonder if we could reduce everything to a few key concepts:
- ProjectSettings renamed to "ProjectSpecificPreferences". It can be a "Partial<Preferences>" (or in Flow, I think it's `$Shape<Preferences>`).
- An "allowlist" of names of preferences that can be overwritten.
- When a project is loa... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
});
test('ignores non-boolean values', () => {
const rawSettings = {
autosaveOnPreview: 'true',
use3DEditor: 42,
showDeprecatedInstructionWarning: null,
};
expect(convertToProjectSettings(rawSettings)).toEqual({});
});
test('handles all valid preference keys',... | These tests are a bit of a "tautology". I would rather reduce the noise-to-signal ratio by not having them, as "testing a Set" is not super interesting and will actually make the codebase less flexible (because you have to remember updating these if at some point you rework the set to be something else). In other words... | // @flow
import {
filterAllowedPreferences,
applyProjectSettings,
} from './ApplyProjectSettings';
import YAML from 'yaml';
describe('ProjectSettingsReader', () => {
describe('end-to-end: YAML content applied to preferences', () => {
test('gdevelop-settings.yaml content is properly parsed, filtered, and appl... | @@ -0,0 +1,265 @@
+// @flow
+import {
+ flattenIniObject,
+ convertToProjectSettings,
+ VALID_PREFERENCE_KEYS,
+} from './ProjectSettingsReader';
+import ini from 'ini';
+
+describe('ProjectSettingsReader', () => {
+ describe('ini library parsing', () => {
+ test('parses true/false as native booleans', () => {
+... | newIDE/app/src/Utils/ProjectSettingsReader.spec.js | 26 | JavaScript | 0.5 | suggestion | 566 | 42 | 121 | false | feat: Project-specific Editor Settings | 8,101 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | malec-palec | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/Utils/ProjectSettingsReader.spec.js
PR Title: feat: Project-specific Editor Settings
BEFORE CODE: });
test('ignores non-boolean values', () => {
const rawSettings = {
autosaveOnPreview: 'true',
use3DEditor: 42,... | These tests are a bit of a "tautology". I would rather reduce the noise-to-signal ratio by not having them, as "testing a Set" is not super interesting and will actually make the codebase less flexible (because you have to remember updating these if at some point you rework the set to be something else). In other words... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import optionalRequire from './OptionalRequire';
import YAML from 'yaml';
const fs = optionalRequire('node:fs');
const fsPromises = fs ? fs.promises : null;
const path = optionalRequire('node:path');
export type RawProjectSettings = {
preferences?: { [string]: mixed },
};
export type ParsedProjectSettings... | I suggest we use a slightly more specific name to avoid conflicts:
```suggestion
const SETTINGS_FILE_NAME = 'gdevelop-settings.yaml';
``` | // @flow
import optionalRequire from './OptionalRequire';
import YAML from 'yaml';
import { SafeExtractor } from './SafeExtractor';
const fs = optionalRequire('fs');
const fsPromises = fs ? fs.promises : null;
const path = optionalRequire('path');
export type ParsedProjectSettings = {
preferences: { [string]: boole... | @@ -0,0 +1,97 @@
+// @flow
+import optionalRequire from './OptionalRequire';
+import YAML from 'yaml';
+
+const fs = optionalRequire('node:fs');
+const fsPromises = fs ? fs.promises : null;
+const path = optionalRequire('node:path');
+
+export type RawProjectSettings = {
+ preferences?: { [string]: mixed },
+};
+
+exp... | newIDE/app/src/Utils/ProjectSettingsReader.js | 17 | JavaScript | 0.786 | suggestion | 137 | 42 | 42 | false | feat: Project-specific Editor Settings | 8,101 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | malec-palec | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/Utils/ProjectSettingsReader.js
PR Title: feat: Project-specific Editor Settings
BEFORE CODE: // @flow
import optionalRequire from './OptionalRequire';
import YAML from 'yaml';
const fs = optionalRequire('node:fs');
const fsPromises = fs ? f... | I suggest we use a slightly more specific name to avoid conflicts:
```suggestion
const SETTINGS_FILE_NAME = 'gdevelop-settings.yaml';
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
!!remote &&
!!this.props.fileMetadata &&
this.props.storageProvider.internalName === 'LocalFile'
}
onToggleProperties={this.toggleProperties}
isPropertiesShown={openedEditorNames.includes('properties')}
canDelete={!!this.state.selectedResource}
onDel... | Use `GetResourcePosition`. No need for allNames | );
onDeleteResource(resource, doRemove => {
if (!doRemove || !resource) return;
resourcesManager.removeResource(resource.getName());
const newCount = resourcesManager.count();
const nextResourceToSelect =
newCount > 0
? resourcesManager.getResourceAt(Math.min(current... | @@ -126,18 +157,38 @@ export default class ResourcesEditor extends React.Component<Props, State> {
);
if (!answer) return;
+ const resourcesManager = project.getResourcesManager();
+ const allNames = resourcesManager.getAllResourceNames().toJSArray();
+ const currentIndex = allNames.indexOf(resourc... | newIDE/app/src/ResourcesEditor/index.js | 26 | JavaScript | 0.286 | suggestion | 47 | 51 | 51 | false | QoL Resource tab with shortcuts | 8,115 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesEditor/index.js
PR Title: QoL Resource tab with shortcuts
BEFORE CODE: !!remote &&
!!this.props.fileMetadata &&
this.props.storageProvider.internalName === 'LocalFile'
}
onToggleProperti... | Use `GetResourcePosition`. No need for allNames | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
onToggleProperties={this.toggleProperties}
isPropertiesShown={openedEditorNames.includes('properties')}
canDelete={!!this.state.selectedResource}
onDeleteSelection={() =>
this.deleteResource(this.state.selectedResource)
}
/>
);
};
deleteResource... | Ideally we would expose `Count` in Bindings.idl for ResourcesContainer | if (!doRemove || !resource) return;
resourcesManager.removeResource(resource.getName());
const newCount = resourcesManager.count();
const nextResourceToSelect =
newCount > 0
? resourcesManager.getResourceAt(Math.min(currentIndex, newCount - 1))
: null;
this.s... | @@ -126,18 +157,38 @@ export default class ResourcesEditor extends React.Component<Props, State> {
);
if (!answer) return;
+ const resourcesManager = project.getResourcesManager();
+ const allNames = resourcesManager.getAllResourceNames().toJSArray();
+ const currentIndex = allNames.indexOf(resourc... | newIDE/app/src/ResourcesEditor/index.js | 26 | JavaScript | 0.357 | suggestion | 70 | 51 | 51 | false | QoL Resource tab with shortcuts | 8,115 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesEditor/index.js
PR Title: QoL Resource tab with shortcuts
BEFORE CODE: }
onToggleProperties={this.toggleProperties}
isPropertiesShown={openedEditorNames.includes('properties')}
canDelete={!!this.state... | Ideally we would expose `Count` in Bindings.idl for ResourcesContainer | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
properties: {
type: 'secondary',
title: t`Properties`,
renderEditor: () => (
<ResourcePropertiesEditor
key={selectedResource ? selectedResource.ptr : undefined}
resources={selectedResource ? [selectedResource] : []}
project={project}
... | Do we really need this container? Could we have a "onKeyDown" on the ResourcesList? |
const editors = {
properties: {
type: 'secondary',
title: t`Properties`,
renderEditor: () => (
<ResourcePropertiesEditor
key={selectedResource ? selectedResource.ptr : undefined}
resources={selectedResource ? [selectedResource] : []}
proje... | @@ -273,22 +324,32 @@ export default class ResourcesEditor extends React.Component<Props, State> {
type: 'primary',
noTitleBar: true,
renderEditor: () => (
- <ResourcesList
- project={project}
- fileMetadata={fileMetadata}
- onDeleteResource={this.del... | newIDE/app/src/ResourcesEditor/index.js | 26 | JavaScript | 0.286 | question | 83 | 51 | 51 | false | QoL Resource tab with shortcuts | 8,115 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesEditor/index.js
PR Title: QoL Resource tab with shortcuts
BEFORE CODE: properties: {
type: 'secondary',
title: t`Properties`,
renderEditor: () => (
<ResourcePropertiesEditor
key={s... | Do we really need this container? Could we have a "onKeyDown" on the ResourcesList? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
componentWillUnmount() {
unregisterOnResourceExternallyChangedCallback(
this.resourceExternallyChangedCallbackId
);
}
_onKeyDown = (event: KeyboardEvent) => {
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
this._moveSelection(event.key === 'ArrowDown' ? 1 : -1);
ev... | Same as the other, I think it would be worth exposing Count and using GetResourcePosition rather than everytime getting getAllResourceNames + calling to JSArray which creates useless copies of the list of names in memory. | componentDidMount() {
this.resourceExternallyChangedCallbackId = registerOnResourceExternallyChangedCallback(
this.onResourceExternallyChanged.bind(this)
);
}
componentWillUnmount() {
unregisterOnResourceExternallyChangedCallback(
this.resourceExternallyChangedCallbackId
);
}
ref... | @@ -84,12 +84,43 @@ export default class ResourcesEditor extends React.Component<Props, State> {
this.onResourceExternallyChanged.bind(this)
);
}
+
componentWillUnmount() {
unregisterOnResourceExternallyChangedCallback(
this.resourceExternallyChangedCallbackId
);
}
+ _onKeyDown ... | newIDE/app/src/ResourcesEditor/index.js | 26 | JavaScript | 0.643 | suggestion | 221 | 51 | 51 | false | QoL Resource tab with shortcuts | 8,115 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesEditor/index.js
PR Title: QoL Resource tab with shortcuts
BEFORE CODE: }
componentWillUnmount() {
unregisterOnResourceExternallyChangedCallback(
this.resourceExternallyChangedCallbackId
);
}
_onKeyDown = (eve... | Same as the other, I think it would be worth exposing Count and using GetResourcePosition rather than everytime getting getAllResourceNames + calling to JSArray which creates useless copies of the list of names in memory. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
return (
<Background>
<Line>
<Column expand>
<SearchBar
value={searchText}
onRequestSearch={() => {}}
onChange={text => setSearchText(text)}
placeholder={t`Search resources`}
/>
<... | Add a comment explaining why you don't set onDelete and onRename here. | const checkMissingPaths = React.useCallback(
() => {
const resourcesManager = project.getResourcesManager();
const resourceNames = resourcesManager
.getAllResourceNames()
.toJSArray();
const newResourcesWithErrors = {};
resourceNames.forEach(... | @@ -257,9 +264,32 @@ const ResourcesList = React.memo<Props, ResourcesListInterface>(
[project, forceUpdateList]
);
+ const keyboardShortcutsRef = React.useRef<KeyboardShortcuts>(
+ new KeyboardShortcuts({
+ shortcutCallbacks: {}, | newIDE/app/src/ResourcesList/index.js | 26 | JavaScript | 0.286 | suggestion | 70 | 51 | 51 | false | QoL Resource tab with shortcuts | 8,115 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesList/index.js
PR Title: QoL Resource tab with shortcuts
BEFORE CODE:
return (
<Background>
<Line>
<Column expand>
<SearchBar
value={searchText}
onReq... | Add a comment explaining why you don't set onDelete and onRename here. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
export default class ResourcesEditor extends React.Component<Props, State> {
static defaultProps = {
setToolbar: () => {},
};
resourceExternallyChangedCallbackId: ?string;
editorMosaic: ?EditorMosaicInterface = null;
_propertiesEditor: ?ResourcePropertiesEditorInterface = null;
_resourcesList: ?Resource... | As written in another comment, it could be the ResourcesList that take care of this. A good LLM model could probably find the best way to do it. |
export default class ResourcesEditor extends React.Component<Props, State> {
// $FlowFixMe[missing-local-annot]
static defaultProps = {
setToolbar: () => {},
};
resourceExternallyChangedCallbackId: ?string;
editorMosaic: ?EditorMosaicInterface = null;
_propertiesEditor: ?ResourcePropertiesEditorInterfa... | @@ -84,12 +84,43 @@ export default class ResourcesEditor extends React.Component<Props, State> {
this.onResourceExternallyChanged.bind(this)
);
}
+
componentWillUnmount() {
unregisterOnResourceExternallyChangedCallback(
this.resourceExternallyChangedCallbackId
);
}
+ _onKeyDown ... | newIDE/app/src/ResourcesEditor/index.js | 26 | JavaScript | 0.429 | suggestion | 144 | 51 | 51 | false | QoL Resource tab with shortcuts | 8,115 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesEditor/index.js
PR Title: QoL Resource tab with shortcuts
BEFORE CODE: export default class ResourcesEditor extends React.Component<Props, State> {
static defaultProps = {
setToolbar: () => {},
};
resourceExternallyChanged... | As written in another comment, it could be the ResourcesList that take care of this. A good LLM model could probably find the best way to do it. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
_('y position of spine _PARAM1_ point attachment for _PARAM2_ slot'),
_('Animations and images'),
'JsPlatform/Extensions/spine.svg'
)
.addParameter('object', _('Spine'), 'SpineObject')
.addParameter('string', _('Attachment name'))
.addParameter('string', _('Slot name (use... | Is there any chance we can make this a `yesorno` boolean parameter? Same for the other conditions? | 'JsPlatform/Extensions/spine.svg'
)
.addParameter('object', _('Spine'), 'SpineObject')
.addParameter('string', _('Attachment name'))
.addParameter('string', _('Slot name (use "" if names are the same)'))
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
.... | @@ -106,6 +106,60 @@ module.exports = {
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
.setFunctionName('getPointAttachmentY');
+ object
+ .addExpressionAndCondition(
+ 'number',
+ 'PointAttachmentScaleX',
+ _('Point attachment scale X position'),
+ ... | Extensions/Spine/JsExtension.js | 26 | JavaScript | 0.357 | question | 98 | 51 | 51 | false | Add point attachment rotation and scale expression for spine | 8,125 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: JavaScript
File: Extensions/Spine/JsExtension.js
PR Title: Add point attachment rotation and scale expression for spine
BEFORE CODE: _('y position of spine _PARAM1_ point attachment for _PARAM2_ slot'),
_('Animations and images'),
'JsPlatform/Extens... | Is there any chance we can make this a `yesorno` boolean parameter? Same for the other conditions? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
clipboardContent,
'actionsCount'
);
if (actionsCount === null) return false;
return actionsCount > 0;
};
export const copySelectionToClipboard = (selection: SelectionState) => {
const eventsList = new gd.EventsList();
const actionsList = new gd.InstructionsList();
const conditionsList = new gd.Ins... | Not sure if useful, but could you use contains:
https://github.com/4ian/GDevelop/blob/6377ece6f97ec3dc4d323066afdab8b28ff82ea6/Core/GDCore/Events/EventsList.h#L138-L144
(maybe not because you don't have an EventsList). | clipboardContent,
'actionsCount'
);
if (actionsCount === null) return false;
return actionsCount > 0;
};
const addAllSubEvents = (
event: gdBaseEvent,
events: Set<gdBaseEvent>
): void => {
const subEvents = event.getSubEvents();
for (let i = 0; i < subEvents.getEventsCount(); i++) {
const su... | @@ -56,12 +56,43 @@ export const hasClipboardActions = () => {
return actionsCount > 0;
};
+const addAllSubEvents = (
+ event: gdBaseEvent,
+ events: Set<gdBaseEvent>
+): void => {
+ const subEvents = event.getSubEvents();
+ for (let i = 0; i < subEvents.getEventsCount(); i++) {
+ const subEvent = subEvent... | newIDE/app/src/EventsSheet/ClipboardKind.js | 26 | JavaScript | 0.5 | suggestion | 221 | 51 | 51 | false | Fix duplicated pasted events when the selection contains an event and its sub-events | 8,155 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsSheet/ClipboardKind.js
PR Title: Fix duplicated pasted events when the selection contains an event and its sub-events
BEFORE CODE: clipboardContent,
'actionsCount'
);
if (actionsCount === null) return false;
return actio... | Not sure if useful, but could you use contains:
https://github.com/4ian/GDevelop/blob/6377ece6f97ec3dc4d323066afdab8b28ff82ea6/Core/GDCore/Events/EventsList.h#L138-L144
(maybe not because you don't have an EventsList). | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
.slice(1)
.split(/(?=[A-Z])/)
.join(' ')
);
};
const getDescription = () => propertyDescription;
const getEndAdornment = (instance: Instance) => {
const property = getProperties(instance).get(name);
const measurementUnit = property.getMeasurementUnit();
return {
label... | @D8H what if the default value is 0? This will be falsy. | .slice(1)
.split(/(?=[A-Z])/)
.join(' ')
);
};
const getDescription = () => propertyDescription;
const getEndAdornment = (instance: Instance) => {
const property = getProperties(instance).get(name);
const measurementUnit = property.getMeasurementUnit();
return {
label... | @@ -67,6 +68,26 @@ const createField = (
),
};
};
+ const defaultValueNumber = defaultValue
+ ? parseFloat(defaultValue) || 0
+ : null;
+ const getValue = (instance: Instance): number =>
+ getNumberValue(instance, name);
+ const getEndAdornmentIcon = defaultValueNumber | newIDE/app/src/PropertiesEditor/PropertiesMapToSchema.js | 26 | JavaScript | 0.214 | suggestion | 56 | 51 | 51 | false | Add a button to reset properties to their default values | 8,163 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/PropertiesEditor/PropertiesMapToSchema.js
PR Title: Add a button to reset properties to their default values
BEFORE CODE: .slice(1)
.split(/(?=[A-Z])/)
.join(' ')
);
};
const getDescription = () => propertyDes... | @D8H what if the default value is 0? This will be falsy. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const measurementUnit = property.getMeasurementUnit();
return {
label: getMeasurementUnitShortLabel(measurementUnit),
tooltipContent: (
<MeasurementUnitDocumentation
label={measurementUnit.getLabel()}
description={measurementUnit.getDescription()}
elementsWithWo... | It's strange to see a setValue that calls a setNumberValue, because who tells us that this is a number field?
I would rather put this inside the `if (valueType === 'number')` branch? | const measurementUnit = property.getMeasurementUnit();
return {
label: getMeasurementUnitShortLabel(measurementUnit),
tooltipContent: (
<MeasurementUnitDocumentation
label={measurementUnit.getLabel()}
description={measurementUnit.getDescription()}
elementsWithWo... | @@ -67,6 +68,26 @@ const createField = (
),
};
};
+ const defaultValueNumber = defaultValue
+ ? parseFloat(defaultValue) || 0
+ : null;
+ const getValue = (instance: Instance): number =>
+ getNumberValue(instance, name);
+ const getEndAdornmentIcon = defaultValueNumber
+ ? (instance: gdIni... | newIDE/app/src/PropertiesEditor/PropertiesMapToSchema.js | 26 | JavaScript | 0.714 | question | 182 | 51 | 51 | false | Add a button to reset properties to their default values | 8,163 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/PropertiesEditor/PropertiesMapToSchema.js
PR Title: Add a button to reset properties to their default values
BEFORE CODE: const measurementUnit = property.getMeasurementUnit();
return {
label: getMeasurementUnitShortLabel(measu... | It's strange to see a setValue that calls a setNumberValue, because who tells us that this is a number field?
I would rather put this inside the `if (valueType === 'number')` branch? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (valueType === 'number') {
const defaultValueNumber =
defaultValue !== null ? parseFloat(defaultValue) || 0 : null;
const getValue = (instance: Instance): number =>
getNumberValue(instance, name);
const getEndAdornmentIcon =
defaultValueNumber !== null
? (instance: gdInitialIn... | ```suggestion
getValue,
``` | if (valueType === 'number') {
const defaultValueNumber =
defaultValue !== null ? parseFloat(defaultValue) || 0 : null;
const getValue = (instance: Instance): number =>
getNumberValue(instance, name);
const getEndAdornmentIcon =
defaultValueNumber !== null
? (instance: gdInitialIn... | @@ -75,14 +76,33 @@ const createField = (
const valueType = property.getType().toLowerCase();
if (valueType === 'number') {
+ const defaultValueNumber =
+ defaultValue !== null ? parseFloat(defaultValue) || 0 : null;
+ const getValue = (instance: Instance): number =>
+ getNumberValue(instance, n... | newIDE/app/src/PropertiesEditor/PropertiesMapToSchema.js | 26 | JavaScript | 0.429 | suggestion | 33 | 51 | 51 | false | Add a button to reset properties to their default values | 8,163 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/PropertiesEditor/PropertiesMapToSchema.js
PR Title: Add a button to reset properties to their default values
BEFORE CODE: if (valueType === 'number') {
const defaultValueNumber =
defaultValue !== null ? parseFloat(defaultValue) |... | ```suggestion
getValue,
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
export type InstancesEditorSettings = {|
/** Is grid shown? */
grid: boolean,
gridType: 'isometric' | 'rectangular',
gridWidth: number,
gridHeight: number,
gridDepth: number,
gridOffsetX: number,
gridOffsetY: number,
gridOffsetZ: number,
gridColor: number,
gridAlpha: number,
/** Is snap to grid... | Could as well remove this comment | export type InstancesEditorSettings = {|
/** Is grid shown? */
grid: boolean,
gridType: 'isometric' | 'rectangular',
gridWidth: number,
gridHeight: number,
gridDepth: number,
gridOffsetX: number,
gridOffsetY: number,
gridOffsetZ: number,
gridColor: number,
gridAlpha: number,
/** Is snap to grid... | @@ -25,6 +25,9 @@ export type InstancesEditorSettings = {|
/** The name of the layer selected to place instances on. */
selectedLayer: string,
+
+ /** The game editor mode: 'embedded-game' or 'instances-editor' */ | newIDE/app/src/InstancesEditor/InstancesEditorSettings.js | 26 | JavaScript | 0.143 | refactor | 33 | 51 | 51 | false | Save Editor Mode (2D/3D) per scene instead of globally | 8,169 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InstancesEditor/InstancesEditorSettings.js
PR Title: Save Editor Mode (2D/3D) per scene instead of globally
BEFORE CODE: export type InstancesEditorSettings = {|
/** Is grid shown? */
grid: boolean,
gridType: 'isometric' | 'rectangular... | Could as well remove this comment | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
#include "BehaviorPropertyRenamer.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/IDE/WholeProjectRefactorer.h"
#include "GDCore/Project/Behavior.h"
#include "GDCore/Project/Object.h"
#include "GDCore/P... | Any reason why implementing this empty is useful? | #include "BehaviorPropertyRenamer.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/Extensions/PlatformExtension.h"
#include "GDCore/IDE/WholeProjectRefactorer.h"
#include "GDCore/Project/Behavior.h"
#include "GDCore/Project/Object.h"
#include "GDCore/P... | @@ -0,0 +1,23 @@
+#include "BehaviorPropertyRenamer.h"
+
+#include "GDCore/Events/Instruction.h"
+#include "GDCore/Extensions/Metadata/MetadataProvider.h"
+#include "GDCore/Extensions/PlatformExtension.h"
+#include "GDCore/IDE/WholeProjectRefactorer.h"
+#include "GDCore/Project/Behavior.h"
+#include "GDCore/Project/Obj... | Core/GDCore/IDE/Events/BehaviorPropertyRenamer.cpp | 13 | C++ | 0.143 | question | 49 | 24 | 22 | false | Fix property value loss when renaming a property in the extension editor | 8,211 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/Events/BehaviorPropertyRenamer.cpp
PR Title: Fix property value loss when renaming a property in the extension editor
BEFORE CODE: #include "BehaviorPropertyRenamer.h"
#include "GDCore/Events/Instruction.h"
#include "GDCore/Extensions/Metadata/Me... | Any reason why implementing this empty is useful? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import * as React from 'react';
import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
import GenericIconPreview from './GenericIconPreview';
import Music from '../../UI/CustomSvgIcons/Music';
type Props = {|
resourceName: string,
audioResourceSource: string,
|};
const AudioPrevie... | useless comment
```suggestion
``` | // @flow
import * as React from 'react';
import SoundPlayer from '../../UI/SoundPlayer';
import GenericIconPreview from './GenericIconPreview';
import Music from '../../UI/CustomSvgIcons/Music';
type Props = {|
resourceName: string,
audioResourceSource: string,
|};
const AudioPreview = ({ resourceName, audioResou... | @@ -0,0 +1,41 @@
+// @flow
+import * as React from 'react';
+import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
+import GenericIconPreview from './GenericIconPreview';
+import Music from '../../UI/CustomSvgIcons/Music';
+
+type Props = {|
+ resourceName: string,
+ audioResourceSource: stri... | newIDE/app/src/ResourcesList/ResourcePreview/AudioPreview.js | 17 | JavaScript | 0.5 | suggestion | 33 | 42 | 39 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesList/ResourcePreview/AudioPreview.js
PR Title: Add audio preview in resources
BEFORE CODE: // @flow
import * as React from 'react';
import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
import GenericIconPre... | useless comment
```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import * as React from 'react';
import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
import GenericIconPreview from './GenericIconPreview';
import Music from '../../UI/CustomSvgIcons/Music';
type Props = {|
resourceName: string,
audioResourceSource: string,
|};
const AudioPrevie... | Would probably be worth showing something but that's ok for now. | // @flow
import * as React from 'react';
import SoundPlayer from '../../UI/SoundPlayer';
import GenericIconPreview from './GenericIconPreview';
import Music from '../../UI/CustomSvgIcons/Music';
type Props = {|
resourceName: string,
audioResourceSource: string,
|};
const AudioPreview = ({ resourceName, audioResou... | @@ -0,0 +1,41 @@
+// @flow
+import * as React from 'react';
+import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
+import GenericIconPreview from './GenericIconPreview';
+import Music from '../../UI/CustomSvgIcons/Music';
+
+type Props = {|
+ resourceName: string,
+ audioResourceSource: stri... | newIDE/app/src/ResourcesList/ResourcePreview/AudioPreview.js | 24 | JavaScript | 0.214 | suggestion | 64 | 42 | 39 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesList/ResourcePreview/AudioPreview.js
PR Title: Add audio preview in resources
BEFORE CODE: // @flow
import * as React from 'react';
import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
import GenericIconPre... | Would probably be worth showing something but that's ok for now. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import * as React from 'react';
import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
import GenericIconPreview from './GenericIconPreview';
import Music from '../../UI/CustomSvgIcons/Music';
type Props = {|
resourceName: string,
audioResourceSource: string,
|};
const AudioPrevie... | This ref is unused -> remove it.
```suggestion
``` | // @flow
import * as React from 'react';
import SoundPlayer from '../../UI/SoundPlayer';
import GenericIconPreview from './GenericIconPreview';
import Music from '../../UI/CustomSvgIcons/Music';
type Props = {|
resourceName: string,
audioResourceSource: string,
|};
const AudioPreview = ({ resourceName, audioResou... | @@ -0,0 +1,41 @@
+// @flow
+import * as React from 'react';
+import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
+import GenericIconPreview from './GenericIconPreview';
+import Music from '../../UI/CustomSvgIcons/Music';
+
+type Props = {|
+ resourceName: string,
+ audioResourceSource: stri... | newIDE/app/src/ResourcesList/ResourcePreview/AudioPreview.js | 13 | JavaScript | 0.643 | suggestion | 50 | 38 | 38 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ResourcesList/ResourcePreview/AudioPreview.js
PR Title: Add audio preview in resources
BEFORE CODE: // @flow
import * as React from 'react';
import SoundPlayer, { type SoundPlayerInterface } from '../../UI/SoundPlayer';
import GenericIconPre... | This ref is unused -> remove it.
```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
|};
export type CompactSoundPlayerInterface = {|
playPause: (forcePlay: boolean) => void,
|};
const CompactSoundPlayer = React.forwardRef<Props, CompactSoundPlayerInterface>(
({ soundSrc, onSoundLoaded, onSoundError }, ref) => {
const mobileAudioRef = React.useRef<?Audio>(null);
const [isPlaying, setIsPla... | Looks useless? The ref is not used in this function. No reason not to do the rest. | onSoundLoaded?: () => void,
onSoundError?: () => void,
|};
const CompactSoundPlayer = ({
soundSrc,
onSoundLoaded,
onSoundError,
}: Props) => {
const audioRef = React.useRef<?HTMLAudioElement>(null);
const [isPlaying, setIsPlaying] = React.useState(false);
const [isLoading, setIsLoading] = React.useStat... | @@ -0,0 +1,91 @@
+// @flow
+
+import * as React from 'react';
+import IconButton from '@material-ui/core/IconButton';
+import Play from '../CustomSvgIcons/Play';
+import Pause from '../CustomSvgIcons/Pause';
+
+type Props = {|
+ soundSrc: string | null,
+ onSoundLoaded?: () => void,
+ onSoundError?: () => void,
+|};... | newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js | 26 | JavaScript | 0.286 | suggestion | 82 | 51 | 51 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js
PR Title: Add audio preview in resources
BEFORE CODE: |};
export type CompactSoundPlayerInterface = {|
playPause: (forcePlay: boolean) => void,
|};
const CompactSoundPlayer = React.forwardRef<Props, C... | Looks useless? The ref is not used in this function. No reason not to do the rest. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const mobileAudioRef = React.useRef<?Audio>(null);
const [isPlaying, setIsPlaying] = React.useState(false);
const onPlayPause = React.useCallback(
(forcePlay?: boolean) => {
if (!soundSrc) return;
setIsPlaying(_isPlaying => forcePlay || !_isPlaying);
},
[soundSrc]
);
... | You only use onPlayPause in this file. No reason to expose it to the outside world.
```suggestion
``` | }: Props) => {
const audioRef = React.useRef<?HTMLAudioElement>(null);
const [isPlaying, setIsPlaying] = React.useState(false);
const [isLoading, setIsLoading] = React.useState(false);
const [isAudioLoaded, setIsAudioLoaded] = React.useState(false);
const isMountedRef = useIsMounted();
const abortController... | @@ -0,0 +1,91 @@
+// @flow
+
+import * as React from 'react';
+import IconButton from '@material-ui/core/IconButton';
+import Play from '../CustomSvgIcons/Play';
+import Pause from '../CustomSvgIcons/Pause';
+
+type Props = {|
+ soundSrc: string | null,
+ onSoundLoaded?: () => void,
+ onSoundError?: () => void,
+|};... | newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js | 26 | JavaScript | 0.786 | suggestion | 102 | 51 | 51 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js
PR Title: Add audio preview in resources
BEFORE CODE: const mobileAudioRef = React.useRef<?Audio>(null);
const [isPlaying, setIsPlaying] = React.useState(false);
const onPlayPause = React.use... | You only use onPlayPause in this file. No reason to expose it to the outside world.
```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import * as React from 'react';
import IconButton from '@material-ui/core/IconButton';
import Play from '../CustomSvgIcons/Play';
import Pause from '../CustomSvgIcons/Pause';
type Props = {|
soundSrc: string | null,
onSoundLoaded?: () => void,
onSoundError?: () => void,
|};
export type CompactSoundPla... | Interface "playPause" is used nowhere by other components, so no need to complexify the component.
```suggestion
const CompactSoundPlayer = ({ soundSrc, onSoundLoaded, onSoundError }: Props) => {
``` | // @flow
import * as React from 'react';
import IconButton from '@material-ui/core/IconButton';
import CircularProgress from '@material-ui/core/CircularProgress';
import Play from '../CustomSvgIcons/Play';
import Pause from '../CustomSvgIcons/Pause';
import { useIsMounted } from '../../Utils/UseIsMounted';
type Props... | @@ -0,0 +1,91 @@
+// @flow
+
+import * as React from 'react';
+import IconButton from '@material-ui/core/IconButton';
+import Play from '../CustomSvgIcons/Play';
+import Pause from '../CustomSvgIcons/Pause';
+
+type Props = {|
+ soundSrc: string | null,
+ onSoundLoaded?: () => void,
+ onSoundError?: () => void,
+|};... | newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js | 19 | JavaScript | 1 | suggestion | 200 | 44 | 44 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js
PR Title: Add audio preview in resources
BEFORE CODE: // @flow
import * as React from 'react';
import IconButton from '@material-ui/core/IconButton';
import Play from '../CustomSvgIcons/Play';
import Pau... | Interface "playPause" is used nowhere by other components, so no need to complexify the component.
```suggestion
const CompactSoundPlayer = ({ soundSrc, onSoundLoaded, onSoundError }: Props) => {
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
() => {
if (!mobileAudioRef.current) return;
if (onSoundLoaded) onSoundLoaded();
},
[onSoundLoaded]
);
React.useImperativeHandle(ref, () => ({
playPause: onPlayPause,
}));
React.useEffect(
() => {
if (!mobileAudioRef.current) return;
if (is... | This will force the browser to load the audio source anytime the button is displayed. For a large game/long session, this means the browser may have to load dozens of audio files, wasting computing and network.
Can you adapt this component so that it only load the audio file when play is pressed?
- Default state: no... | audioRef.current = null;
abortControllerRef.current = null;
setIsPlaying(false);
setIsLoading(false);
setIsAudioLoaded(false);
}, []);
const initializeAudio = React.useCallback(
() => {
if (!soundSrc || audioRef.current) return;
setIsLoading(true);
const audio = new Audio... | @@ -0,0 +1,91 @@
+// @flow
+
+import * as React from 'react';
+import IconButton from '@material-ui/core/IconButton';
+import Play from '../CustomSvgIcons/Play';
+import Pause from '../CustomSvgIcons/Pause';
+
+type Props = {|
+ soundSrc: string | null,
+ onSoundLoaded?: () => void,
+ onSoundError?: () => void,
+|};... | newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js | 26 | JavaScript | 0.786 | suggestion | 766 | 51 | 51 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js
PR Title: Add audio preview in resources
BEFORE CODE: () => {
if (!mobileAudioRef.current) return;
if (onSoundLoaded) onSoundLoaded();
},
[onSoundLoaded]
);
Reac... | This will force the browser to load the audio source anytime the button is displayed. For a large game/long session, this means the browser may have to load dozens of audio files, wasting computing and network.
Can you adapt this component so that it only load the audio file when play is pressed?
- Default state: no... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// @flow
import * as React from 'react';
import IconButton from '@material-ui/core/IconButton';
import Play from '../CustomSvgIcons/Play';
import Pause from '../CustomSvgIcons/Pause';
type Props = {|
soundSrc: string | null,
onSoundLoaded?: () => void,
onSoundError?: () => void,
|};
export type CompactSoundPla... | ```suggestion
const audioRef = React.useRef<?Audio>(null);
```
No reason to add "mobile" in the name, this is confusing for the reader. | // @flow
import * as React from 'react';
import IconButton from '@material-ui/core/IconButton';
import CircularProgress from '@material-ui/core/CircularProgress';
import Play from '../CustomSvgIcons/Play';
import Pause from '../CustomSvgIcons/Pause';
import { useIsMounted } from '../../Utils/UseIsMounted';
type Props... | @@ -0,0 +1,91 @@
+// @flow
+
+import * as React from 'react';
+import IconButton from '@material-ui/core/IconButton';
+import Play from '../CustomSvgIcons/Play';
+import Pause from '../CustomSvgIcons/Pause';
+
+type Props = {|
+ soundSrc: string | null,
+ onSoundLoaded?: () => void,
+ onSoundError?: () => void,
+|};... | newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js | 20 | JavaScript | 0.929 | suggestion | 140 | 45 | 45 | false | Add audio preview in resources | 8,219 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/UI/SoundPlayer/CompactSoundPlayer.js
PR Title: Add audio preview in resources
BEFORE CODE: // @flow
import * as React from 'react';
import IconButton from '@material-ui/core/IconButton';
import Play from '../CustomSvgIcons/Play';
import Pau... | ```suggestion
const audioRef = React.useRef<?Audio>(null);
```
No reason to add "mobile" in the name, this is confusing for the reader. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
[forceUpdate]
);
const scrollToItem = React.useCallback((itemId: string) => {
if (treeViewRef.current) {
treeViewRef.current.scrollToItemFromId(itemId);
}
}, []);
React.useImperativeHandle(ref, () => ({
forceUpdateList: () => {
forceUpdate();
if (treeVie... | ```suggestion
const itemId = getLayerTreeViewItemId(layer);
``` | [forceUpdate]
);
const scrollToItem = React.useCallback((itemId: string) => {
if (treeViewRef.current) {
treeViewRef.current.scrollToItemFromId(itemId);
}
}, []);
React.useImperativeHandle(ref, () => ({
forceUpdateList: () => {
forceUpdate();
if (treeVie... | @@ -335,7 +335,15 @@ const LayersList = React.forwardRef<Props, LayersListInterface>(
}));
const editName = React.useCallback(
- (itemId: string) => {
+ (layerName: string) => {
+ // Don't allow renaming base layer (empty name)
+ if (!layerName) return;
+
+ // Find the layer I... | newIDE/app/src/LayersList/index.js | 26 | JavaScript | 0.571 | suggestion | 71 | 51 | 51 | false | Avoid crash when renaming with F2 to edit "Base layer" | 8,222 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/LayersList/index.js
PR Title: Avoid crash when renaming with F2 to edit "Base layer"
BEFORE CODE: [forceUpdate]
);
const scrollToItem = React.useCallback((itemId: string) => {
if (treeViewRef.current) {
treeViewR... | ```suggestion
const itemId = getLayerTreeViewItemId(layer);
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
() => {
forceUpdate();
if (treeViewRef.current) treeViewRef.current.forceUpdateList();
},
[forceUpdate]
);
const scrollToItem = React.useCallback((itemId: string) => {
if (treeViewRef.current) {
treeViewRef.current.scrollToItemFromId(itemId);
}
}, []);
... | While the first comment is ok (it gives an information), this one is just telling exactly what the lines of codes are doing. So the code is already sufficient => remove it.
```suggestion
``` | () => {
forceUpdate();
if (treeViewRef.current) treeViewRef.current.forceUpdateList();
},
[forceUpdate]
);
const scrollToItem = React.useCallback((itemId: string) => {
if (treeViewRef.current) {
treeViewRef.current.scrollToItemFromId(itemId);
}
}, []);
... | @@ -335,7 +335,15 @@ const LayersList = React.forwardRef<Props, LayersListInterface>(
}));
const editName = React.useCallback(
- (itemId: string) => {
+ (layerName: string) => {
+ // Don't allow renaming base layer (empty name)
+ if (!layerName) return;
+
+ // Find the layer I... | newIDE/app/src/LayersList/index.js | 26 | JavaScript | 0.786 | suggestion | 190 | 51 | 51 | false | Avoid crash when renaming with F2 to edit "Base layer" | 8,222 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/LayersList/index.js
PR Title: Avoid crash when renaming with F2 to edit "Base layer"
BEFORE CODE: () => {
forceUpdate();
if (treeViewRef.current) treeViewRef.current.forceUpdateList();
},
[forceUpdate]
)... | While the first comment is ok (it gives an information), this one is just telling exactly what the lines of codes are doing. So the code is already sufficient => remove it.
```suggestion
``` | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
if (treeViewRef.current) treeViewRef.current.forceUpdateList();
},
[forceUpdate]
);
const scrollToItem = React.useCallback((itemId: string) => {
if (treeViewRef.current) {
treeViewRef.current.scrollToItemFromId(itemId);
}
}, []);
React.useImperativeHandle(ref, (... | Check the type or even the C++ code: the layer will never be null. This is a difference compared to JS libraries (which are indeed often returning null when something does not exist. But we can't do it in C++ converted to JS).
To save you from a crash, the C++ will return a "bad layer" (i.e: an empty layer) in case you... | if (treeViewRef.current) treeViewRef.current.forceUpdateList();
},
[forceUpdate]
);
const scrollToItem = React.useCallback((itemId: string) => {
if (treeViewRef.current) {
treeViewRef.current.scrollToItemFromId(itemId);
}
}, []);
React.useImperativeHandle(ref, (... | @@ -335,7 +335,15 @@ const LayersList = React.forwardRef<Props, LayersListInterface>(
}));
const editName = React.useCallback(
- (itemId: string) => {
+ (layerName: string) => {
+ // Don't allow renaming base layer (empty name)
+ if (!layerName) return;
+
+ // Find the layer I... | newIDE/app/src/LayersList/index.js | 26 | JavaScript | 0.929 | bug | 516 | 51 | 51 | false | Avoid crash when renaming with F2 to edit "Base layer" | 8,222 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Bouh | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/LayersList/index.js
PR Title: Avoid crash when renaming with F2 to edit "Base layer"
BEFORE CODE: if (treeViewRef.current) treeViewRef.current.forceUpdateList();
},
[forceUpdate]
);
const scrollToItem = React.use... | Check the type or even the C++ code: the layer will never be null. This is a difference compared to JS libraries (which are indeed often returning null when something does not exist. But we can't do it in C++ converted to JS).
To save you from a crash, the C++ will return a "bad layer" (i.e: an empty layer) in case you... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
const spineResourceName = spineConfiguration.getSpineResourceName();
if (!spineResourceName) {
setSkinNames([]);
return;
}
let cancelled = false;
(async () => {
const spineData = await PixiResourcesLoader.getSpineData(
project,
... | Can you enter a comment explaining what is not listed and why this is not a problem? | const spineResourceName = spineConfiguration.getSpineResourceName();
if (!spineResourceName) {
setSkinNames([]);
return;
}
let cancelled = false;
(async () => {
const spineData = await PixiResourcesLoader.getSpineData(
project,
... | @@ -0,0 +1,144 @@
+// @flow
+import * as React from 'react';
+import { t } from '@lingui/macro';
+import GenericExpressionField from './GenericExpressionField';
+import {
+ type ParameterFieldProps,
+ type ParameterFieldInterface,
+ type FieldFocusFunction,
+} from './ParameterFieldCommons';
+import { getLastObjectP... | newIDE/app/src/EventsSheet/ParameterFields/ObjectSkinNameField.js | 26 | JavaScript | 0.214 | question | 84 | 51 | 51 | false | feat: Add support for skin management in Spine objects | 8,229 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsSheet/ParameterFields/ObjectSkinNameField.js
PR Title: feat: Add support for skin management in Spine objects
BEFORE CODE: const spineResourceName = spineConfiguration.getSpineResourceName();
if (!spineResourceName) {
... | Can you enter a comment explaining what is not listed and why this is not a problem? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
setSpineData(spineData);
if (spineData.skeleton) {
setSourceSelectOptions(
spineData.skeleton.animations.map(animation => (
<SelectOption
key={animation.name}
value={animation.name}
label={animation.name}
... | Nitpicking, but I find it weird to list like this the functions/variables using @. This looks like JSDoc but isn't and is not standard.
It seems rather that you're trying to group things together (which is a great idea!) and in this case a custom hook "useSpineSkin" might do the trick (I'm not 100% sure a hook is real... |
setSpineData(spineData);
if (spineData.skeleton) {
setSourceSelectOptions(
spineData.skeleton.animations.map(animation => (
<SelectOption
key={animation.name}
value={animation.name}
label={animation.name}
... | @@ -139,6 +139,49 @@ const SpineEditor = ({
[project, spineResourceName, setSourceSelectOptions]
);
+ /**
+ * Manage Spine skins
+ *
+ * @skinsSelectOptionsList - evaluated skins list from spineData.skeleton
+ * @skinName - current used skinName (in the first open - is "" empty string, because the ne... | newIDE/app/src/ObjectEditor/Editors/SpineEditor.js | 26 | JavaScript | 0.5 | nitpick | 438 | 51 | 51 | false | feat: Add support for skin management in Spine objects | 8,229 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ViktorVovk | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ObjectEditor/Editors/SpineEditor.js
PR Title: feat: Add support for skin management in Spine objects
BEFORE CODE:
setSpineData(spineData);
if (spineData.skeleton) {
setSourceSelectOptions(
spineData.sk... | Nitpicking, but I find it weird to list like this the functions/variables using @. This looks like JSDoc but isn't and is not standard.
It seems rather that you're trying to group things together (which is a great idea!) and in this case a custom hook "useSpineSkin" might do the trick (I'm not 100% sure a hook is real... | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
}
// Stop any existing server for this window
if (existingServer && existingServer.serverInstance) {
existingServer.serverInstance.shutdown().catch(() => {
// Ignore shutdown errors
});
}
getAvailablePort(2929, 4000).then(
port => {
const serverParams = {
... | Out of caution, can you add a try catch around this so that if URL throws it still works (url will be unchanged)? | }
// Stop any existing server for this window
if (existingServer && existingServer.serverInstance) {
existingServer.serverInstance.shutdown().catch(() => {
// Ignore shutdown errors
});
}
getAvailablePort(2929, 4000).then(
port => {
const serverParams = {
... | @@ -38,6 +38,17 @@ module.exports = {
// be used - and the user can still reload manually on its browser.
watch: [],
middleware: [
+ // Handle requests with query parameters by serving index.html
+ // This ensures URLs like http://localhost:2929/?i=123 work correct... | newIDE/electron-app/app/ServeFolder.js | 26 | JavaScript | 0.429 | question | 113 | 51 | 51 | false | Fix url params not handled when doinga preview over network | 8,285 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/electron-app/app/ServeFolder.js
PR Title: Fix url params not handled when doinga preview over network
BEFORE CODE: }
// Stop any existing server for this window
if (existingServer && existingServer.serverInstance) {
existingServer... | Out of caution, can you add a try catch around this so that if URL throws it still works (url will be unchanged)? | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
// Initialize keyboard shortcuts as empty.
// onDelete callback is set outside because it deletes the selected
// item (that is a props). As it is stored in a ref, the keyboard shortcut
// instance does not update with selectedItems changes.
const keyboardShortcutsRef = React.useRef<KeyboardShortcu... | It may be safer to keep the base layer check where is was initially. | ? createLayerItem(selectedLayer)
: null;
return selectedItem ? [selectedItem] : [];
},
[createLayerItem, selectedLayer]
);
// Initialize keyboard shortcuts as empty.
// onDelete callback is set outside because it deletes the selected
// item (that is a props). As... | @@ -575,13 +568,18 @@ const LayersList = React.forwardRef<Props, LayersListInterface>(
}
});
keyboardShortcutsRef.current.setShortcutCallback('onRename', () => {
- if (selectedItems.length > 0) {
+ // Don't allow renaming base layer (empty name)
+ if (... | newIDE/app/src/LayersList/index.js | 26 | JavaScript | 0.214 | suggestion | 68 | 51 | 51 | false | Fix being able to rename a layer with shortcut | 8,309 | 4ian/GDevelop | 10,154 | JavaScript | D8H | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/LayersList/index.js
PR Title: Fix being able to rename a layer with shortcut
BEFORE CODE:
// Initialize keyboard shortcuts as empty.
// onDelete callback is set outside because it deletes the selected
// item (that is a props). ... | It may be safer to keep the base layer check where is was initially. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
};
}
if (objectType === 'PanelSpriteObject::PanelSprite') {
const config = gd.asPanelSpriteConfiguration(objectConfiguration);
const width = config.getWidth();
const height = config.getHeight();
return {
size: `${width}x${height}`,
origin: '0;0',
center: `${width / 2};${height... | @codex This origin is false because it depends on min/max X/Y/Z (for example if minX = -10, the origin is actually at 10)
Can you also adapt this for 3D objects (IsRenderedIn3D)?
And adapt the tests to add a test case with a non 0;0 origin and another test case for 3D events based objects | };
}
if (objectType === 'PanelSpriteObject::PanelSprite') {
const config = gd.asPanelSpriteConfiguration(objectConfiguration);
const width = config.getWidth();
const height = config.getHeight();
return {
size: `${width}x${height}`,
origin: '0;0',
center: `${width / 2};${height... | @@ -0,0 +1,96 @@
+// @flow
+import { type AssetShortHeader } from '../Utils/GDevelopServices/Asset';
+
+const gd: libGDevelop = global.gd;
+
+/**
+ * Returns size, origin and center for an asset short header.
+ * Returns null for object types where this information cannot be determined statically.
+ */
+export const ge... | newIDE/app/src/EditorFunctions/Utils.js | 26 | JavaScript | 0.5 | suggestion | 290 | 33 | 42 | false | Improve details of center/origin when a common object is created by the AI | 8,322 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EditorFunctions/Utils.js
PR Title: Improve details of center/origin when a common object is created by the AI
BEFORE CODE: };
}
if (objectType === 'PanelSpriteObject::PanelSprite') {
const config = gd.asPanelSpriteConfiguration(... | @codex This origin is false because it depends on min/max X/Y/Z (for example if minX = -10, the origin is actually at 10)
Can you also adapt this for 3D objects (IsRenderedIn3D)?
And adapt the tests to add a test case with a non 0;0 origin and another test case for 3D events based objects | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
object.setUnscaledWidthAndHeight(100, 100);
object.setCustomWidthAndHeight(10, 10);
runtimeScene.addObject(object);
return object;
};
describe('(anchor horizontal edge)', function () {
['rightEdgeAnchor', 'leftEdgeAnchor'].forEach((objectEdge) => {
it(`anchors the ${objectEdge} edge of ob... | No issues found. | object.setUnscaledWidthAndHeight(100, 100);
object.setCustomWidthAndHeight(10, 10);
runtimeScene.addObject(object);
return object;
};
describe('(anchor horizontal edge)', function () {
['rightEdgeAnchor', 'leftEdgeAnchor'].forEach((objectEdge) => {
it(`anchors the ${objectEdge} edge of ob... | @@ -70,6 +70,50 @@ describe('gdjs.AnchorRuntimeBehavior', function () {
return object;
}
+ const createSpriteWithOriginAtCenter = (behaviorProperties) => {
+ const object = new gdjs.TestSpriteRuntimeObject(runtimeScene, {
+ name: 'obj1',
+ type: '',
+ behaviors: [
+ {
+ name... | Extensions/AnchorBehavior/tests/anchorruntimebehavior.spec.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Fix anchor behavior when objects has custom origin | 6,970 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: JavaScript
File: Extensions/AnchorBehavior/tests/anchorruntimebehavior.spec.js
PR Title: Fix anchor behavior when objects has custom origin
BEFORE CODE: object.setUnscaledWidthAndHeight(100, 100);
object.setCustomWidthAndHeight(10, 10);
runtimeScene.addObject(o... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* \brief Return true if the type of the parameter is a number.
* \note If you had a new type of parameter, also add it in the IDE (
* see EventsFunctionParametersEditor, ParameterRenderingService
* and ExpressionAutocompletion) and in the EventsCodeGenerator.
*/
bool IsVariable() const {
return gd:... | No issues found. | * \brief Return true if the type of the parameter is a number.
* \note If you had a new type of parameter, also add it in the IDE (
* see EventsFunctionParametersEditor, ParameterRenderingService
* and ExpressionAutocompletion) and in the EventsCodeGenerator.
*/
bool IsVariable() const {
return gd:... | @@ -111,21 +111,21 @@ class GD_CORE_API ValueTypeMetadata {
* given type.
*/
bool IsNumber() const {
- return gd::ValueTypeMetadata::IsTypeExpression("number", name);
+ return gd::ValueTypeMetadata::IsTypeValue("number", name);
}
/**
* \brief Return true if the type is a string.
*/
b... | Core/GDCore/Extensions/Metadata/ValueTypeMetadata.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Fix mouse and key parameters for event-functions | 7,052 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: C/C++
File: Core/GDCore/Extensions/Metadata/ValueTypeMetadata.h
PR Title: Fix mouse and key parameters for event-functions
BEFORE CODE: * \brief Return true if the type of the parameter is a number.
* \note If you had a new type of parameter, also add it in the IDE (... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
++i) // Some conditions already have a "conditionInverted" parameter
{
if (instrInfos.parameters.GetParameter(i).GetType() == "conditionInverted")
conditionAlreadyTakeCareOfInversion = true;
}
if (!conditionAlreadyTakeCareOfInversion && conditionInverted)
predicate = GenerateNegatedPredicate... | No issues found. | ++i) // Some conditions already have a "conditionInverted" parameter
{
if (instrInfos.parameters.GetParameter(i).GetType() == "conditionInverted")
conditionAlreadyTakeCareOfInversion = true;
}
if (!conditionAlreadyTakeCareOfInversion && conditionInverted)
predicate = GenerateNegatedPredicate... | @@ -204,7 +204,9 @@ gd::String EventsCodeGenerator::GenerateBehaviorEventsFunctionCode(
gd::String fullPreludeCode =
preludeCode + "\n" + "var that = this;\n" +
// runtimeScene is supposed to be always accessible, read
- // it from the behavior
+ // it from the behavior.
+ // TODO: this ... | GDJS/GDJS/Events/CodeGeneration/EventsCodeGenerator.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Fix wait action in custom objects | 7,056 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Review this pull request change.
Language: C++
File: GDJS/GDJS/Events/CodeGeneration/EventsCodeGenerator.cpp
PR Title: Fix wait action in custom objects
BEFORE CODE: ++i) // Some conditions already have a "conditionInverted" parameter
{
if (instrInfos.parameters.GetParameter(i).GetType() == "condition... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
_("the mouse cursor Y position"),
"",
"res/conditions/mouse24.png")
.AddCodeOnlyParameter("currentScene", "")
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
.AddParameter("layer", _... | No issues found. | _("the mouse cursor Y position"),
"",
"res/conditions/mouse24.png")
.AddCodeOnlyParameter("currentScene", "")
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
.AddParameter("layer", _... | @@ -338,6 +338,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
.SetDefaultValue("0");
+ // Deprecated
extension
.AddCondition(
"PopStartedTouch",
@@ -354,6 +355,7 @@ void GD_CORE_A... | Core/GDCore/Extensions/Builtin/MouseExtension.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Add tutorial bubbles on actions replacing deprecated ones | 7,077 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/Extensions/Builtin/MouseExtension.cpp
PR Title: Add tutorial bubbles on actions replacing deprecated ones
BEFORE CODE: _("the mouse cursor Y position"),
"",
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (addInstancesInTheForeground) {
if (
addedInstancesLowestZOrder === null ||
addedInstancesLowestZOrder > instance.getZOrder()
) {
addedInstancesLowestZOrder = instance.getZOrder();
}
}
const newInstance = this._instances
... | No issues found. | if (addInstancesInTheForeground) {
if (
addedInstancesLowestZOrder === null ||
addedInstancesLowestZOrder > instance.getZOrder()
) {
addedInstancesLowestZOrder = instance.getZOrder();
}
}
const newInstance = this._instances
... | @@ -58,45 +58,53 @@ export default class InstancesAdder {
serializedInstances,
preventSnapToGrid = false,
addInstancesInTheForeground = false,
+ doesObjectExistInContext,
}: {|
position: [number, number],
copyReferential: [number, number],
serializedInstances: Array<Object>,
pre... | newIDE/app/src/InstancesEditor/InstancesAdder.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Fix instances paste from a scene to another | 7,105 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/InstancesEditor/InstancesAdder.js
PR Title: Fix instances paste from a scene to another
BEFORE CODE: if (addInstancesInTheForeground) {
if (
addedInstancesLowestZOrder === null ||
addedInstancesLowes... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
// @flow
import * as React from 'react';
export const useDoNowOrAfterRender = <T>(ref: {|
current: T,
|}): (((T) => void) => void) => {
const [
shouldTriggerAfterRender,
setShouldTriggerAfterRender,
] = React.useState<null | (T => void)>(null);
const doNowOrAfterRender = React.useCallback(
(callba... | No issues found. | // @flow
import * as React from 'react';
export const useDoNowOrAfterRender = <T>(ref: {|
current: T,
|}): (((T) => void) => void) => {
const [
shouldTriggerAfterRender,
setShouldTriggerAfterRender,
] = React.useState<null | (T => void)>(null);
const doNowOrAfterRender = React.useCallback(
(callba... | @@ -0,0 +1,34 @@
+// @flow
+import * as React from 'react';
+
+export const useDoNowOrAfterRender = <T>(ref: {|
+ current: T,
+|}): (((T) => void) => void) => {
+ const [
+ shouldTriggerAfterRender,
+ setShouldTriggerAfterRender,
+ ] = React.useState<null | (T => void)>(null);
+
+ const doNowOrAfterRender = R... | newIDE/app/src/Utils/UseDoNowOrAfterRender.js | 0 | JavaScript | 1 | none | 16 | 35 | 35 | true | Fix adding an object from context menu when the Objects panel is closed | 7,107 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/Utils/UseDoNowOrAfterRender.js
PR Title: Fix adding an object from context menu when the Objects panel is closed
BEFORE CODE: // @flow
import * as React from 'react';
export const useDoNowOrAfterRender = <T>(ref: {|
current: T,
|}): (((T)... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
);
setGame(updatedGame);
}
setBuildOrGameUrl(
game
? getGameUrl(game)
: build
? getBuildArtifactUrl(build, 's3Key')
: ''
);
setExportState('succeeded');
} catch (err) {
console.error('Unable to u... | No issues found. | );
setGame(updatedGame);
}
setBuildOrGameUrl(
game
? getGameUrl(game)
: build
? getBuildArtifactUrl(build, 's3Key')
: ''
);
setExportState('succeeded');
} catch (err) {
console.error('Unable to u... | @@ -10,6 +10,10 @@ import { I18n } from '@lingui/react';
import { type Exporter } from '../ExportAndShare/ShareDialog';
import Text from '../UI/Text';
import { type Limits } from '../Utils/GDevelopServices/Usage';
+import {
+ getBuildArtifactUrl,
+ type Build,
+} from '../Utils/GDevelopServices/Build';
import { t... | newIDE/app/src/QuickCustomization/QuickPublish.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Fix issues when reworking a quick customization project | 7,109 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/QuickCustomization/QuickPublish.js
PR Title: Fix issues when reworking a quick customization project
BEFORE CODE: );
setGame(updatedGame);
}
setBuildOrGameUrl(
game
? getGameUrl(game... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
buildMenuTemplate(i18n: I18nType, index: number) {
const {
globalObjectsContainer,
objectsContainer,
expandFolders,
addFolder,
onAddNewObject,
onMovedObjectFolderOrObjectToAnotherFolderInSameContainer,
forceUpdate,
} = this.props;
const container = this._isGlobal... | No issues found. | buildMenuTemplate(i18n: I18nType, index: number) {
const {
globalObjectsContainer,
objectsContainer,
expandFolders,
addFolder,
onAddNewObject,
onMovedObjectFolderOrObjectToAnotherFolderInSameContainer,
forceUpdate,
} = this.props;
const container = this._isGlobal... | @@ -20,6 +20,24 @@ import { type MessageDescriptor } from '../Utils/i18n/MessageDescriptor.flow';
import type { ObjectWithContext } from '../ObjectsList/EnumerateObjects';
import { type HTMLDataset } from '../Utils/HTMLDataset';
+export const expandAllSubfolders = (
+ objectFolder: gdObjectFolderOrObject,
+ isGlo... | newIDE/app/src/ObjectsList/ObjectFolderTreeViewItemContent.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Replace the "add folder" button by a drop-down menu action | 7,117 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ObjectsList/ObjectFolderTreeViewItemContent.js
PR Title: Replace the "add folder" button by a drop-down menu action
BEFORE CODE: buildMenuTemplate(i18n: I18nType, index: number) {
const {
globalObjectsContainer,
objectsCont... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
asset: {},
userData: {},
//@ts-ignore
parser: null,
};
}
}
getResourceKinds(): ResourceKind[] {
return resourceKinds;
}
async processResource(resourceName: string): Promise<void> {
const resource = this._resourceLoader.getResource(resou... | No issues found. | asset: {},
userData: {},
//@ts-ignore
parser: null,
};
}
}
getResourceKinds(): ResourceKind[] {
return resourceKinds;
}
async processResource(resourceName: string): Promise<void> {
const resource = this._resourceLoader.getResource(resou... | @@ -143,5 +143,25 @@ namespace gdjs {
this._loadedThreeModels.getFromName(resourceName) || this._invalidModel
);
}
+
+ /**
+ * To be called when the game is disposed.
+ * Clear the models, resources loaded and destroy 3D models loaders in this manager.
+ */
+ dispose(): void {
+ ... | GDJS/Runtime/Model3DManager.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | Add dispose method to Runtimegame | 7,118 | 4ian/GDevelop | 10,154 | JavaScript | danvervlad | Review this pull request change.
Language: TypeScript
File: GDJS/Runtime/Model3DManager.ts
PR Title: Add dispose method to Runtimegame
BEFORE CODE: asset: {},
userData: {},
//@ts-ignore
parser: null,
};
}
}
getResourceKinds(): ResourceKind[] {
ret... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
&eventsFunctionsExtension.GetGlobalVariables(),
&eventsFunctionsExtension.GetSceneVariables(),
PropertiesContainersList::MakeNewEmptyPropertiesContainersList());
projectScopedContainers.AddParameters(
eventsFunction.GetParametersForEvents(eventsFunctionsExtension));
return projectScopedCon... | No issues found. | &eventsFunctionsExtension.GetGlobalVariables(),
&eventsFunctionsExtension.GetSceneVariables(),
PropertiesContainersList::MakeNewEmptyPropertiesContainersList());
projectScopedContainers.AddParameters(
eventsFunction.GetParametersForEvents(eventsFunctionsExtension));
return projectScopedCon... | @@ -4,12 +4,55 @@
#include "GDCore/Project/EventsFunctionsExtension.h"
#include "GDCore/Project/EventsBasedBehavior.h"
#include "GDCore/Project/EventsBasedObject.h"
+#include "GDCore/Project/Layout.h"
#include "GDCore/Project/ObjectsContainer.h"
+#include "GDCore/Project/Project.h"
#include "GDCore/Events/Event.h"... | Core/GDCore/Project/ProjectScopedContainers.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Allow legacy scene variable parameters to use extension variables | 7,121 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: C++
File: Core/GDCore/Project/ProjectScopedContainers.cpp
PR Title: Allow legacy scene variable parameters to use extension variables
BEFORE CODE: &eventsFunctionsExtension.GetGlobalVariables(),
&eventsFunctionsExtension.GetSceneVariables(),
PropertiesCon... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
#include "GDCore/Project/Project.h"
#include "GDCore/Project/PropertyDescriptor.h"
#include "GDCore/String.h"
namespace gd {
void LeaderboardIdRenamer::DoVisitObject(gd::Object &object) {
for (auto &pair : object.GetConfiguration().GetProperties()) {
auto &propertyName = pair.first;
auto &property = pair.se... | No issues found. | #include "GDCore/Project/Project.h"
#include "GDCore/Project/PropertyDescriptor.h"
#include "GDCore/String.h"
namespace gd {
void LeaderboardIdRenamer::DoVisitObject(gd::Object &object) {
for (auto &pair : object.GetConfiguration().GetProperties()) {
auto &propertyName = pair.first;
auto &property = pair.se... | @@ -1,8 +1,19 @@
#include "LeaderboardIdRenamer.h"
+#include <map>
+#include <memory>
+#include <vector>
+
+#include "GDCore/Events/Event.h"
+#include "GDCore/Events/EventsList.h"
+#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
+#include "GDCore/Extensions/Metadata/MetadataProvider.h"
#include "GDCore/... | Core/GDCore/IDE/Events/LeaderboardIdRenamer.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Fix leaderboards not properly replaced in projects using them in custom objects | 7,131 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Review this pull request change.
Language: C++
File: Core/GDCore/IDE/Events/LeaderboardIdRenamer.cpp
PR Title: Fix leaderboards not properly replaced in projects using them in custom objects
BEFORE CODE: #include "GDCore/Project/Project.h"
#include "GDCore/Project/PropertyDescriptor.h"
#include "GDCore/String.h"
n... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
if (this.dialogueData.select) {
this.selectedOption -= 1;
this.selectedOption = gdjs.dialogueTree._cycledOptionIndex(
this.selectedOption
);
this.selectedOptionUpdated = true;
}
};
/**
* Select option by index during Options type line parsing.
* @param optionIndex The ... | No issues found. | if (this.dialogueData.select) {
this.selectedOption -= 1;
this.selectedOption = gdjs.dialogueTree._cycledOptionIndex(
this.selectedOption
);
this.selectedOptionUpdated = true;
}
};
/**
* Select option by index during Options type line parsing.
* @param optionIndex The ... | @@ -422,8 +422,9 @@ namespace gdjs {
return;
}
if (this.dialogueData.select) {
- this.selectedOption =
- gdjs.dialogueTree._normalizedOptionIndex(optionIndex);
+ this.selectedOption = gdjs.dialogueTree._normalizedOptionIndex(
+ optionIndex
+ );
this.selectedOptionUpd... | Extensions/DialogueTree/dialoguetools.ts | 0 | TypeScript | 1 | none | 16 | 51 | 51 | true | [Physics2] Fix a memory leak on object instances | 7,136 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: TypeScript
File: Extensions/DialogueTree/dialoguetools.ts
PR Title: [Physics2] Fix a memory leak on object instances
BEFORE CODE: if (this.dialogueData.select) {
this.selectedOption -= 1;
this.selectedOption = gdjs.dialogueTree._cycledOptionIndex(
t... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
return loginProvider
.loginOrSignupWithProvider({ provider, signal })
.then(userCredentials => {
// The user is now stored in `this.auth`.
})
.catch(error => {
if (error.name !== userCancellationErrorName) {
console.error('Error while login with provider:', error);
... | No issues found. | return loginProvider
.loginOrSignupWithProvider({ provider, signal })
.then(userCredentials => {
// The user is now stored in `this.auth`.
})
.catch(error => {
if (error.name !== userCancellationErrorName) {
console.error('Error while login with provider:', error);
... | @@ -16,6 +16,7 @@ import { GDevelopFirebaseConfig, GDevelopUserApi } from './ApiConfigs';
import type { LoginProvider } from '../../LoginProvider';
import { showErrorBox } from '../../UI/Messages/MessageBox';
import { type CommunityLinks, type UserSurvey } from './User';
+import { userCancellationErrorName } from '.... | newIDE/app/src/Utils/GDevelopServices/Authentication.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Fix infinite loading when canceling login with provider | 7,138 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/Utils/GDevelopServices/Authentication.js
PR Title: Fix infinite loading when canceling login with provider
BEFORE CODE: return loginProvider
.loginOrSignupWithProvider({ provider, signal })
.then(userCredentials => {
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
onParametersUpdated();
}
);
}
},
[
eventsBasedBehavior,
eventsBasedObject,
eventsFunction,
forceUpdate,
onMoveBehaviorEventsParameter,
onMoveFreeEventsParameter,
onMoveObjectEventsParameter,
onParametersUpdated,
]
);... | No issues found. | onParametersUpdated();
}
);
}
},
[
eventsBasedBehavior,
eventsBasedObject,
eventsFunction,
forceUpdate,
onMoveBehaviorEventsParameter,
onMoveFreeEventsParameter,
onMoveObjectEventsParameter,
onParametersUpdated,
]
);... | @@ -39,6 +39,7 @@ import ResponsiveFlatButton from '../../UI/ResponsiveFlatButton';
import { EmptyPlaceholder } from '../../UI/EmptyPlaceholder';
import useAlertDialog from '../../UI/Alert/useAlertDialog';
import Text from '../../UI/Text';
+import { ProjectScopedContainersAccessor } from '../../InstructionOrExpressi... | newIDE/app/src/EventsFunctionsExtensionEditor/EventsFunctionConfigurationEditor/EventsFunctionParametersEditor.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Reduce the risk of name collisions between objects, variables, parameters and properties | 7,148 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/EventsFunctionsExtensionEditor/EventsFunctionConfigurationEditor/EventsFunctionParametersEditor.js
PR Title: Reduce the risk of name collisions between objects, variables, parameters and properties
BEFORE CODE: onParametersUpda... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
},
[]
);
const onCaptureFinished = React.useCallback(
async (captureOptions: CaptureOptions) => {
if (!project) return;
const projectId = project.getProjectUuid();
try {
const screenshots = captureOptions.screenshots;
if (!screenshots) return;
const screensho... | No issues found. | },
[]
);
const onCaptureFinished = React.useCallback(
async (captureOptions: CaptureOptions) => {
if (!project) return;
const projectId = project.getProjectUuid();
try {
const screenshots = captureOptions.screenshots;
if (!screenshots) return;
const screensho... | @@ -5,9 +5,23 @@ import {
type LaunchCaptureOptions,
type CaptureOptions,
} from '../ExportAndShare/PreviewLauncher.flow';
-import { createGameResourceSignedUrls } from '../Utils/GDevelopServices/Game';
-
-const useCapturesManager = ({ project }: { project: ?gdProject }) => {
+import {
+ createGameResourceSigne... | newIDE/app/src/MainFrame/UseCapturesManager.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Take a screenshot on preview | 7,156 | 4ian/GDevelop | 10,154 | JavaScript | ClementPasteau | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/MainFrame/UseCapturesManager.js
PR Title: Take a screenshot on preview
BEFORE CODE: },
[]
);
const onCaptureFinished = React.useCallback(
async (captureOptions: CaptureOptions) => {
if (!project) return;
const pr... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
}
return false;
}
const ResourceFolder& ResourcesManager::GetFolder(
const gd::String& name) const {
for (std::size_t i = 0; i < folders.size(); ++i) {
if (folders[i].GetName() == name) return folders[i];
}
return badFolder;
}
ResourceFolder& ResourcesManager::GetFolder(const gd::Str... | No issues found. | }
return false;
}
const ResourceFolder& ResourcesManager::GetFolder(
const gd::String& name) const {
for (std::size_t i = 0; i < folders.size(); ++i) {
if (folders[i].GetName() == name) return folders[i];
}
return badFolder;
}
ResourceFolder& ResourcesManager::GetFolder(const gd::Str... | @@ -173,9 +173,6 @@ std::map<gd::String, gd::PropertyDescriptor> ImageResource::GetProperties()
properties[_("Smooth the image")]
.SetValue(smooth ? "true" : "false")
.SetType("Boolean");
- properties[_("Always loaded in memory")]
- .SetValue(alwaysLoaded ? "true" : "false")
- .SetType(... | Core/GDCore/Project/ResourcesManager.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Remove dead code of alwaysLoaded | 7,175 | 4ian/GDevelop | 10,154 | JavaScript | Bouh | Review this pull request change.
Language: C++
File: Core/GDCore/Project/ResourcesManager.cpp
PR Title: Remove dead code of alwaysLoaded
BEFORE CODE: }
return false;
}
const ResourceFolder& ResourcesManager::GetFolder(
const gd::String& name) const {
for (std::size_t i = 0; i < folders.size(); ++... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
auto &eventsExtension = SetupProjectWithEventsFunctionExtension(project);
gd::WholeProjectRefactorer::MoveEventsFunctionParameter(
project, eventsExtension, "MyEventsFunction", 1, 3);
for (auto *eventsList : GetEventsLists(project)) {
// Check that events function calls in instructions have ... | No issues found. | auto &eventsExtension = SetupProjectWithEventsFunctionExtension(project);
gd::WholeProjectRefactorer::MoveEventsFunctionParameter(
project, eventsExtension, "MyEventsFunction", 1, 3);
for (auto *eventsList : GetEventsLists(project)) {
// Check that events function calls in instructions have ... | @@ -91,6 +91,20 @@ CreateInstructionWithNumberParameter(gd::Project &project,
return event.GetActions().Insert(instruction);
}
+const gd::Instruction &
+CreateInstructionWithVariableParameter(gd::Project &project,
+ gd::EventsList &events,
+ ... | Core/tests/WholeProjectRefactorer.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Fix variables from being renamed with a property | 7,186 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: C++
File: Core/tests/WholeProjectRefactorer.cpp
PR Title: Fix variables from being renamed with a property
BEFORE CODE: auto &eventsExtension = SetupProjectWithEventsFunctionExtension(project);
gd::WholeProjectRefactorer::MoveEventsFunctionParameter(
proje... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
]}
/>
}
>
{currentTab === 'properties' && (
<ColumnStackLayout noMargin>
{layer.isLightingLayer() ? (
<DismissableAlertMessage
kind="info"
identifier="lighting-layer-usage"
>
<Trans>
The... | No issues found. | ]}
/>
}
>
{currentTab === 'properties' && (
<ColumnStackLayout noMargin>
{layer.isLightingLayer() ? (
<DismissableAlertMessage
kind="info"
identifier="lighting-layer-usage"
>
<Trans>
The... | @@ -21,10 +21,11 @@ import HotReloadPreviewButton, {
import HelpButton from '../UI/HelpButton';
import { Tabs } from '../UI/Tabs';
import EffectsList from '../EffectsList';
-import { Spacer } from '../UI/Grid';
+import { Column, Line, Spacer } from '../UI/Grid';
import SemiControlledTextField from '../UI/SemiContro... | newIDE/app/src/LayersList/LayerEditorDialog.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Fix anchor behavior and add option to center layer or keep top-left fixed when resized | 7,188 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/LayersList/LayerEditorDialog.js
PR Title: Fix anchor behavior and add option to center layer or keep top-left fixed when resized
BEFORE CODE: ]}
/>
}
>
{currentTab === 'properties' && (
<ColumnStackL... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
beforeEach(() => {
runtimeGame = gdjs.getPixiRuntimeGame();
renderer = runtimeGame.getRenderer();
gameContainer = document.createElement('div');
});
it('should correctly create standard canvas and domElementsContainer', () => {
renderer.createStandardCanvas(gameContainer);
... | No issues found. |
beforeEach(() => {
runtimeGame = gdjs.getPixiRuntimeGame();
renderer = runtimeGame.getRenderer();
gameContainer = document.createElement('div');
});
it('should correctly create standard canvas and domElementsContainer', () => {
renderer.createStandardCanvas(gameContainer);
... | @@ -0,0 +1,59 @@
+describe('gdjs.RuntimeGameRenderer canvas tests', () => {
+ let runtimeGame;
+ let renderer;
+ let gameContainer;
+
+ beforeEach(() => {
+ runtimeGame = gdjs.getPixiRuntimeGame();
+ renderer = runtimeGame.getRenderer();
+ gameContainer = document.createElement('div');
... | GDJS/tests/tests/game-canvas.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Add external canvas usage to RuntimeGamePixiRenderer | 7,199 | 4ian/GDevelop | 10,154 | JavaScript | danvervlad | Review this pull request change.
Language: JavaScript
File: GDJS/tests/tests/game-canvas.js
PR Title: Add external canvas usage to RuntimeGamePixiRenderer
BEFORE CODE:
beforeEach(() => {
runtimeGame = gdjs.getPixiRuntimeGame();
renderer = runtimeGame.getRenderer();
gameContainer = docu... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
* \brief Return a reference to the layout at position "index" in the layout
* list
*/
Layout& GetLayout(std::size_t index);
/**
* \brief Return a reference to the layout at position "index" in the layout
* list
*/
const Layout& GetLayout(std::size_t index) const;
/**
* \brief ... | No issues found. | * \brief Return a reference to the layout at position "index" in the layout
* list
*/
Layout& GetLayout(std::size_t index);
/**
* \brief Return a reference to the layout at position "index" in the layout
* list
*/
const Layout& GetLayout(std::size_t index) const;
/**
* \brief ... | @@ -523,13 +523,7 @@ class GD_CORE_API Project {
std::unique_ptr<gd::Object> CreateObject(const gd::String& type,
const gd::String& name) const;
- /**
- * Create an object configuration of the given type.
- *
- * \param type The type of the object
- */
-... | Core/GDCore/Project/Project.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Fix default behaviors not added properly to objects in functions | 7,206 | 4ian/GDevelop | 10,154 | JavaScript | 4ian | Review this pull request change.
Language: C/C++
File: Core/GDCore/Project/Project.h
PR Title: Fix default behaviors not added properly to objects in functions
BEFORE CODE: * \brief Return a reference to the layout at position "index" in the layout
* list
*/
Layout& GetLayout(std::size_t index);
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
});
const projectFilesWithoutGame = allRecentProjectFiles
.filter(
file => !games.find(game => game.id === file.fileMetadata.gameId)
)
.map(file => ({ projectFiles: [file] }));
return [...projectFilesWithGame, ...projectFilesWithoutGame];
},
[games, allRecentP... | No issues found. | });
const projectFilesWithoutGame = allRecentProjectFiles
.filter(
file => !games.find(game => game.id === file.fileMetadata.gameId)
)
.map(file => ({ projectFiles: [file] }));
return [...projectFilesWithGame, ...projectFilesWithoutGame];
},
[games, allRecentP... | @@ -395,17 +395,20 @@ const GamesList = ({
searchText ? 250 : 150
);
- // Refresh games to display, depending on a few parameters.
- React.useEffect(getDashboardItemsToDisplayDebounced, [
+ React.useEffect(
getDashboardItemsToDisplayDebounced,
- searchText, // search text changes (user input)
- ... | newIDE/app/src/GameDashboard/GamesList.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Polishing the new Create tab | 7,236 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GamesList.js
PR Title: Polishing the new Create tab
BEFORE CODE: });
const projectFilesWithoutGame = allRecentProjectFiles
.filter(
file => !games.find(game => game.id === file.fileMetadata.gameId)... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
] = React.useState<boolean>(
props.displayOptionToGenerateNewProjectUuid ? false : true
);
const [error, setError] = React.useState<?string>(null);
const onSave = (i18n: I18nType) => {
setError(null);
if (!name) {
setError(i18n._(t`Project name cannot be empty.`));
return;
}
pro... | No issues found. | ] = React.useState<boolean>(
props.displayOptionToGenerateNewProjectUuid ? false : true
);
const [error, setError] = React.useState<?string>(null);
const onSave = (i18n: I18nType) => {
setError(null);
if (!name) {
setError(i18n._(t`Project name cannot be empty.`));
return;
}
pro... | @@ -0,0 +1,105 @@
+// @flow
+
+import * as React from 'react';
+import { I18n } from '@lingui/react';
+import { type I18n as I18nType } from '@lingui/core';
+import { Trans, t } from '@lingui/macro';
+
+import Dialog, { DialogPrimaryButton } from '../UI/Dialog';
+import FlatButton from '../UI/FlatButton';
+import TextF... | newIDE/app/src/ProjectsStorage/SaveAsOptionsDialog.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | When duplicating a project, ask for the new name and if link with game should be kept | 7,253 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/ProjectsStorage/SaveAsOptionsDialog.js
PR Title: When duplicating a project, ask for the new name and if link with game should be kept
BEFORE CODE: ] = React.useState<boolean>(
props.displayOptionToGenerateNewProjectUuid ? false : true... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
);
const renderLastModification = (i18n: I18nType) =>
projectFileMetadataAndStorageProviderName ? (
<LastModificationInfo
file={projectFileMetadataAndStorageProviderName}
lastModifiedInfo={lastModifiedInfo}
storageProvider={itemStorageProvider}
authenticatedUser={authentic... | No issues found. | );
const renderLastModification = (i18n: I18nType) =>
projectFileMetadataAndStorageProviderName ? (
<LastModificationInfo
file={projectFileMetadataAndStorageProviderName}
lastModifiedInfo={lastModifiedInfo}
storageProvider={itemStorageProvider}
authenticatedUser={authentic... | @@ -417,18 +417,16 @@ const GameDashboardCard = ({
const actions = [];
if (projectsList.length > 1) {
actions.push(
- ...[
- ...projectsList.map(fileMetadataAndStorageProviderName => {
- return {
- label: getProjectItemLabel(
- fileMetadataAndStora... | newIDE/app/src/GameDashboard/GameDashboardCard.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Paginate feedbacks | 7,259 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/GameDashboard/GameDashboardCard.js
PR Title: Paginate feedbacks
BEFORE CODE: );
const renderLastModification = (i18n: I18nType) =>
projectFileMetadataAndStorageProviderName ? (
<LastModificationInfo
file={projectFileMe... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
_('Forces & impulses'),
'JsPlatform/Extensions/physics3d.svg',
'JsPlatform/Extensions/physics3d.svg'
)
.addParameter('object', _('Object'), '', false)
.addParameter('behavior', _('Behavior'), 'Physics3DBehavior')
.addParameter('expression', _('Length (N·s or... | No issues found. | _('Forces & impulses'),
'JsPlatform/Extensions/physics3d.svg',
'JsPlatform/Extensions/physics3d.svg'
)
.addParameter('object', _('Object'), '', false)
.addParameter('behavior', _('Behavior'), 'Physics3DBehavior')
.addParameter('expression', _('Length (N·s or... | @@ -1535,6 +1535,15 @@ module.exports = {
return true;
}
+ if (propertyName === 'stairHeightMax') {
+ const newValueAsNumber = parseFloat(newValue);
+ if (newValueAsNumber !== newValueAsNumber) return false;
+ behaviorContent
+ .getChild('stairHeightMax... | Extensions/Physics3DBehavior/JsExtension.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Add a property to choose the maximum stair height a 3D character can walk | 7,265 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: JavaScript
File: Extensions/Physics3DBehavior/JsExtension.js
PR Title: Add a property to choose the maximum stair height a 3D character can walk
BEFORE CODE: _('Forces & impulses'),
'JsPlatform/Extensions/physics3d.svg',
'JsPlatform/Extensions... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
'Unable to read GDJS files for setting up autocompletions:',
error
);
return;
}
filenames.forEach(filename => {
const fullPath = path.join(folderPath, filename);
const isDirectory = fs.lstatSync(fullPath).isDirectory();
if (isDirectory) {
... | No issues found. | 'Unable to read GDJS files for setting up autocompletions:',
error
);
return;
}
filenames.forEach(filename => {
const fullPath = path.join(folderPath, filename);
const isDirectory = fs.lstatSync(fullPath).isDirectory();
if (isDirectory) {
... | @@ -4,6 +4,16 @@ import optionalRequire from '../Utils/OptionalRequire';
const fs = optionalRequire('fs');
const path = optionalRequire('path');
+// Avoid conflicts in declaration of PIXI and THREE namespaces.
+const excludedFiles = [
+ 'global-three.d.ts',
+ 'global-pixi.d.ts',
+ 'pixi-particles-pixi-renderer.d... | newIDE/app/src/CodeEditor/LocalCodeEditorAutocompletions.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Add Pixi and Three type definitions for JS events | 7,266 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/CodeEditor/LocalCodeEditorAutocompletions.js
PR Title: Add Pixi and Three type definitions for JS events
BEFORE CODE: 'Unable to read GDJS files for setting up autocompletions:',
error
);
return;
}
... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
/**
* \brief Set the description of the behavior or object, to be displayed in the editor.
*/
virtual AbstractEventsBasedEntity& SetDescription(const gd::String& description_) {
description = description_;
return *this;
}
/**
* \brief Get the internal name of the behavior or object.
*/
c... | No issues found. |
/**
* \brief Set the description of the behavior or object, to be displayed in the editor.
*/
virtual AbstractEventsBasedEntity& SetDescription(const gd::String& description_) {
description = description_;
return *this;
}
/**
* \brief Get the internal name of the behavior or object.
*/
c... | @@ -3,8 +3,7 @@
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
-#ifndef GDCORE_ABSTRACTEVENTSBASEDENTITY_H
-#define GDCORE_ABSTRACTEVENTSBASEDENTITY_H
+#pragma once
#include <vector>
#include "GDCore/Project/NamedPropert... | Core/GDCore/Project/AbstractEventsBasedEntity.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Allow to make custom objects private to an extension | 7,275 | 4ian/GDevelop | 10,154 | JavaScript | D8H | Review this pull request change.
Language: C/C++
File: Core/GDCore/Project/AbstractEventsBasedEntity.h
PR Title: Allow to make custom objects private to an extension
BEFORE CODE:
/**
* \brief Set the description of the behavior or object, to be displayed in the editor.
*/
virtual AbstractEventsBasedEntit... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. | |
project,
objectsContainer: targetObjectsContainer,
targetObjectFolderOrObject:
targetObjectFolderOrObjectWithContext &&
!targetObjectFolderOrObjectWithContext.global
? targetObjectFolderOrObjectWithContext.objectFolderOrObject
... | No issues found. | project,
objectsContainer: targetObjectsContainer,
targetObjectFolderOrObject:
targetObjectFolderOrObjectWithContext &&
!targetObjectFolderOrObjectWithContext.global
? targetObjectFolderOrObjectWithContext.objectFolderOrObject
... | @@ -35,6 +35,7 @@ import {
useFetchAssets,
} from './NewObjectDialog';
import { type InstallAssetOutput } from './InstallAsset';
+import { type ObjectFolderOrObjectWithContext } from '../ObjectsList/EnumerateObjectFolderOrObject';
// We limit the number of assets that can be installed at once to avoid
// timeo... | newIDE/app/src/AssetStore/AssetPackInstallDialog.js | 0 | JavaScript | 1 | none | 16 | 51 | 51 | true | Add objects installed from the asset store in selected folder | 7,287 | 4ian/GDevelop | 10,154 | JavaScript | AlexandreSi | Review this pull request change.
Language: JavaScript
File: newIDE/app/src/AssetStore/AssetPackInstallDialog.js
PR Title: Add objects installed from the asset store in selected folder
BEFORE CODE: project,
objectsContainer: targetObjectsContainer,
targetObjectFolderOrObject... | No issues found. | You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.