This document maps the main user-facing actions in SSFEdit to the units that own them. Use it when deciding where a change belongs before modifying code.
- The app starts the main form and the modal entry form.
- If the first CLI argument is an existing
.ssfpath, the app attempts to load it immediately.
USSFEdit.dprinitializes the application, creates both forms, and handles the optional first CLI argument.SSFEdit.pasprovidesLoadFile, which executes the actual load flow.
- The app asks for
dialog.tlkbefore it can load an SSF file or create a new one. - If no TLK file is selected, the operation aborts with a warning.
SSFEdit.pasmanages the TLK-open dialog, thel_tlkloadedstate flag, and the abort paths for missing TLK input.UTLKFile.pasowns the TLK file parsing once a path is chosen.
- The app opens a soundset file, validates its format, reads all 40 slot values, and displays their resolved TLK sound/text metadata in the grid.
SSFEdit.pasButton1Clickdrives the interactive open-file flow.LoadFiledrives the startup autoload flow.RefreshGridandGetTlkStringpopulate the visible grid content.
UTLKFile.pasprovides TLK resolution data.USSFFile.pascontains a reusable SSF reader, but the main form currently performs its own SSF stream reads instead of delegating to it.
- The app initializes a blank 40-slot soundset after a TLK file has been selected.
- Every slot starts unset.
SSFEdit.pasbtnNewClickowns the new-file flow.RefreshGridrebuilds the blank grid state.
- Selecting a row enables editing controls.
- Updating the
StrRefand clicking modify rewrites the in-memory slot value and refreshes the display.
SSFEdit.pasgridSndClickupdates the selected-row UI.btnModifyClickapplies the editedStrReftol_entries.edStrRefKeyPressrestricts input to numeric-compatible edit operations.
- The user opens a modal dialog, enters text and a sound resref, and saves.
- The app appends a new TLK entry and assigns its new
StrRefto the currently selected SSF slot.
UEntryForm.pasowns the modal input form.SSFEdit.pasbtnAddTlkClickowns the append workflow.- It converts the entered resref into a fixed 16-byte buffer, sets TLK flags, normalizes text, appends the entry, and updates the selected slot.
UTLKFile.pasAddEntryappends the new TLK record and incrementsStringCount.
- If TLK data was modified, the app prompts to save the TLK file first.
- The app then prompts to save the SSF file.
SSFEdit.pasbtnSaveClickowns the save flow and save prompts.- The main form writes SSF bytes directly.
UTLKFile.pasSaveTlkFilewrites the full TLK structure.
UST_Common.pasand local message-box helpers support prompts and writable-file behavior.
- Change
USSFEdit.dprwhen the startup, CLI, or form creation behavior changes. - Change
SSFEdit.paswhen the main UI flow, grid behavior, or save/open orchestration changes. - Change
USSFFile.paswhen the reusable SSF serializer changes. - Change
UTLKFile.paswhen TLK parsing, writing, or append semantics change. - Change
UEntryForm.paswhen the add-entry modal itself changes. - Change
UST_Common.pasorStoffeUtils.pasonly when a shared helper behavior actually belongs there.
ARCHITECTURE.mdfor the unit map and runtime flowdocs/file-formats.mdfor SSF and TLK structure detailsdocs/manual-validation.mdfor the checks to run after workflow changes