Skip to content
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

UE4 Compability by template-based backdoor #5

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

Periokumene
Copy link
Contributor

@Periokumene Periokumene commented Jul 19, 2024

Many WIP game developements are still running in UE4. Actually UE4 does not support the code like this TSet<FName> keys = Style->GetStyleKeys(); . And all style members are private, so we cannot use this tool directly on UE4.
Thus, a Template-Based backdoor is used to force access private memebers of FStyleSet in UE4

ps. some user experience optimization is included, including:
1 config serialize FilterString make using not very fluent so Config specifier is removed
2 sort style set name to make them in order

@Periokumene Periokumene changed the title UE4 Compability by magical template UE4 Compability by template-based backdoor Jul 19, 2024
@sirjofri
Copy link
Owner

Hi,

yes, it's very annoying when looking through the source just to find that the most interesting things are private. It's sad that we need a hack for simple things such as getting a list of styles. Your code at least makes it transparent.

Regarding the resetting and not saving the filter string, we can discuss this. Some users might want their filters to be stored, others don't. Also, in the future I plan to implement regular expression support (there's also an issue for that).

I can see you changed the layout of the copy note. Was there a specific reason for that or is it taste?

I'll take a look at it (and test it) when I have a computer that can run Unreal again (I'm currently very limited, sadly).

@sirjofri
Copy link
Owner

Also thanks for working on this. I usually develop only for the most recent version of Unreal, but I'm happy to add support for older versions when people are asking for it and/or sending patches. Having many versions of Unreal installed needs a lot of storage.

@Periokumene
Copy link
Contributor Author

Periokumene commented Jul 19, 2024

Thank you for your reply. So let me respond to your issues one by one:

1: Store FilterString: Yes, I agree with you that it is necessary to keep your regular expression somewhere rather than typing in everytime. But if I just want to search for something like ButtonBrushStyle, it's a little bit confusing that the next time when I open the window but should delete the last FilterString at first.....Maybe some complex setup should be stored somewhere else, like another optional input box or combobox for many presets.

2: Layout of the copy note changed: I think it's better. I make the FormatCodeExampleText bold and place it at the beginning of the line to make it outstanding because there is no other way for us to show which CopyCodeStyle are we chosen

ps. Now the tool only exposed all ImageBrushes of StyleSet, but it cannot visualize the widgetStyle, ColorPreset, Font
But since we can expose them by template backdoor, a much more detailed visualizer can be developed to present them

I think it's interesting and helpful to my current work (it's also why I hack it to support UE4, that's our project version lol). And I'm considering and I might developing it just as I mentioned above.
But before that, I want to know whether you already have any similar plans in the next period of time? Conflicted and redundant works should be avoided.

@Periokumene
Copy link
Contributor Author

well, I give it a try and the result look not bad.
image

@sirjofri
Copy link
Owner

That's a great idea. I like both the font visualization and the style line in the bottom.

Regarding the filter string: I understand it. I'd just look at how other tools do it (like the statistics window) and see if it's good to follow their way or not. I can personally live with both.

What does the copied style string for fonts look like? Do you have an idea about widget style preview?

@sirjofri
Copy link
Owner

For the next period of time, I do have plans to invest more time into tools, but (1) I'm still waiting for my computer, and (2) I need input. I plan to get input while working on games and other projects, but I first need to settle a few organizational things. For this tool specifically, I just didn't think about the other style components. My plans currently were to just address the existing issues.

@Periokumene
Copy link
Contributor Author

Hi
I just made some...big changes over this tool, especially about Widget, including an individual tab widget and polymorph-based impl struct to handle different style behavior (Brush, Widget, font...)
I think it's necessary for better widget visualization and future maintenance. But I dont know whether will you like my coding style....Anyway, I will create another PR (after this PR got merged), and we can talk about this issue later.

If you are interseted, you can come to my forked repo and see details directly. The branch named feature_detailVisualization
image

@sirjofri
Copy link
Owner

I glanced through it and it looks very promising. I really hope to get my computer soon so I'll be able to properly browse it and test it.

If it's fine with you, I'd like to contact you via some non-public channel to ask you a few questions, since you're actually using the tool. I wasn't able to find any way to contact you directly, could you drop me a message? Mail, discord, ...

@Periokumene
Copy link
Contributor Author

I glanced through it and it looks very promising. I really hope to get my computer soon so I'll be able to properly browse it and test it.

If it's fine with you, I'd like to contact you via some non-public channel to ask you a few questions, since you're actually using the tool. I wasn't able to find any way to contact you directly, could you drop me a message? Mail, discord, ...

hi, periokumene is my discord id, feel free to contact

@sirjofri
Copy link
Owner

sirjofri commented Nov 5, 2024

Hi @Periokumene,

I took a more detailed look at the code and I'd like to include a few things as they are, mostly the sorting and other usability features. I'd also like to include other things you built, like the other styles and the fonts (if they are already far enough).

Regarding the hack about accessing private members in UE4, I'm still thinking about the best solution. I don't like hacks like that at all, but I understand that supporting UE4 without that hack is basically impossible. I was thinking about making it a separate branch, but I also don't see a reason for that. I guess if we make sure that the hack is clearly named and excluded in UE5-builds, it should be fine.

Is it possible to merge these changes to a separate branch so I can make a few refinements and tests before merging it back to main?

@sirjofri
Copy link
Owner

sirjofri commented Nov 5, 2024

And sorry for the late reply. I finally got my computer!

@sirjofri sirjofri changed the base branch from master to ue4-compat November 5, 2024 12:15
@sirjofri sirjofri merged commit 9eeab9e into sirjofri:ue4-compat Nov 5, 2024
@Periokumene
Copy link
Contributor Author

Actually, usability about font and widget exposing also depends on hacking... i did not review the UE5 part about whether can i look through all FWidgetStyle directly, but i guess the answer is no. I will do some more detailed ensurements about this later But maybe next week? I'm very very busy recently (lol).

But if we focus on only this issue. UE4 compability, i think it's ok since hacking is a dangerous action

@sirjofri
Copy link
Owner

sirjofri commented Nov 8, 2024

I merged it into a separate branch, and I made it compile again on UE5 (5.4, but should be fine for other versions of 5, too). I currently don't have UE4 installed, so it's harder for me to test.

Have you seen my messages on discord about your other interesting changes (fonts, ...)?

@Periokumene
Copy link
Contributor Author

I merged it into a separate branch, and I made it compile again on UE5 (5.4, but should be fine for other versions of 5, too). I currently don't have UE4 installed, so it's harder for me to test.

Have you seen my messages on discord about your other interesting changes (fonts, ...)?

sorry i do not check up discord frequently, i have responded to them now

@Periokumene
Copy link
Contributor Author

as for UE4, i will do a test in two days, but i also only have 4.26 installed in my Engine, i might cannot check each version one by one (lol)

@sirjofri
Copy link
Owner

Haha, obviously! I'd say, check it on your version, if that works I can package it for that version (and include it to the build.bat). If someone else makes it work on 4.27 or other versions they can send a patch. I don't want to invest too much time into UE4 anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants