Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Added the ability to change the text: Click to Unlock. As well as level and cost. #3977
Added the ability to change the text: Click to Unlock. As well as level and cost. #3977
Changes from 6 commits
85641f1
b165697
758ffd3
55df137
d9ecede
a27e1b7
a6f7737
a1de6b5
920e094
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
the message key should be lowercase and use hyphens (
-
) to connect words.And I don't think string concatenation is good here, better use placeholder.
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 i should not be Lowercase it works with this setup! :)
After all, I tested everything before the request!
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.
The key should be lowercase, or it will break the naming convention.
Also, consider using a placeholder instead of concatenating 3 parts for the cost line.
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.
Hmmm did you mean "getMessage" or "getMessage(p, "guide.Cost")"
Should it be named getMessage(p, "guide.cost") ?
The red line shows the original.
Below is my slightly changed line
No placeholder was used there either. Do I know any placeholders that are marked with %? correct?
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.
Yes it should be "guide.cost" the whole key should be lowercase.
As for the formatting and placeholders look at the javadocs or some examples for the String#format method to find how it works.
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 don't think I need to read about it because the original code, i.e. the red line, doesn't use a placeholder either. It's actually a function query called research.getCost() its not a placeholder so please explain to me exactly what you mean by placeholders?
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.
Better keep the original
Click to unlock
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 personally dislike the space here, I think the language file should not include this space and move the space to the code. Not sure how other feels about this one. Any suggestion on this?
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.
Agree
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.
without the spaces the languagewords is combined so in the lore stands without them cost1Level(s)
So i add the Spaces for it.
i dont know how to add spaces in the code by "&7" + Slimefun.getLocalization().getMessage(p, "guide.cost") + research.getCost() + Slimefun.getLocalization().getMessage(p, "guide.level"))) in line 292 at SurvivalSlimefunGuide.java
so i add spaces in the message key to solve this. Even if it's probably wrong.
I'm still pretty new.
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.
on my local machine i removed for testing the spaces in the message keywords... the result is watching the picture.
To solve this i add spaces ...
Or for better understand how can i add spaces in the code add line 293 at SurvivalSlimefunGuide.java