mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Remove dead code
Don't show in changelog
This commit is contained in:
@@ -38,26 +38,4 @@ export default class BaseEditor extends React.Component<*, *> {
|
||||
|
||||
if (this.props.setToolbar) this.props.setToolbar(null);
|
||||
}
|
||||
|
||||
getSerializedElements() {
|
||||
throw new Error(
|
||||
'The editor has not implemented getSerializedElements to return what should be serialized'
|
||||
);
|
||||
}
|
||||
|
||||
static getLayoutSerializedElements(layout: ?gdLayout) {
|
||||
if (!layout) return {};
|
||||
|
||||
return {
|
||||
windowTitle: layout.getWindowDefaultTitle(),
|
||||
layers: serializeToJSObject(layout, 'serializeLayersTo'),
|
||||
backgroundColor:
|
||||
'' +
|
||||
rgbToHexNumber(
|
||||
layout.getBackgroundColorRed(),
|
||||
layout.getBackgroundColorGreen(),
|
||||
layout.getBackgroundColorBlue()
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import EventsSheet from '../../EventsSheet';
|
||||
import { serializeToJSObject } from '../../Utils/Serializer';
|
||||
import BaseEditor from './BaseEditor';
|
||||
|
||||
export default class EventsEditor extends BaseEditor {
|
||||
@@ -15,16 +14,6 @@ export default class EventsEditor extends BaseEditor {
|
||||
// No updates to be done.
|
||||
}
|
||||
|
||||
getSerializedElements() {
|
||||
const layout = this.getLayout();
|
||||
if (!layout) return {};
|
||||
|
||||
return {
|
||||
...BaseEditor.getLayoutSerializedElements(layout),
|
||||
events: serializeToJSObject(layout.getEvents()),
|
||||
};
|
||||
}
|
||||
|
||||
getLayout(): ?gdLayout {
|
||||
const { project, layoutName } = this.props;
|
||||
if (!project || !project.hasLayoutNamed(layoutName)) return null;
|
||||
|
@@ -3,7 +3,6 @@ import { Trans } from '@lingui/macro';
|
||||
import React from 'react';
|
||||
import EventsSheet from '../../EventsSheet';
|
||||
import RaisedButton from '../../UI/RaisedButton';
|
||||
import { serializeToJSObject } from '../../Utils/Serializer';
|
||||
import PlaceholderMessage from '../../UI/PlaceholderMessage';
|
||||
import BaseEditor from './BaseEditor';
|
||||
import LayoutChooserDialog from './LayoutChooserDialog';
|
||||
@@ -32,17 +31,6 @@ export default class ExternalEventsEditor extends BaseEditor {
|
||||
// No updates to be done.
|
||||
}
|
||||
|
||||
getSerializedElements() {
|
||||
const externalEvents = this.getExternalEvents();
|
||||
const layout = this.getLayout();
|
||||
if (!externalEvents) return {};
|
||||
|
||||
return {
|
||||
...BaseEditor.getLayoutSerializedElements(layout),
|
||||
events: serializeToJSObject(externalEvents),
|
||||
};
|
||||
}
|
||||
|
||||
getExternalEvents(): ?gdExternalEvents {
|
||||
const { project, externalEventsName } = this.props;
|
||||
if (!project.hasExternalEventsNamed(externalEventsName)) {
|
||||
|
@@ -47,18 +47,6 @@ export default class ExternalLayoutEditor extends BaseEditor {
|
||||
// No updates to be done.
|
||||
}
|
||||
|
||||
getSerializedElements() {
|
||||
const externalLayout = this.getExternalLayout();
|
||||
const layout = this.getLayout();
|
||||
if (!externalLayout || !layout) return {};
|
||||
|
||||
return {
|
||||
...BaseEditor.getLayoutSerializedElements(layout),
|
||||
instances: serializeToJSObject(externalLayout.getInitialInstances()),
|
||||
uiSettings: this.editor ? this.editor.getUiSettings() : {},
|
||||
};
|
||||
}
|
||||
|
||||
getExternalLayout(): ?gdExternalLayout {
|
||||
const { project, externalLayoutName } = this.props;
|
||||
if (!project.hasExternalLayoutNamed(externalLayoutName)) {
|
||||
|
@@ -31,17 +31,6 @@ export default class SceneEditorContainer extends BaseEditor {
|
||||
if (this.editor) this.editor.forceUpdateObjectsList();
|
||||
}
|
||||
|
||||
getSerializedElements() {
|
||||
const layout = this.getLayout();
|
||||
if (!layout) return {};
|
||||
|
||||
return {
|
||||
...BaseEditor.getLayoutSerializedElements(layout),
|
||||
instances: serializeToJSObject(layout.getInitialInstances()),
|
||||
uiSettings: this.editor ? this.editor.getUiSettings() : {},
|
||||
};
|
||||
}
|
||||
|
||||
getLayout(): ?gdLayout {
|
||||
const { project, layoutName } = this.props;
|
||||
if (!project || !project.hasLayoutNamed(layoutName)) return null;
|
||||
|
Reference in New Issue
Block a user