diff options
| author | historia <[not public]> | 2026-07-01 04:53:56 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 04:53:56 -0400 |
| commit | bf7c27c2cbf3eb56a0a4c5141e39b152c51614b5 (patch) | |
| tree | 5383c325fafeb34c01ea737a7070402f040fc5af /internal/admin/api_rooms.go | |
| parent | fbe5090ac3325ff8ea6989cdf4515c7f077c975b (diff) | |
| download | thehouseoficarus-bf7c27c2cbf3eb56a0a4c5141e39b152c51614b5.tar.gz | |
feat: admin gui map, item, and objects mostly complete
Diffstat (limited to 'internal/admin/api_rooms.go')
| -rw-r--r-- | internal/admin/api_rooms.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/internal/admin/api_rooms.go b/internal/admin/api_rooms.go index f615d9d..76bb11c 100644 --- a/internal/admin/api_rooms.go +++ b/internal/admin/api_rooms.go @@ -78,6 +78,8 @@ func (s *AdminServer) handleRooms(w http.ResponseWriter, r *http.Request) { m["exits"] = exits } + var extraFiles []ExtraFile + if linkFrom != nil && linkDir != nil && *linkDir != "" { dir := world.ExitDir(strings.ToLower(*linkDir)) if opp, ok := world.OppositeExit[dir]; ok { @@ -99,11 +101,10 @@ func (s *AdminServer) handleRooms(w http.ResponseWriter, r *http.Request) { writeJSON(w, map[string]any{"error": fmt.Sprintf("write source room: %v", writeErr)}) return } - s.undoStack.Push(ChangeDesc{ - Description: fmt.Sprintf("update room %d (add exit %s to %d)", *linkFrom, *linkDir, id), - FilePath: srcPath, - OldContent: oldContent, - NewContent: newContent, + extraFiles = append(extraFiles, ExtraFile{ + FilePath: srcPath, + OldContent: oldContent, + NewContent: newContent, }) } @@ -124,6 +125,7 @@ func (s *AdminServer) handleRooms(w http.ResponseWriter, r *http.Request) { FilePath: path, NewContent: newContent, IsCreate: true, + ExtraFiles: extraFiles, }) writeJSON(w, map[string]any{"room": m}) |
