Override Popup to quickly override superclass functions
This is the implementation of my idea in https://github.com/Maran23/script-ide/pull/98.
With ALT+INSERT, you can now open the override dialog which will then show you all functions that can be overridden.
Everything needed is only performed when the shortcut is pressed, so this will not slow down the main plugin at all.
Supersedes: https://github.com/Maran23/script-ide/pull/98 @CodeNameTwister, you may want to check it out!
Well i finish too 🤣
I'll see the pull now
EDIT: I've updated my fork.
You can test the functionality by right-clicking (RMB) in the script editor or RMB in scripts selector. I've attached an image.
From what I've been reviewing, our idea is the same.
The difference is that your code allows overriding all functions, while mine is limited to virtual functions only.
There will be people who like to see all the methods so it's worth it.
Check out my fork, in case you find anything interesting.
Mine only captures virtual functions.
https://github.com/CodeNameTwister/script-ide
I like your approach with showing all native functions as well. I will have a look on this one too! I feel like we are going in a nice direction! :)
You guys are onto something here - I actually use this branch instead of master, because Godot won't auto-complete overriding methods. So there's dire need for this functionality.
It's good and functional the way it's implemented now, quick selection works acceptable, even though I'd prefer it to work similar to the outline where text input would filter the list of overridable methods, and you get to choose the target method with the arrow keys + enter. I understand the benefit of the current approach is to override multiple methods at once, but the filter+arrow+enter approach would be so much faster. I would go so far to suggest dropping the multi-selection in favor of a fast single-selection. but maybe it's even possible to allow multi-selection in the filtered-method-list ui element?
You guys are onto something here - I actually use this branch instead of master, because Godot won't auto-complete overriding methods. So there's dire need for this functionality.
It's good and functional the way it's implemented now, quick selection works acceptable, even though I'd prefer it to work similar to the outline where text input would filter the list of overridable methods, and you get to choose the target method with the arrow keys + enter. I understand the benefit of the current approach is to override multiple methods at once, but the filter+arrow+enter approach would be so much faster. I would go so far to suggest dropping the multi-selection in favor of a fast single-selection. but maybe it's even possible to allow multi-selection in the filtered-method-list ui element?
I refined the override functionality tool, there are many ways to override settings depending on who inherits, so manual selection is preferable.
Let me know if you need any changes. I'll continue updating my GitHub content for another two weeks before focusing entirely on my main project.
Repository: https://github.com/CodeNameTwister/GD-Override-Functions
It's good and functional the way it's implemented now, quick selection works acceptable, even though I'd prefer it to work similar to the outline where text input would filter the list of overridable methods, and you get to choose the target method with the arrow keys + enter. I understand the benefit of the current approach is to override multiple methods at once, but the filter+arrow+enter approach would be so much faster. I would go so far to suggest dropping the multi-selection in favor of a fast single-selection. but maybe it's even possible to allow multi-selection in the filtered-method-list ui element?
Thanks for the feedback! I will have a look, it should be possible to implement a filter! And if we add all native classes as well, we probably need it anyway.
Thank you guys for your amazing work! @CodeNameTwister going to check out your version later today :+1:
Another feedback: I noticed the override would be inserted at the end of the file. Would be cool if it was inserted at the cursor position, given it's a blank line.
Another feedback: I noticed the override would be inserted at the end of the file. Would be cool if it was inserted at the cursor position, given it's a blank line.
Makes sense, other IDEs do the same. We just need to be careful to not override user content of course.
@mrimvo Feel free to retest! Now with a filter. Keyboard navigation is very bad and not really to implement on the Tree right now. I hate this Control because of it. I think I might go with multiple ItemList instead, that you can expand/collapse. But that is more work, so I think this is good enough for now. :)