12 Commits
Author SHA1 Message Date
Goober5000andClaude Opus 4.8 41ce07b33a Extract common name conflict checker for FRED2 and qtFRED
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) <[email protected]>
2026-07-31 00:26:07 -04:00
Goober5000 1dc68b28c2 add waypoint_stuff_name
A consistent friendly way to get a waypoint name.  Follow-up to #7103.
2025-11-02 01:00:57 -04:00
Goober5000 6d03ce1c13 make clang happy 2025-10-31 21:12:49 -04:00
Goober5000 cb3a17a404 fix FRED and QtFRED handling of waypoint names
First, fix a crash reported in Discord: prevent FRED or QtFRED from giving a waypoint list a name that is too long.

Also fix the updating of references, including for the constituent points, if a waypoint list is renamed.
2025-10-29 00:24:09 -04:00
Goober5000 c8d78816b0 remaining const updates 2023-10-20 15:32:46 -04:00
Goober5000 d1f0b9343f change iterators 2023-10-20 14:58:18 -04:00
mjn-mixael 78b957982b enhance jump node handling 2023-05-12 15:30:41 -05:00
Goober5000 731b5d53c5 change case 2023-02-17 21:50:42 -05:00
Goober5000 7b0a8eff9e change REF_TYPE_* to enum class 2022-12-16 19:41:45 -05:00
Goober5000 b404b137a0 guard against off-by-one errors in replace_one and replace_all
Also add some test cases for checking correct behavior.
2022-05-07 15:08:21 -04:00
Goober5000 e1bbbf9f9a ships, wings, etc. can share names with teams
Partial revert of Mantis #2053:
http://scp.indiegames.us/mantis/view.php?id=2053

The patch was speculative and there was never a confirmed bug.  By contrast, there are plenty of existing missions that use Unknown as a ship, wing, or jump node name and work just fine.
2021-08-03 22:06:57 -04:00
asarium 1bcd5400d3 Move build system to CMake 2016-07-22 12:07:19 +02:00