-
Notifications
You must be signed in to change notification settings - Fork 2
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
Map item, warp command, poi command #58
Conversation
itsbazke
commented
Oct 27, 2023
.requires(source -> source.hasPermission(Commands.LEVEL_GAMEMASTERS)) | ||
.then(literal("edit") | ||
.then(argument("name", word()) | ||
.suggests((ctx, builder) -> suggest(suggestName(ctx), builder)) |
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.
for these suggestions id love to "remember" the initial POI somehow, is that possible?
|
@Override | ||
public InteractionResultHolder<ItemStack> use(final Level pLevel, final Player player, final InteractionHand usedHand) { | ||
if (pLevel.isClientSide()) { | ||
Minecraft.getInstance().setScreen(new TropicalMapScreen(Component.translatable("item.ltextras.tropical_map"), player)); |
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.
Modding setups are a bit weird where client & server source are merged - but the server still doesn't have the client classes available. This call to client-side code will need to be pulled into a separate static function, 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.
ahh confusing! something like this commit? 95429d2
return InteractionResultHolder.pass(player.getItemInHand(usedHand)); | ||
} | ||
|
||
public static class TropicalMapScreen extends Screen { |
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.
These inner classes will also need to be moved out for classloading to not fail, afaik
//Dont think this is a great way to scale... just wanted the text a bit smaller :) | ||
PoseStack pose = guiGraphics.pose(); | ||
pose.pushPose(); | ||
pose.scale(1.0f / FONT_SCALING, 1.0f / FONT_SCALING, 1.0f / FONT_SCALING); |
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.
There's a bit of a caveat here that text is the smallest size it can be to render correctly on all resolutions - at GUI scale 1, this will look a bit strange. One solution might be to only show the icon normally, and show the name when hovered? Imagining kind of like the advancements screen
But I think it's also not important - most players are using a scale bigger than 1 :D
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.
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.
It becomes a bit hard to predict how things will look on different screen sizes & setups when it's dynamic - having it at a consistent scaling at least ensures that it will look the same for everyone, and match the configuration they have set with their GUI scale.
I don't think the big text + big icon looks too bad, I guess the problem might be running out of space?
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.
looks great to me!
src/main/java/com/lovetropics/extras/network/ClientboundPoiPacket.java
Outdated
Show resolved
Hide resolved
src/main/java/com/lovetropics/extras/data/poi/MapPoiManager.java
Outdated
Show resolved
Hide resolved
src/main/java/com/lovetropics/extras/client/screen/map/TropicalMapScreen.java
Outdated
Show resolved
Hide resolved
dbf5593
to
97f26bc
Compare