-
Notifications
You must be signed in to change notification settings - Fork 359
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
Feature: Porting MFC tools #649
base: master
Are you sure you want to change the base?
Conversation
incl. dhewm3-specific adjustments to imgui_impl_opengl2.cpp (two additional qgl #defines)
c2dcc80 Docking: fixed ImGuiWindowFlags_DockNodeHost / ImGuiWindowFlags_NavFlattened clash introduced by c38c18c just for 1.91.7 (#8357) 1.91.7-docking crashed when opening the dhewm3 settings window, now this issue is fixed upstream so upgrade to the latest code.
using commit 719e925b2eabeef "Started to simplify the light editor" (afterwards they started integrating ImGuizmo, let's do that later once things work...) compiles (without AfEditor), but not functional yet
seems to work! at least as long as the MFC tools are disabled
unless ImGui is disabled, then use the MFC one, unless that's also disabled, then just print a warning
shows a little grey overlay window with given text in the upper left corner of the window
- functionality is the same as the old dialog (video/audio editing does not work)
Thank you very much! The screenshot looks pretty good :) I'll look at the code later; are the questions from #647 (comment) regarding modal dialogs and layout still open or have you figured that out already? |
I think I figured modals out. The code:
translates to the opening of the dialog:
and it's drawing & output handling routine:
Yes, I wanted to have a 3-column layout like in the original MFC dialog and have it scale or change according to the available space. For this dialog, I think the fixed layout will suffice, for other dialogs we may have to get creative. There is also the issue that the window position is reset when PDA is selected. |
Ok, I'll have a look! By the way, did you check out the ImGui Demo (open Dhewm3Settings menu with F10 -> Other Options -> [Show ImGui Demo])? |
Thank you, I'll check it out! |
- the name of the window passed to ImGui must be stable
@DanielGibson Table layout works nicely! Also, fixed the reappearing window bug: the name of the window passed to ImGui must be stable. |
That's awesome! Regarding the stable title: You can use Simlarly, you could use for example |
I know this was already the case in the original PDA editor, but I wonder why the buttons in the left pane use "Add" and "Del" while the others use "Add..." and "Delete..." Also, I just tried that "Add" (PDA) button and it asked me for a name and I entered it and clicked ok, but the modal didn't close (neither when clicking cancel or pressing escape or anything else). The .pda file was written, though. |
A problem with the ImGui-based ingame editors is that when clicking into the game window the cursor is grabbed by the game again (because then the ImGui window doesn't have focus anymore) and it's hard to get it back. I feel like the ingame editor integration could overall be better, maybe with a command to launch a menu that allows launching and editor; that command could also free the mousecursor?
except for the ones that already were in the ImGui namespace
In https://github.com/DanielGibson/dhewm3/tree/imgui-tools I have (based on your branch) integrated the AfEditor and also modified |
} | ||
|
||
void PDAEditor::OnBtnClickedPDADel() | ||
{ |
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.
maybe this could be implemented like
idStr fileName = "newpdas/";
fileName += pdaName; // TODO
fileName += ".pda";
fileSystem->RemoveFile( fileName );
I just tried to implement deletion, cannot get it to work. The Decl manager keeps a copy of PDA decl in memory, so even if the file is deleted, it will still get re-created.
Fixed that. I'll add the missing dialogs for audio & video and include this fix. |
Interesting. Looks like the idDeclManager doesn't support removing decls at all - that's weird. |
@DanielGibson Should I do a PR to your branch or to the main repo? (I've just updated |
You could update your tools-porting branch with my changes (either merge or rebase, I don't care) and continue to work on that. I don't think we need a new PR for them, let's just keep this here |
This adds editors ported from MFC and builds on top of imgui-docking.
Currently ported tools: