-
Notifications
You must be signed in to change notification settings - Fork 7
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
Various Fixes #8
base: master
Are you sure you want to change the base?
Conversation
Merge from upstream
{ | ||
// ImGui::InputText() with std::string | ||
// Because text input needs dynamic resizing, we need to setup a callback to grow the capacity | ||
IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); |
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.
I'm going to be honest and say that I wouldn't want to merge this in our fork. Taking a std::string
by pointer is prone to error, it should be a reference for safety's sake. Moreover, user data holding a pointer to the std::string
is also pretty suspect, and it would make more sense for it to hold a reference as well.
Though in all honesty, I would prefer this use FString and forgo the std library entirely.
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.
I did get that code directly from the main imgui repo so I suspect it has had a decent amount of review. I am using it my application as an alternative to char* strings without issue.
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.
I did get that code directly from the main imgui repo so I suspect it has had a decent amount of review. I am using it my application as an alternative to char* strings without issue.
Certainly, but the issue isn't that the code doesn't work, it's just super easily abused. Plus I feel it makes a lot more sense to reuse unreal types where possible, since they'll be far more common in game code. To each their own though – and admittedly I understand not rewriting sample code for this purpose. :)
Will pull this into our repo and test these changes on Monday. |
If you do, I would suggest @JordanSchlick update the I also found the ResetInput stuff to be a bit unnecessary, and a more concise fix would be updating
Otherwise the rest of this stuff is great, particularly the viewport fixes, though I didn't get a chance to test the other two settings for Also I apologize for dropping in out of nowhere on this issue; I was trying to find a fork that's currently being maintained to upstream to and came across this one. So I wanted to drop in and leave a quick code review on this PR since this is the fork we'll end up using, and these changes include a number of nice fixes. |
Thanks for the info. I've been meaning to update this with our studio's changes but we've been really busy...hopefully next week I will have enough down time on the programming side that I can actually update this repo with the much needed pushes. |
I implemented and tested the suggested changes involving InputHandler and Strncpy. |
Added imgui std::string lib
Fixed resetting input on release
Fixed Linux compilation errors
Updated for unreal 5.2
Improved canvas viewport sizing
This code has been tested in OpenStorm