aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/.admin_history.json2
-rw-r--r--data/rooms/intro/1006.yaml14
-rw-r--r--data/rooms/intro/1007.yaml2
-rw-r--r--data/rooms/intro/1008.yaml2
-rw-r--r--data/rooms/intro/1009.yaml8
-rw-r--r--data/rooms/intro/1010.yaml2
-rw-r--r--internal/admin/static/map.js24
7 files changed, 36 insertions, 18 deletions
diff --git a/data/.admin_history.json b/data/.admin_history.json
index 9e9cf94..1d37cbf 100644
--- a/data/.admin_history.json
+++ b/data/.admin_history.json
@@ -1 +1 @@
-{"history":[{"time":"2026-07-10T00:42:52-04:00","description":"update room 1008","file_path":"data/rooms/intro/1008.yaml","old_content":"block_transport: false\ncolor: \"52\"\ndescription: []\nexits:\n east:\n room: 1009\n south:\n room: 1007\nhazard: \"\"\nid: 1008\nitem_spawns: []\nmobs: []\nname: 'Room #1008'\nobjects: []\non_enter:\n - steps:\n - messages:\n - \"\"\non_exit:\n - steps: []\n","new_content":"block_transport: false\ncolor: \"52\"\ndescription: []\nexits:\n east:\n room: 1009\n south:\n room: 1007\nhazard: \"\"\nid: 1008\nitem_spawns: []\nmobs: []\nname: 'Room #1008'\nobjects: []\non_enter:\n - steps:\n - messages:\n - dsadasdsa\non_exit:\n - steps: []\n","is_delete":false,"is_create":false}],"redo":null} \ No newline at end of file
+{"history":[{"time":"2026-07-10T12:49:24-04:00","description":"update room 1009","file_path":"data/rooms/intro/1009.yaml","old_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter: []\ntriggers: []\n","new_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps: []\non_exit: []\ntriggers: []\n","is_delete":false,"is_create":false},{"time":"2026-07-10T12:49:26-04:00","description":"update room 1009","file_path":"data/rooms/intro/1009.yaml","old_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps: []\non_exit: []\ntriggers: []\n","new_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps:\n - messages:\n - \"\"\non_exit: []\ntriggers: []\n","is_delete":false,"is_create":false},{"time":"2026-07-10T12:49:27-04:00","description":"update room 1009","file_path":"data/rooms/intro/1009.yaml","old_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps:\n - messages:\n - \"\"\non_exit: []\ntriggers: []\n","new_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps:\n - messages:\n - fdsa\non_exit: []\ntriggers: []\n","is_delete":false,"is_create":false},{"time":"2026-07-10T12:49:27-04:00","description":"update room 1009","file_path":"data/rooms/intro/1009.yaml","old_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps:\n - messages:\n - fdsa\non_exit: []\ntriggers: []\n","new_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps:\n - messages:\n - fdsa\non_exit: []\ntriggers: []\n","is_delete":false,"is_create":false},{"time":"2026-07-10T12:49:35-04:00","description":"update room 1009","file_path":"data/rooms/intro/1009.yaml","old_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps:\n - messages:\n - fdsa\non_exit: []\ntriggers: []\n","new_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - lock: true\n steps:\n - messages:\n - fdsa\non_exit: []\ntriggers: []\n","is_delete":false,"is_create":false},{"time":"2026-07-10T12:49:39-04:00","description":"update room 1009","file_path":"data/rooms/intro/1009.yaml","old_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - lock: true\n steps:\n - messages:\n - fdsa\non_exit: []\ntriggers: []\n","new_content":"block_transport: false\ncolor: D3\ndescription: []\nexits:\n south:\n room: 1010\n southwest:\n always_blocked: true\n hidden: true\n room: 1007\n west:\n room: 1008\nhazard: \"\"\nid: 1009\nitem_spawns: []\nmobs: []\nname: 'Room #1009'\nobjects: []\non_enter:\n - steps:\n - messages:\n - fdsa\non_exit: []\ntriggers: []\n","is_delete":false,"is_create":false}],"redo":null} \ No newline at end of file
diff --git a/data/rooms/intro/1006.yaml b/data/rooms/intro/1006.yaml
index 3f8aa24..7bd4af5 100644
--- a/data/rooms/intro/1006.yaml
+++ b/data/rooms/intro/1006.yaml
@@ -1,14 +1,18 @@
-id: 1006
-name: 'Room #1006'
+block_transport: false
color: ""
description: []
exits:
west:
room: 1005
-objects: []
+hazard: ""
+id: 1006
item_spawns: []
mobs: []
+name: 'Room #1006'
+objects:
+ - aliases: []
+ description: []
+ hidden: false
+ name: ""
on_enter: []
-hazard: ""
-block_transport: false
triggers: []
diff --git a/data/rooms/intro/1007.yaml b/data/rooms/intro/1007.yaml
index da75334..ca6c580 100644
--- a/data/rooms/intro/1007.yaml
+++ b/data/rooms/intro/1007.yaml
@@ -1,5 +1,5 @@
block_transport: false
-color: "52"
+color: D3
description: []
exits:
east:
diff --git a/data/rooms/intro/1008.yaml b/data/rooms/intro/1008.yaml
index a7f7d4d..8d8fa28 100644
--- a/data/rooms/intro/1008.yaml
+++ b/data/rooms/intro/1008.yaml
@@ -1,5 +1,5 @@
block_transport: false
-color: "52"
+color: D3
description: []
exits:
east:
diff --git a/data/rooms/intro/1009.yaml b/data/rooms/intro/1009.yaml
index dfa5d46..5a09f22 100644
--- a/data/rooms/intro/1009.yaml
+++ b/data/rooms/intro/1009.yaml
@@ -1,5 +1,5 @@
block_transport: false
-color: "52"
+color: D3
description: []
exits:
south:
@@ -16,5 +16,9 @@ item_spawns: []
mobs: []
name: 'Room #1009'
objects: []
-on_enter: []
+on_enter:
+ - steps:
+ - messages:
+ - fdsa
+on_exit: []
triggers: []
diff --git a/data/rooms/intro/1010.yaml b/data/rooms/intro/1010.yaml
index 48d3947..00c01ad 100644
--- a/data/rooms/intro/1010.yaml
+++ b/data/rooms/intro/1010.yaml
@@ -1,5 +1,5 @@
block_transport: false
-color: "52"
+color: D3
description: []
exits:
north:
diff --git a/internal/admin/static/map.js b/internal/admin/static/map.js
index 7c47b4e..8bd0e2d 100644
--- a/internal/admin/static/map.js
+++ b/internal/admin/static/map.js
@@ -1581,10 +1581,10 @@ function editExitCondition(dir) {
var h = '<h3 style="margin-bottom:8px;font-size:13px">Exit: ' + esc(dir) + ' &rarr; #' + exit.room + '</h3>';
h += '<div class="form-group"><label>Blocked Message</label><textarea id="exitBmsg" rows="2">' + esc(bmsg) + '</textarea></div>';
h += '<div class="form-group"><label><input type="checkbox" id="exitHidden"' + (hidden ? ' checked' : '') + '> Hidden</label></div>';
- h += '<div class="form-group"><label><input type="checkbox" id="exitAlwaysBlocked"' + (alwaysBlocked ? ' checked' : '') + '> Always Blocked (blocked, shown on map)</label></div>';
+ h += '<div class="form-group"><label><input type="checkbox" id="exitAlwaysBlocked"' + (alwaysBlocked ? ' checked' : '') + '> Always Blocked</label></div>';
h += '<div style="margin-top:10px;border-top:1px solid var(--border);padding-top:8px">';
- h += '<label style="font-size:11px;color:#aaa;text-transform:uppercase;letter-spacing:.5px">Conditions</label>';
+ h += '<label style="font-size:11px;color:#aaa;text-transform:uppercase;letter-spacing:.5px">Conditions (Blocked unless these are met)</label>';
h += '<div id="condClauses" style="margin-top:4px"></div>';
h += '<button class="btn btn-sm section-add-btn" onclick="addConditionClause()">+ Add Condition</button>';
h += '<div class="btn-row" style="margin-top:10px">';
@@ -2085,6 +2085,8 @@ function bindTriggerInputSave(container) {
inputs.forEach(function(el) {
el.removeEventListener('input', _triggerInputHandler);
el.addEventListener('input', _triggerInputHandler);
+ el.removeEventListener('blur', _triggerBlurHandler);
+ el.addEventListener('blur', _triggerBlurHandler);
});
var checks = container.querySelectorAll('input[type="checkbox"], input[type="radio"]');
checks.forEach(function(el) {
@@ -2109,11 +2111,12 @@ function _syncTriggersToData() {
function _triggerInputHandler() {
_syncTriggersToData();
_triggersDirty = true;
+ autoSave();
}
-function saveTriggers() {
+function _triggerBlurHandler() {
_syncTriggersToData();
- _triggersDirty = false;
+ _triggersDirty = true;
saveNow();
}
@@ -2154,21 +2157,28 @@ async function doSavePanel() {
var newDir = dirEl ? dirEl.value : null;
var currentDir = (data.file || '').replace(/^data\/rooms\/?/, '').split('/')[0] || '';
+ var idChanged = false;
+ var dirChanged = false;
if (dirEl && newDir !== currentDir) {
await API.post('/api/rooms/move', {id: id, dir: newDir});
+ dirChanged = true;
}
if (newID !== id) {
await API.post('/api/rooms/rename', {id: id, new_id: newID});
selectedRoom = newID;
id = newID;
+ idChanged = true;
}
await API.put('/api/rooms/' + id, r);
notify('Room #' + id + ' saved', 'success');
_triggersDirty = false;
+ saveTimer = null;
updateUndoBar();
await loadMap();
- selectRoom(id);
+ if (idChanged || dirChanged) {
+ selectRoom(id);
+ }
} catch (e) {
notify('Save failed: ' + extractError(e), 'error');
}
@@ -3423,6 +3433,7 @@ function renderEnterExitTab(r) {
}
switchPanelTab(8);
_triggersDirty = true;
+ autoSave();
};
window._ieRenderOnly = window._ieRenderCurrent;
window._ieSyncAll = ie_syncAllInteractions;
@@ -3431,8 +3442,7 @@ function renderEnterExitTab(r) {
{id: 'on_exit', path: 'on_exit', isArray: true, interactionStyle: true, itemIDAllowed: false, label: 'Trigger'}
];
- var h = '<div style="margin:8px 0"><button class="btn btn-primary" onclick="saveTriggers()">Save Triggers</button></div>';
- h += '<h3 style="margin:8px 0 4px">On-Enter Triggers</h3>';
+ var h = '<h3 style="margin:8px 0 4px">On-Enter Triggers</h3>';
h += '<p style="color:#888;font-size:11px;margin:0 0 6px">Fires when a player enters this room. First matching entry wins.</p>';
h += renderTriggerListHTML(r.on_enter, 'on_enter', 'on_enter', false);
h += '<hr style="border:none;border-top:1px solid var(--border);margin:12px 0">';