diff --git a/api/src/main/java/ru/dragonestia/msb3/api/player/defaults/NavigatorContext.java b/api/src/main/java/ru/dragonestia/msb3/api/player/defaults/NavigatorContext.java index 6a8d5b3..7b0dcea 100644 --- a/api/src/main/java/ru/dragonestia/msb3/api/player/defaults/NavigatorContext.java +++ b/api/src/main/java/ru/dragonestia/msb3/api/player/defaults/NavigatorContext.java @@ -27,6 +27,7 @@ public class NavigatorContext extends PlayerContext implements Navigator { private boolean prevTargetEmpty = true; @Setter private String format = "[ %s ]"; @Setter private TextColor textColor = TextColor.color(0xF8FF91); + @Setter private GlyphImage arrowBackground = Navigators.GLYPH_BACKGROUND; public NavigatorContext(MsbPlayer player) { super(player); @@ -80,13 +81,15 @@ public class NavigatorContext extends PlayerContext implements Navigator { var builder = new GlyphComponentBuilder(); + builder.append((int) (arrowBackground.width() / -2.15) + 1, arrowBackground); + // Text if (text != null) { builder.setColorTo(textColor); if (cachedText == null) { cachedText = MinecraftFont.translateByLineNumber(0, format.formatted(text)); } - builder.append((int) (cachedText.width() / -2.2), cachedText); + builder.append((int) (cachedText.width() / -2.15), cachedText); builder.resetColor(); } diff --git a/api/src/main/java/ru/dragonestia/msb3/api/ui/navigator/Navigators.java b/api/src/main/java/ru/dragonestia/msb3/api/ui/navigator/Navigators.java index cf6bec4..15a4e5f 100644 --- a/api/src/main/java/ru/dragonestia/msb3/api/ui/navigator/Navigators.java +++ b/api/src/main/java/ru/dragonestia/msb3/api/ui/navigator/Navigators.java @@ -10,53 +10,61 @@ import ru.dragonestia.msb3.resource.glyph.GlyphImage; public class Navigators { + private final static int ARROW_ASCENT = -5; + public final static GlyphImage GLYPH_UP = Resources.createGlyph( Key.key("msb3", "navigator/up"), ResourceFromJar.of("glyphs/navigator/arrow/up.png"), 16, - 0); + ARROW_ASCENT); public final static GlyphImage GLYPH_UP_RIGHT = Resources.createGlyph( Key.key("msb3", "navigator/up_right"), ResourceFromJar.of("glyphs/navigator/arrow/up_right.png"), 16, - 0); + ARROW_ASCENT); public final static GlyphImage GLYPH_RIGHT = Resources.createGlyph( Key.key("msb3", "navigator/right"), ResourceFromJar.of("glyphs/navigator/arrow/right.png"), 16, - 0); + ARROW_ASCENT); public final static GlyphImage GLYPH_DOWN_RIGHT = Resources.createGlyph( Key.key("msb3", "navigator/down_right"), ResourceFromJar.of("glyphs/navigator/arrow/down_right.png"), 16, - 0); + ARROW_ASCENT); public final static GlyphImage GLYPH_DOWN = Resources.createGlyph( Key.key("msb3", "navigator/down"), ResourceFromJar.of("glyphs/navigator/arrow/down.png"), 16, - 0); + ARROW_ASCENT); public final static GlyphImage GLYPH_DOWN_LEFT = Resources.createGlyph( Key.key("msb3", "navigator/down_left"), ResourceFromJar.of("glyphs/navigator/arrow/down_left.png"), 16, - 0); + ARROW_ASCENT); public final static GlyphImage GLYPH_LEFT = Resources.createGlyph( Key.key("msb3", "navigator/left"), ResourceFromJar.of("glyphs/navigator/arrow/left.png"), 16, - 0); + ARROW_ASCENT); public final static GlyphImage GLYPH_UP_LEFT = Resources.createGlyph( Key.key("msb3", "navigator/up_left"), ResourceFromJar.of("glyphs/navigator/arrow/up_left.png"), 16, - 0); + ARROW_ASCENT); + + public final static GlyphImage GLYPH_BACKGROUND = Resources.createGlyph( + Key.key("msb3", "navigator/background"), + ResourceFromJar.of("glyphs/navigator/background.png"), + 64, + 12); public static Navigator of(Player player) { return PlayerContext.of(player, NavigatorContext.class); diff --git a/api/src/main/resources/glyphs/navigator/background.png b/api/src/main/resources/glyphs/navigator/background.png new file mode 100644 index 0000000..08178b4 Binary files /dev/null and b/api/src/main/resources/glyphs/navigator/background.png differ