-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QtFRED campaign editor #3392
QtFRED campaign editor #3392
Conversation
3814f35
to
53e30ba
Compare
model String conversion should happen on load/save, not every UI update/cahnge
functionality
model by loading campaign file
so qtfred can load them fro outside the cfile tree.
(cherry picked from commit 0ed5a18)
Make necessary changes and improvements in model usage.
Unlike FRED, I'm using a checked list of all missions, not a simple list of the unused ones. I'm showing uneditable / packaged missions in yellow, missing / unloadable missions in red. Also keeping missions loaded.
Since the campaign type determines the compatible missions, changing it would require invalidating the mission list. So I'm restricting it to being set on campaign creation.
(cherry picked from commit 9959cda)
because it won't be shown for re-selection after next load of campaign
according to first mission.
editable cmission data Also make CheckedDataList construction translator callbacks explicitly const.
@the-maddin Can you incorporate the bugfix in #4341 into this PR? |
I didn't implement an error checker, so this fix does not apply. I'm using the in-game parsing functions as far as possible, so the bug did not appear. My UI is hopefully somewhat stricter than FRED in preventing invalid data. |
The dialog should still have an error checker. There are actions the FREDder could take, such as setting the middle campaign branch to true, that are perfectly valid from a UI sense but still errors from a design sense. And others, like the |
I'm doing this particular check when saving the campaign. I'll take another look at FRED's implementation of the error checker, but I do believe that error checking should not be different from saving a copy. |
numbered to reflect campaigntreewnd.cpp
@Goober5000 I've itemized the error checks in comments. Now tagged with the same numbers, I've expanded my "live" input validation to prevent the user from giving these kinds of bad input. It should be rather easy now to verify this simply by searching for a check number. |
Having resolved resolved previous change requests as far as I'm currently able to, I'd like to re-request reviews. |
@the-maddin thanks for the updates! Assuming that you've tested the functionality your PR adds, then I'm good with the PR whenever @z64555 is. Note that, per the 22.2 RC cycle's feature freeze, even once the PR is approved, merging will need to wait until after 22.2 becomes Final. Thanks again for taking the time to make this. |
void connect(const SCP_unordered_set<const CampaignMissionData*>& missions); | ||
|
||
// constants | ||
enum BranchType { INVALID, REPEAT, NEXT, NEXT_NOT_FOUND, END, }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What namespaces do the enumerations show up with? (INVALID, REPEAT, NEXT, etc.)
@the-maddin It looks like there are a few unaddressed comments from jg18 and z64555. Could you take another look at this? |
AFAIK, jg18 is ok with the current state of the PR. |
Since its been a few months I forget what exactly I was trying to hint at with the namespace question, maybe I was trying to push you towards using |
This enum is nested two classes deep, and private to the outer class, so I never felt it was worth the effort to add another namespace for type safety. It only ever gets used in the most straightforward way of indicating an object's state. |
Yeah uhm, The You must either use a namespace bracket to scope them, or use Possibly the least-effort fix here is to just put in |
Declaring the enum inside a class has exactly the same effect as declaring it inside a namespace. Outside the inner class When used inside |
All right, either I'm remembering an ancient bug that's been addressed last century or misremembering how enum's scope. |
If @jg18 is ok with the current state of the PR, as mentioned in a comment above, then we can merge this. |
Per comment above, jg18 is ok with the PR
First steps to implement #1693
Currently implemented as viewer-only of campaign files.
Lacks ability to add and properly modify branches, a campaign tree view, and saving of edits.
It also says so in a warning dialog on launch. I'd like to get it merged in this stage to get some feedback,
because I've done some things differently than they were done in FRED.
I'm making some changes to other parts of the code: Campaign names get stored with full paths,
so I can open campaign files with the qt filechooser everywhere, qtfred loads subsystems mainhalls,
cutscenes, and ranks to populate default campaign options, clang fixes in main.cpp and some changes
to my checked data list model.