Extract common name conflict checker for FRED2 and qtFRED - #7630
Open
Goober5000 wants to merge 1 commit into
Open
Extract common name conflict checker for FRED2 and qtFRED#7630Goober5000 wants to merge 1 commit into
Goober5000 wants to merge 1 commit into
Conversation
The ship editor, wing editor, waypoint path dialog, and jump node
dialog all had near-identical code to check whether a new name
conflicts with an existing ship, wing, waypoint path, jump node, or
target priority group (or is empty, or begins with '<'). Both FRED2
and qtFRED carried their own copies of this logic.
Extract it into a single check_name_conflict() function in
code/missioneditor/common.cpp, shared by both editors, and replace the
duplicated validation at each call site with a one-line call:
- FRED2: shipeditordlg, wing_editor, waypointpathdlg, jumpnodedlg
- qtFRED: ShipEditorDialogModel, WaypointEditorDialogModel,
JumpNodeEditorDialogModel, and Editor::validate_wing_name
This also aligns a few small behavioral differences that had crept in
between the two editors: the waypoint and jump node dialogs now skip
empty wing slots (wave_count == 0) when checking for wing-name
collisions, and the qtFRED wing editor now rejects names beginning
with '<'.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Goober5000
force-pushed
the
claude/extract-name-conflict-checker
branch
from
July 21, 2026 00:28
fa59922 to
f6f1fd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ship editor, wing editor, waypoint path dialog, and jump node dialog all had near-identical code to check whether a new name conflicts with an existing ship, wing, waypoint path, jump node, or target priority group (or is empty, or begins with '<'). Both FRED2 and qtFRED carried their own copies of this logic.
Extract it into a single check_name_conflict() function in code/missioneditor/common.cpp, shared by both editors, and replace the duplicated validation at each call site with a one-line call:
This also aligns a few small behavioral differences that had crept in between the two editors: the waypoint and jump node dialogs now skip empty wing slots (wave_count == 0) when checking for wing-name collisions, and the qtFRED wing editor now rejects names beginning with '<'.