Rename Editor to CellEditor
</div>
</div>
-<div id="editor-container">
+<div id="cell-editor-container">
<div class="box hflex">
<div class="vflex flex-auto">
<h1>Cell Editor</h1>
<h2>Description</h2>
<textarea name="description" class="flex-auto"></textarea>
<div class="hflex">
- <button id="editor-close">Close</button>
+ <button id="cell-editor-close">Close</button>
</div>
</div>
<div class="events">
import { GameEvent, GameEventType } from './event';
import FragmentManager from './fragmentmanager';
-export type EditorCallback = (cell: Cell) => void;
+export type CellEditorCallback = (cell: Cell) => void;
-export default class Editor {
+export default class CellEditor {
container: HTMLDivElement
titleRef: HTMLInputElement
descriptionRef: HTMLTextAreaElement
onClose: (cell: Cell) => void
constructor() {
- this.container = <HTMLDivElement>document.getElementById('editor-container');
+ this.container = <HTMLDivElement>document.getElementById('cell-editor-container');
this.container.addEventListener('keydown', function(e: KeyboardEvent) {
e.cancelBubble = true;
});
addEventButton.addEventListener('click', this.addEventHandler.bind(this));
this.events = []
- const closeButton = document.getElementById('editor-close');
+ const closeButton = document.getElementById('cell-editor-close');
closeButton.addEventListener('click', this.closeHandler.bind(this));
}
import GameMap from './map';
-import Editor, { EditorCallback } from './editor';
+import CellEditor, { CellEditorCallback } from './celleditor';
import MapView from './mapview';
import TextView from './textview';
import Actions from './actions';
agents: Map<ID, GameAgent>;
textView: TextView;
- editor: Editor;
+ cellEditor: CellEditor;
mapView: MapView;
actions: Actions;
editMode: boolean = true;
document.body.classList.toggle('edit-mode', this.editMode);
this.textView = new TextView();
- this.editor = new Editor();
+ this.cellEditor = new CellEditor();
this.mapView = new MapView();
this.mapView.updateAll();
this.actions = new Actions();
-import Editor from './editor';
import gs from './gamestate';
import { ID, generateID } from './id';
import { GameObject, GameObjectType } from './object';
}
editDescription() {
- gs.editor.onClose = (cell: Cell) => {
+ gs.cellEditor.onClose = (cell: Cell) => {
gs.enterCell();
};
- gs.editor.open(this.getCurrentCell());
+ gs.cellEditor.open(this.getCurrentCell());
}
store() {
padding: 16px;
}
-#editor-container {
+#cell-editor-container {
display: none;
position: fixed;
left: 0;
height: 100vh;
}
-#editor-container .box {
+#cell-editor-container .box {
width: 800px;
height: 600px;
margin-top: calc(50vh - 300px);
background-color: black;
}
-#editor-container.visible {
+#cell-editor-container.visible {
display: initial;
}
-#editor-container textarea[name="description"] {
+#cell-editor-container textarea[name="description"] {
height: 80px;
}
-#editor-container .events {
+#cell-editor-container .events {
margin-left: 16px;
overflow-y: auto;
width: 320px;