Add edited scenes mouse forward / back navigation - #122715
Conversation
|
Related #118837. |
|
That just reminded me that I haven't tested for double input handlings yet with e.g. the script editor, which probably is an issue right now. Will fix as soon as I have a mouse available again to test. |
I just tested and it doesn't work properly. Scene tabs hijack buttons from script editor. |
c3d0ee4 to
cb923fb
Compare
|
Fixed it |
d56e290 to
494941e
Compare
371738c to
f5d6299
Compare
KoBeWi
left a comment
There was a problem hiding this comment.
Works correctly now. Left some comments on the implementation.
| block_input = p_block; | ||
| } | ||
|
|
||
| void EditorNode::input(const Ref<InputEvent> &p_event) { |
There was a problem hiding this comment.
Any reason why not use unhandled_input() for the navigation? There would be no conflict with set_process_input() then.
There was a problem hiding this comment.
It would be better, but I tried to stay close to the existing implementation for Script Editor which does it just like this. Ideally inputs should be set as handled and the code moved to _unhandled_input, but I would suggest only doing so in both locations simultaneously, as otherwise priority can't be resolved properly anymore because of different input loops.
|
|
||
| // Discard old forward history by only keeping history until the current index | ||
| tab_history.resize(tab_history_pos + 1); | ||
| tab_history.push_back(p_history_id); |
There was a problem hiding this comment.
Since you are doing resize, you could resize +1 more and set the last element instead of appending.
There was a problem hiding this comment.
I can do that, though existing codes seems to prefer this way, I tried to be consistent with it
f5d6299 to
d8e27d9
Compare
d8e27d9 to
7868872
Compare
What problem(s) does this PR solve?
Adds navigation between recent opened scenes with mouse forward and back buttons
Additional information
I didn't manage to make keyboard shortcuts with alt+arrow work as in the script editor as various other UI parts consume any arrow key inputs beforehand. With some changes there this could be made possible. I also didn't add UI arrow buttons yet because of space considerations, but maybe it would be a a good thing.
The implementation could also be expanded in a separate pr to include node selections as history points, as e.g. seen in script editors with caret positions, if that would be desired..
Verification
scene_navigation_validation.mp4