-
-
Notifications
You must be signed in to change notification settings - Fork 264
Fix Custom Styles not working #2582
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
Conversation
@@ -46,16 +48,16 @@ static func get_fallback_style() -> DialogicStyle: | |||
|
|||
|
|||
static func get_style_path(name_or_path:String) -> String: | |||
var path := "" | |||
print(style_directory) |
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.
Thanks for the fix! Did you mean to leave in this print statement by the way?
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.
No, my bad 🙈 Will push a fix later!
if name_or_path.begins_with("res://"): | ||
if not ResourceLoader.exists(name_or_path): | ||
name_or_path = "" | ||
|
||
if name_or_path in style_directory: | ||
path = style_directory[name_or_path] | ||
name_or_path = style_directory[name_or_path] |
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.
This function seems like it has a side effect of modifying the input argument name_or_path
. Is that intentional?
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.
Well it's returning the name_or_path variable later and because there is a chance the original value passed into the function is already the path I skipped creating a separate value. Strings are not passed by reference afaik, so this shouldn't be a problem I think.
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.
Makes sense. Worth testing quickly though. Strings can potentially be very large, so I would have assumed they are passed by reference in GDScript but happy to be proven wrong.
Some mistakes on a recent PR made custom styles not be used at all 🙈.
Should fix #2577 and #2580 as well as a bunch of peoples issues on discord.