| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>nEngine Editor</title>
- <style>
- html,
- body {
- margin: 0;
- height: 100%;
- background: #171b20;
- color: #e6e9ec;
- font-family: system-ui, sans-serif;
- font-size: 14px;
- }
- #app {
- display: flex;
- flex-direction: column;
- height: 100%;
- }
- .screen {
- flex: 1;
- display: flex;
- flex-direction: column;
- padding: 24px;
- gap: 12px;
- overflow: auto;
- }
- .hidden {
- display: none;
- }
- h1 {
- margin: 0;
- font-size: 28px;
- color: #a5d6a7;
- }
- h2 {
- margin: 24px 0 8px;
- font-size: 15px;
- color: #90a4ae;
- text-transform: uppercase;
- letter-spacing: 0.08em;
- }
- h3 {
- margin: 0 0 8px;
- font-size: 13px;
- color: #90a4ae;
- text-transform: uppercase;
- letter-spacing: 0.08em;
- }
- button {
- font: inherit;
- padding: 7px 16px;
- border: 1px solid #4a5560;
- border-radius: 5px;
- background: #262c34;
- color: #e6e9ec;
- cursor: pointer;
- }
- button:hover {
- background: #313a45;
- }
- button.primary {
- background: #2e7d32;
- border-color: #66bb6a;
- }
- button.primary:hover {
- background: #388e3c;
- }
- #home-actions {
- display: flex;
- gap: 10px;
- }
- #recent-list {
- list-style: none;
- margin: 0;
- padding: 0;
- display: flex;
- flex-direction: column;
- gap: 6px;
- max-width: 560px;
- }
- #recent-list button {
- width: 100%;
- text-align: left;
- display: flex;
- justify-content: space-between;
- gap: 12px;
- }
- #recent-list .recent-path {
- color: #7f8c99;
- font-size: 12px;
- }
- .muted {
- color: #7f8c99;
- }
- #home-error {
- color: #ef5350;
- min-height: 18px;
- }
- #topbar {
- display: flex;
- align-items: center;
- gap: 14px;
- padding: 10px 16px;
- background: #1f242b;
- border-bottom: 1px solid #2d343d;
- }
- #project-name {
- font-weight: 600;
- color: #a5d6a7;
- }
- #project-path {
- color: #7f8c99;
- font-size: 12px;
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- #mcp-url {
- color: #7f8c99;
- font-size: 12px;
- font-family: ui-monospace, monospace;
- max-width: 280px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- #mcp-url.running {
- color: #a5d6a7;
- }
- #workspace {
- flex: 1;
- display: flex;
- min-height: 0;
- }
- #content-browser {
- width: 240px;
- border-right: 1px solid #2d343d;
- padding: 14px;
- overflow: auto;
- background: #1c2127;
- }
- #content-list {
- list-style: none;
- margin: 0;
- padding: 0;
- display: flex;
- flex-direction: column;
- gap: 3px;
- }
- #content-list li {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 13px;
- }
- #content-list li:hover {
- background: #262c34;
- }
- #content-list li.clickable {
- cursor: pointer;
- }
- .kind-name {
- color: #cfd8dc;
- }
- .kind-count {
- color: #7f8c99;
- font-variant-numeric: tabular-nums;
- }
- .kind-files {
- list-style: none;
- margin: 2px 0 0 10px;
- padding: 0;
- display: flex;
- flex-direction: column;
- gap: 2px;
- }
- .kind-file {
- font-size: 12px;
- padding: 3px 8px;
- text-align: left;
- width: 100%;
- background: #1f242b;
- }
- .kind-file:hover {
- background: #313a45;
- }
- .kind-new {
- padding: 2px 9px;
- font-size: 13px;
- line-height: 1.2;
- flex: none;
- }
- #editor-panel {
- flex: 1;
- padding: 16px;
- display: flex;
- flex-direction: column;
- gap: 8px;
- min-width: 0;
- }
- #editor-panel .placeholder {
- color: #7f8c99;
- border: 1px dashed #2d343d;
- border-radius: 6px;
- padding: 32px;
- text-align: center;
- }
- .form-panel {
- display: flex;
- flex-direction: column;
- gap: 10px;
- flex: 1;
- min-height: 0;
- }
- .form-header {
- display: flex;
- align-items: center;
- gap: 10px;
- flex-wrap: wrap;
- }
- .form-header h3 {
- margin: 0;
- }
- .form-path {
- color: #7f8c99;
- font-size: 12px;
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .form-errors {
- color: #ef5350;
- font-size: 12px;
- max-height: 140px;
- overflow: auto;
- }
- .form-errors ul {
- margin: 0;
- padding-left: 18px;
- }
- .form-body {
- flex: 1;
- min-height: 0;
- overflow: auto;
- display: flex;
- flex-direction: column;
- gap: 10px;
- padding: 10px;
- background: #1c2127;
- border: 1px solid #2d343d;
- border-radius: 6px;
- }
- .form-field {
- display: flex;
- flex-direction: column;
- gap: 4px;
- max-width: 560px;
- }
- .form-field > label {
- font-size: 12px;
- color: #90a4ae;
- }
- .form-field input[type="text"],
- .form-field input[type="number"],
- .form-field select {
- font: inherit;
- padding: 5px 8px;
- border: 1px solid #4a5560;
- border-radius: 4px;
- background: #262c34;
- color: #e6e9ec;
- }
- .form-field input[type="text"].readonly,
- .form-field select.readonly {
- opacity: 0.7;
- }
- .form-boolean {
- display: flex;
- align-items: center;
- gap: 8px;
- font-size: 13px;
- cursor: pointer;
- }
- .form-section {
- border: 1px solid #2d343d;
- border-radius: 6px;
- padding: 8px 10px;
- display: flex;
- flex-direction: column;
- gap: 8px;
- margin: 0;
- background: #171b20;
- }
- .form-section legend {
- font-size: 12px;
- color: #90a4ae;
- text-transform: uppercase;
- letter-spacing: 0.06em;
- padding: 0 6px;
- }
- .form-section-body {
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- .form-array,
- .form-record {
- display: flex;
- flex-direction: column;
- gap: 6px;
- border: 1px solid #2d343d;
- border-radius: 6px;
- padding: 8px 10px;
- background: #171b20;
- }
- .form-array-header,
- .form-record-header,
- .form-union-header {
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .form-array-label,
- .form-record-label,
- .form-union-label {
- font-size: 12px;
- color: #90a4ae;
- text-transform: uppercase;
- letter-spacing: 0.06em;
- flex: 1;
- }
- .form-array-list,
- .form-record-rows {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .form-array-item {
- display: flex;
- align-items: flex-start;
- gap: 8px;
- padding: 6px;
- border: 1px solid #2d343d;
- border-radius: 4px;
- background: #1c2127;
- }
- .form-array-item > input,
- .form-array-item > select {
- flex: 1;
- min-width: 0;
- }
- .form-array-item-body {
- flex: 1;
- min-width: 0;
- }
- .form-array-controls {
- display: flex;
- gap: 4px;
- flex: none;
- }
- .form-array-controls button {
- padding: 4px 8px;
- font-size: 12px;
- }
- .form-union {
- display: flex;
- flex-direction: column;
- gap: 6px;
- border: 1px solid #2d343d;
- border-radius: 6px;
- padding: 8px 10px;
- background: #171b20;
- }
- .form-union-body {
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- .form-branch-select {
- font: inherit;
- padding: 5px 8px;
- border: 1px solid #4a5560;
- border-radius: 4px;
- background: #262c34;
- color: #e6e9ec;
- }
- .form-record-row {
- display: flex;
- align-items: flex-start;
- gap: 8px;
- }
- .form-record-row > input {
- flex: 1;
- min-width: 0;
- font: inherit;
- padding: 5px 8px;
- border: 1px solid #4a5560;
- border-radius: 4px;
- background: #262c34;
- color: #e6e9ec;
- }
- .form-record-row > .form-record-value {
- flex: 2;
- min-width: 0;
- }
- #statusbar {
- padding: 6px 16px;
- background: #1f242b;
- border-top: 1px solid #2d343d;
- color: #7f8c99;
- font-size: 12px;
- }
- .status-error {
- color: #ef5350;
- }
- button:disabled {
- opacity: 0.5;
- cursor: default;
- }
- .map-editor {
- display: flex;
- flex-direction: column;
- gap: 10px;
- flex: 1;
- min-height: 0;
- }
- .map-toolbar {
- display: flex;
- align-items: center;
- gap: 10px;
- flex-wrap: wrap;
- }
- .map-toolbar h3 {
- margin: 0;
- }
- .map-path {
- color: #7f8c99;
- font-size: 12px;
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .map-tools {
- display: flex;
- gap: 6px;
- }
- .map-tool-button {
- padding: 5px 12px;
- font-size: 12px;
- }
- .map-tool-button.selected {
- background: #2e7d32;
- border-color: #66bb6a;
- }
- .map-body {
- display: flex;
- gap: 12px;
- flex: 1;
- min-height: 0;
- }
- .map-palette {
- width: 180px;
- flex: none;
- overflow: auto;
- display: flex;
- flex-direction: column;
- gap: 8px;
- padding: 10px;
- background: #1c2127;
- border: 1px solid #2d343d;
- border-radius: 6px;
- }
- .palette-list {
- display: flex;
- flex-direction: column;
- gap: 4px;
- }
- .palette-swatch {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 5px 8px;
- text-align: left;
- }
- .palette-swatch.selected {
- border-color: #66bb6a;
- background: #2e7d32;
- }
- .swatch-chip {
- width: 22px;
- height: 22px;
- border-radius: 3px;
- border: 1px solid rgba(0, 0, 0, 0.4);
- flex: none;
- }
- .swatch-label {
- font-size: 12px;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .add-tile-form {
- display: flex;
- gap: 6px;
- }
- .add-tile-form input {
- flex: 1;
- min-width: 0;
- font: inherit;
- padding: 5px 8px;
- border: 1px solid #4a5560;
- border-radius: 4px;
- background: #262c34;
- color: #e6e9ec;
- }
- .map-canvas-wrap {
- flex: 1;
- min-width: 0;
- overflow: auto;
- background: #111417;
- border: 1px solid #2d343d;
- border-radius: 6px;
- padding: 8px;
- }
- #map-canvas,
- .map-canvas-wrap canvas {
- display: block;
- image-rendering: pixelated;
- cursor: crosshair;
- }
- .scene-editor {
- display: flex;
- flex-direction: column;
- gap: 10px;
- flex: 1;
- min-height: 0;
- }
- .scene-toolbar {
- display: flex;
- align-items: center;
- gap: 10px;
- flex-wrap: wrap;
- }
- .scene-toolbar h3 {
- margin: 0;
- }
- .scene-path {
- color: #7f8c99;
- font-size: 12px;
- flex: 1;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .scene-mode-toggle {
- display: flex;
- gap: 6px;
- }
- .scene-mode-button {
- padding: 5px 12px;
- font-size: 12px;
- }
- .scene-mode-button.selected {
- background: #2e7d32;
- border-color: #66bb6a;
- }
- .scene-body {
- display: flex;
- gap: 12px;
- flex: 1;
- min-height: 0;
- }
- .scene-palette {
- width: 180px;
- flex: none;
- overflow: auto;
- display: flex;
- flex-direction: column;
- gap: 8px;
- padding: 10px;
- background: #1c2127;
- border: 1px solid #2d343d;
- border-radius: 6px;
- }
- .scene-palette-section {
- margin: 6px 0 0;
- font-size: 11px;
- color: #90a4ae;
- text-transform: uppercase;
- letter-spacing: 0.06em;
- }
- .scene-palette-list {
- display: flex;
- flex-direction: column;
- gap: 4px;
- }
- .scene-palette-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
- padding: 5px 8px;
- text-align: left;
- }
- .scene-palette-item.selected {
- border-color: #66bb6a;
- background: #2e7d32;
- }
- .scene-palette-badge {
- color: #90a4ae;
- font-size: 11px;
- font-variant-numeric: tabular-nums;
- flex: none;
- }
- .scene-npc-form {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .scene-npc-form input {
- font: inherit;
- padding: 5px 8px;
- border: 1px solid #4a5560;
- border-radius: 4px;
- background: #262c34;
- color: #e6e9ec;
- }
- .scene-main {
- flex: 1;
- min-width: 0;
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- .scene-entity-list {
- border: 1px solid #2d343d;
- border-radius: 6px;
- background: #1c2127;
- padding: 8px 10px;
- max-height: 180px;
- overflow: auto;
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .scene-entity-list h4 {
- margin: 0;
- font-size: 11px;
- color: #90a4ae;
- text-transform: uppercase;
- letter-spacing: 0.06em;
- }
- .scene-entity-rows {
- display: flex;
- flex-direction: column;
- gap: 3px;
- }
- .scene-entity-row {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 4px 8px;
- border-radius: 4px;
- cursor: pointer;
- font-size: 12px;
- }
- .scene-entity-row:hover {
- background: #262c34;
- }
- .scene-entity-row.selected {
- background: #2e7d32;
- }
- .scene-entity-dot {
- width: 10px;
- height: 10px;
- border-radius: 50%;
- border: 1px solid rgba(0, 0, 0, 0.4);
- flex: none;
- }
- .scene-entity-coords {
- color: #7f8c99;
- font-variant-numeric: tabular-nums;
- margin-left: auto;
- }
- .scene-entity-delete {
- padding: 2px 7px;
- font-size: 12px;
- line-height: 1.1;
- flex: none;
- }
- #playtest {
- flex: 1;
- display: flex;
- flex-direction: column;
- min-height: 0;
- background: #0d1013;
- }
- #playtest-topbar {
- display: flex;
- align-items: center;
- gap: 14px;
- padding: 8px 16px;
- background: #1f242b;
- border-bottom: 1px solid #2d343d;
- }
- #playtest-title {
- font-weight: 600;
- color: #a5d6a7;
- }
- #playtest-status {
- color: #7f8c99;
- font-size: 12px;
- flex: 1;
- }
- #playtest-game {
- flex: 1;
- min-height: 0;
- position: relative;
- }
- #playtest-hud {
- display: flex;
- align-items: center;
- gap: 16px;
- padding: 6px 16px;
- background: #1f242b;
- border-top: 1px solid #2d343d;
- color: #e6e9ec;
- font-size: 12px;
- }
- #playtest-time {
- color: #a5d6a7;
- font-variant-numeric: tabular-nums;
- }
- #playtest-stats {
- color: #e6e9ec;
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- #playtest-feedback {
- color: #8bc34a;
- min-height: 14px;
- }
- .dialog-backdrop {
- position: fixed;
- inset: 0;
- background: rgba(0, 0, 0, 0.5);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 40;
- }
- .dialog {
- width: 520px;
- max-width: 92vw;
- max-height: 82vh;
- overflow: auto;
- background: #1c2127;
- border: 1px solid #2d343d;
- border-radius: 8px;
- padding: 18px;
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .dialog h3 {
- margin: 0;
- }
- .pack-checks {
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .dialog-actions {
- display: flex;
- gap: 10px;
- }
- #pack-result {
- white-space: pre-wrap;
- font-family: ui-monospace, monospace;
- font-size: 12px;
- color: #8bc34a;
- max-height: 180px;
- overflow: auto;
- border: 1px solid #2d343d;
- border-radius: 4px;
- padding: 8px;
- background: #171b20;
- margin: 0;
- }
- #pack-result.status-error {
- color: #ef5350;
- }
- </style>
- </head>
- <body>
- <div id="app">
- <section id="home" class="screen">
- <h1>nEngine Editor</h1>
- <p class="muted">Create or open an nEngine project — a folder with <code>content/</code> (and optional <code>mods/</code>).</p>
- <div id="home-actions">
- <button id="btn-open" type="button" class="primary">Open project…</button>
- <button id="btn-new" type="button">New project…</button>
- </div>
- <h2>Recent projects</h2>
- <ul id="recent-list"></ul>
- <p id="home-error"></p>
- </section>
- <section id="editor" class="screen hidden">
- <header id="topbar">
- <span id="project-name"></span>
- <span id="project-path"></span>
- <span id="mcp-url" title="Embedded MCP endpoint — paste into your AI tool"></span>
- <button id="btn-mcp-copy" type="button" disabled>Copy MCP URL</button>
- <button id="btn-package" type="button">Package</button>
- <button id="btn-play" type="button" class="primary">Play</button>
- <button id="btn-close" type="button">Close project</button>
- </header>
- <div id="workspace">
- <aside id="content-browser">
- <h3>Content</h3>
- <ul id="content-list"></ul>
- </aside>
- <main id="editor-panel">
- <h3>Editor</h3>
- <p class="placeholder">Select a content kind from the sidebar. Maps open the visual tile editor.</p>
- </main>
- </div>
- <div id="statusbar">
- <span id="status"></span>
- </div>
- </section>
- <section id="playtest" class="screen hidden">
- <header id="playtest-topbar">
- <span id="playtest-title">Playtest</span>
- <span id="playtest-status"></span>
- <button id="btn-playtest-exit" type="button">Exit</button>
- </header>
- <div id="playtest-game"></div>
- <div id="playtest-hud">
- <span id="playtest-time"></span>
- <span id="playtest-stats"></span>
- <span id="playtest-feedback"></span>
- </div>
- </section>
- <section id="pack-dialog" class="hidden">
- <div class="dialog-backdrop">
- <div class="dialog">
- <h3>Package</h3>
- <p class="muted">Run the nengine-pack pipeline on this project: content → bundle.json + static site, plus optional desktop app and installer config. Fields pre-fill from project.yaml and are saved back on run.</p>
- <label class="form-field">Product name<input id="pack-name" type="text"></label>
- <label class="form-field">Icon path<input id="pack-icon" type="text" placeholder="icon.png (stored for future use — v1 ships the default Electron icon)"></label>
- <div class="pack-checks">
- <label class="form-boolean"><input id="pack-desktop" type="checkbox">Desktop app (Electron shell)</label>
- <label class="form-boolean"><input id="pack-installer" type="checkbox">Installer config (electron-builder)</label>
- <label class="form-boolean"><input id="pack-mods" type="checkbox">Include Mods (<code>mods/</code>)</label>
- <label class="form-boolean"><input id="pack-split" type="checkbox">Split assets into <code>nengine-assets/</code></label>
- </div>
- <label class="form-field">Output directory<input id="pack-outdir" type="text"></label>
- <pre id="pack-result"></pre>
- <div class="dialog-actions">
- <button id="btn-pack-run" type="button" class="primary">Run package</button>
- <button id="btn-pack-close" type="button">Close</button>
- </div>
- </div>
- </div>
- </section>
- </div>
- <script type="module" src="/src/renderer/main.ts"></script>
- </body>
- </html>
|