The Editor Was Replaced
An editor sidebar, window manager, and subdirectory import support.
| Last updated | 2 weeks ago |
| Total downloads | 84 |
| Total rating | 0 |
| Categories | Mods |
| Dependency string | LoreleiAurora-The_Editor_Was_Replaced-1.1.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2305README
The Editor Was Replaced
A BepInEx 5 mod for The Farmer Was Replaced that adds a proper editor experience around the game's floating code windows - a file sidebar, real subdirectory support with dotted imports, improved external file watching, and settings that ride the game's own options menu.

Features
- Sidebar file tree - one row per code file, grouped into collapsible folders (the Folder Folder chevron row opens and closes them). Open files have brighter rows, closed ones are dimmed. Drag the sidebar's right edge to widen it; the width is remembered per save.
- Per-row buttons - run/stop (works while the window is closed; while code runs the button becomes the red stop button, stoppable between steps) and an optional delete button that removes the file from the save through the game's own confirmation.
- Top button row - search toggle, new file, expand all, collapse all, close all windows, and refresh (rescans the save directory).
- Search - filter the tree by name; focus keybind (Ctrl+K by default); while the box holds text, Escape clears it first instead of opening the pause menu.
- Output console bar - the game's output page becomes a Chrome-style console docked at the bottom edge beside the sidebar: an always-there strip with an unread dot, expand/clear buttons, read-only selectable text, wheel scrolling, a drag-to-resize top edge, and a Ctrl+J toggle keybind. The game's warning icon expands it; size and state are remembered per save.
- Subdirectories & dotted imports -
utils/helpers.pyis importable asimport utils.helpers; files live in real subdirectories on disk and round-trip through the game's save. - Own window titles - per-window rename via the game's own validation, hide buttons, and a trash icon on the file-window close button (closing a file window deletes the file from the save).
- External file watching - the game's watcher becomes recursive and delete-aware: files created, changed, deleted or renamed outside the game open, update, and close their windows automatically.
- Code indenting - a "code indent" option (2 spaces / 4 spaces / tab); in 2-space mode the editor also handles multi-line indent/unindent and converts typed tabs.
- Settings - hide default file windows (on by default), focus sidebar
search keybind, sidebar indent, show file paths (off), show delete
buttons (off), code indent - persisted in the game's own
options.txt. - Per-save memory - every save remembers expanded folders, hidden windows and search visibility, and restores them on load.
- Docs page - an in-game documentation page (i button → General Info)
explaining every button with its icon (
assets/tewr.md).
Build & install
Requires the game installed via Steam (auto-detected; override with the
TFWR_GAME_DIR environment variable). The build references the game's
managed assemblies and copies the mod DLL into BepInEx/plugins/.
make prepare # set up hooks + environment
make build # build + copy to BepInEx/plugins
make run # launch the game with the mod loaded
make format # dotnet format (also enforced by a pre-commit hook)
make decompile # refresh decompiled game sources into decompiled/
Project layout
src/
Core/ Plugin (BepInEx entry), PluginInfo, Patcher (registers every Harmony seam)
Api/ GameApi - reflection facade over the game's internals (per-subsystem partials)
Shared/ UiFactory, EmbeddedResources, SavePaths, ModIcons
Options/ ModOptions (names), ModConfig (typed getters), GameOptions, OptionsPatches
Docs/ ModDocs, DocsPatches, DocsIcons (inline docs icons)
Editor/ CodeIndentPatches, ImportPatches (code-editing seams)
CodeFiles/ CodeFilesPatches (save side), WorkspaceFiles (load side),
WatcherPatches (thin adapters), ExternalFileChanges (runtime service)
Sidebar/ SidebarPanel + tree/rows/search/top-buttons,
ScrollPatches, GameInputPatches, StatePersistence
Output/ OutputBar (docked console), OutputPatches (output-page
redirect), OutputResizeHandle
Windows/ EditorWindows (registry), TrackedWindow, WindowTitleUi,
WindowChrome, WindowCapturePatches
assets/ embedded icon PNGs, the packed docs atlas, the in-game docs page
tools/ atlas build scripts (make-atlas.sh, normalize-atlas.py)
License and credits
Code: MIT, see LICENSE.
The sidebar and docs icons are from [Font Awesome Free] (https://fontawesome.com), licensed [CC BY 4.0] (https://creativecommons.org/licenses/by/4.0/). The docs atlas also draws two glyphs (the sidebar's run and stop markers) procedurally.