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

Add ability to display bee lore and add Discoverd by tag #79

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

Nilau1998
Copy link

@Nilau1998 Nilau1998 commented Sep 1, 2024

The Forestry description within language files previously has only been used in the Beealyser. Probably nobody ever saw that there.
In the future if people add more bees and maybe want to add some own story to it, others will be able to see it within the tooltip by holding ctrl-shift.
full_bee_desc

Additionally the "Discovered by" tag was added to the tooltip which is always shown when holding shift. This goes along the idea that crops already provide this feature. This also gives the give credit to those who may add bees.. well or those who want to add more lore.

partial_bee_desc

If no lore is provided, then the tooltip just doesn't show any. Same with goes with the discovered by, if no name is placed, than nothing is shown.

The code works by expanding the already existing for.description.species localizations in the lang files. I simply added another | token for the Discovered by.

for.description.speciesMeadows=Infests mostly plains in temperate climates; Mostly docile.|Beekeeping 101

Turns to:

for.description.speciesMeadows=Infests mostly plains in temperate climates; Mostly docile.|Beekeeping 101|Some guy

PS: Sorry for the ugly picture of my screen, my screenshot hotkey is Ctrl-Shift-F4 and I'm too lazy to change it to take the Shift-Tooltip case. 😛

@Dream-Master Dream-Master requested a review from a team September 1, 2024 18:18
Copy link

@OneEyeMaker OneEyeMaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is cool. And I suggest to extend it to all species - including trees and butterflies. Also I suggest to add little bit of formatting to lore tooltip.

If you need some help with implementation then you can follow advices below:

  1. Create method void addLore(List<String> list) in IIndividual interface with default empty implementation (for backward compatibility).
  2. Modify method ItemGE:addInformation to call this method when specific key is pressed. Add information about the key otherwise (look at logic of shift key).
  3. Implement method addLore for Bee, Tree, and Butterfly classes. You can use your current solution. Don't forget to nicely format your text (use EnumChatFormatting) 😸

Also there is client-only helper method for splitting tooltips: FontRenderer:listFormattedStringToWidth.

@OneEyeMaker
Copy link

@Nilau1998 Any news here? Do you plan to continue working on this PR?

@Nilau1998
Copy link
Author

Yes I do plan to finish this up. I just can't until Wednesday next week because I have a final exam there.

@Nilau1998
Copy link
Author

20240910_224321.mp4

@Dream-Master Dream-Master requested review from OneEyeMaker and a team September 10, 2024 21:11
Copy link

@OneEyeMaker OneEyeMaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done!
Just make your changes backward compatible and clean up some unnecessary checks and that's all.

@Dream-Master Dream-Master requested review from OneEyeMaker and a team September 11, 2024 22:11
@Dream-Master Dream-Master merged commit 8aa7e05 into GTNewHorizons:master Sep 12, 2024
1 check passed
@Nilau1998 Nilau1998 deleted the bee-lore+name branch September 12, 2024 15:28
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.

3 participants