Remove dead code

Don't show in changelog
This commit is contained in:
Florian Rival
2020-05-10 23:24:05 +02:00
parent c268b19264
commit f7e93c2a13
5 changed files with 0 additions and 68 deletions

View File

@@ -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()
),
};
}
}

View File

@@ -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;

View File

@@ -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)) {

View File

@@ -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)) {

View File

@@ -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;