Skip to content

Commit

Permalink
feat: Add config for Bundle Preview Row Width
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura-ryoko committed Dec 22, 2024
1 parent ba2435d commit 99f6eea
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/fi/dy/masa/minihud/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static class Generic
public static final ConfigBoolean BUNDLE_PREVIEW = new ConfigBoolean("bundlePreview", false).apply(GENERIC_KEY);
public static final ConfigBoolean BUNDLE_DISPLAY_BACKGROUND_COLOR = new ConfigBoolean("bundleDisplayBgColor", true).apply(GENERIC_KEY);
public static final ConfigBoolean BUNDLE_DISPLAY_REQUIRE_SHIFT = new ConfigBoolean("bundleDisplayRequireShift", true).apply(GENERIC_KEY);
public static final ConfigInteger BUNDLE_DISPLAY_ROW_WIDTH = new ConfigInteger("bundleDisplayRowWidth", 9, 6, 9).apply(GENERIC_KEY);
public static final ConfigString COORDINATE_FORMAT_STRING = new ConfigString("coordinateFormat", "x: %.1f y: %.1f z: %.1f").apply(GENERIC_KEY);
public static final ConfigString DATE_FORMAT_REAL = new ConfigString("dateFormatReal", "yyyy-MM-dd HH:mm:ss").apply(GENERIC_KEY);
public static final ConfigString DATE_FORMAT_MINECRAFT = new ConfigString("dateFormatMinecraft", "MC time: (day {DAY}) {HOUR}:{MIN}:xx").apply(GENERIC_KEY);
Expand Down Expand Up @@ -127,6 +128,7 @@ public static class Generic
BUNDLE_PREVIEW,
BUNDLE_DISPLAY_BACKGROUND_COLOR,
BUNDLE_DISPLAY_REQUIRE_SHIFT,
BUNDLE_DISPLAY_ROW_WIDTH,
DEBUG_MESSAGES,
//DEBUG_DEVELOPMENT_MODE,
//DEBUG_RENDERER_PATH_MAX_DIST,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fi/dy/masa/minihud/event/RenderHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ else if (stack.getComponents().contains(DataComponentTypes.BUNDLE_CONTENTS) && I
if (Configs.Generic.BUNDLE_PREVIEW.getBooleanValue() &&
(Configs.Generic.BUNDLE_DISPLAY_REQUIRE_SHIFT.getBooleanValue() == false || GuiBase.isShiftDown()))
{
RenderUtils.renderBundlePreview(stack, x, y, Configs.Generic.BUNDLE_DISPLAY_BACKGROUND_COLOR.getBooleanValue(), drawContext);
RenderUtils.renderBundlePreview(stack, x, y, Configs.Generic.BUNDLE_DISPLAY_ROW_WIDTH.getIntegerValue(), Configs.Generic.BUNDLE_DISPLAY_BACKGROUND_COLOR.getBooleanValue(), drawContext);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/minihud/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"minihud.config.generic.comment.blockPosFormat": "The format string for the \"infoBlockPosition\" line.\nNeeds to have three %%d format strings!\nDefault: \"Block: %%d, %%d, %%d\"",
"minihud.config.generic.comment.bundleDisplayBgColor": "Enables tinting/coloring the Bundle display\nbackground texture with the dye color of the bundle",
"minihud.config.generic.comment.bundleDisplayRequireShift": "Whether or not holding shift is required for the Bundle preview\n§6NOTE: Disabling this causes the Vanilla Bundle tooltip to be fully disabled.",
"minihud.config.generic.comment.bundleDisplayRowWidth": "Adjust the Row Width size of the Bundle Preview display,\nAnything smaller or larger will cause texture display problems.",
"minihud.config.generic.comment.bundlePreview": "Enables rendering a preview of the Bundle contents,\nwhen you hold shift while hovering over a Bundle item",
"minihud.config.generic.comment.coordinateFormat": "The format string for the coordinate line.\nNeeds to have three %%f format strings!\nDefault: x: %%.1f y: %%.1f z: %%.1f",
"minihud.config.generic.comment.dateFormatMinecraft": "The format string for the Minecraft time.\nThe supported placeholders are: {DAY_1}, {DAY}, {HOUR}, {MIN}, {SEC}, {MOON}.\n{DAY_1} starts the day counter from 1, {DAY} starts from 0.",
Expand Down Expand Up @@ -177,6 +178,7 @@
"minihud.config.generic.name.blockPosFormat": "blockPosFormat",
"minihud.config.generic.name.bundleDisplayBgColor": "bundleDisplayBgColor",
"minihud.config.generic.name.bundleDisplayRequireShift": "bundleDisplayRequireShift",
"minihud.config.generic.name.bundleDisplayRowWidth": "bundleDisplayRowWidth",
"minihud.config.generic.name.bundlePreview": "bundlePreview",
"minihud.config.generic.name.coordinateFormat": "coordinateFormat",
"minihud.config.generic.name.dateFormatMinecraft": "dateFormatMinecraft",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/minihud/lang/ko_kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"minihud.config.generic.comment.blockPosFormat": "\"정보 블록 위치\"의 형식 문자열입니다.\n세 개의 %%d 형식 문자열이 필요합니다!\n기본값: \"Block: %%d, %%d, %%d\"",
"minihud.config.generic.comment.bundleDisplayBgColor": "꾸러미 미리보기의 배경색을 꾸러미의 염색 색상과 일치시킵니다.",
"minihud.config.generic.comment.bundleDisplayRequireShift": "꾸러미 미리보기를 할 때 Shift 키를 눌러야 하는지 여부를 설정합니다.\n§6참고: 이 기능을 비활성화하면 바닐라 꾸러미 툴팁이 완전히 비활성화됩니다.",
"minihud.config.generic.comment.bundleDisplayRowWidth": "Adjust the Row Width size of the Bundle Preview display,\nAnything smaller or larger will cause texture display problems.",
"minihud.config.generic.comment.bundlePreview": "꾸러미 위에 마우스를 올려놓은 상태에서 Shift 키를 누르면\n꾸러미의 내용물을 미리보기 할 수 있습니다.",
"minihud.config.generic.comment.coordinateFormat": "좌표 정보 라인의 형식 문자열입니다.\n세 개의 %%f 형식 문자열이 필요합니다!\n기본값: x: %%.1f y: %%.1f z: %%.1f",
"minihud.config.generic.comment.dateFormatMinecraft": "마인크래프트 날짜에 대한 형식 문자열입니다.\n지원되는 자리 표시자는 다음과 같습니다: {DAY_1}, {DAY}, {HOUR}, {MIN}, {SEC}, {MOON}.\n{DAY_1}은 1부터 시작하고, {DAY}는 0부터 시작합니다.",
Expand Down Expand Up @@ -177,6 +178,7 @@
"minihud.config.generic.name.blockPosFormat": "블록 위치 형식",
"minihud.config.generic.name.bundleDisplayBgColor": "꾸머리 표시 배경 색상",
"minihud.config.generic.name.bundleDisplayRequireShift": "꾸러미 표시 Shift 여부",
"minihud.config.generic.name.bundleDisplayRowWidth": "bundleDisplayRowWidth",
"minihud.config.generic.name.bundlePreview": "꾸러미 미리보기",
"minihud.config.generic.name.coordinateFormat": "좌표 형식",
"minihud.config.generic.name.dateFormatMinecraft": "마인크래프트 날짜 형식",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/minihud/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"minihud.config.generic.comment.blockPosFormat": "§6[玩家所在方块坐标]§f 中显示格式的字符串。\n字符串中需要至少三个\"%%d\"\n预设值: \"Block: %%d, %%d, %%d\"",
"minihud.config.generic.comment.bundleDisplayBgColor": "Enables tinting/coloring the Bundle display\nbackground texture with the dye color of the bundle",
"minihud.config.generic.comment.bundleDisplayRequireShift": "Whether or not holding shift is required for the Bundle preview\n§6NOTE: Disabling this causes the Vanilla Bundle tooltip to be fully disabled.",
"minihud.config.generic.comment.bundleDisplayRowWidth": "Adjust the Row Width size of the Bundle Preview display,\nAnything smaller or larger will cause texture display problems.",
"minihud.config.generic.comment.bundlePreview": "Enables rendering a preview of the Bundle contents,\nwhen you hold shift while hovering over a Bundle item",
"minihud.config.generic.comment.coordinateFormat": "§6[玩家坐标信息]§f 中显示格式的字符串。\n字符串中需要至少三个\"%%f\"\n预设值: \"x: %%.1f y: %%.1f z: %%.1f\"",
"minihud.config.generic.comment.dateFormatMinecraft": "§6[格式化游戏时间]§f 中显示格式的字符串\n支持的占位符有:\n{DAY_1}(初始值为 1 的日)、{DAY}(初始值为 0 的日)、\n{HOUR}(小时)、{MIN}(分钟)、{SEC}(秒)、\n{MOON}(月相)。",
Expand Down Expand Up @@ -177,6 +178,7 @@
"minihud.config.generic.name.blockPosFormat": "玩家方块位置格式",
"minihud.config.generic.name.bundleDisplayBgColor": "bundleDisplayBgColor",
"minihud.config.generic.name.bundleDisplayRequireShift": "bundleDisplayRequireShift",
"minihud.config.generic.name.bundleDisplayRowWidth": "bundleDisplayRowWidth",
"minihud.config.generic.name.bundlePreview": "bundlePreview",
"minihud.config.generic.name.coordinateFormat": "玩家坐标格式",
"minihud.config.generic.name.dateFormatMinecraft": "游戏时间格式",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/minihud/lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"minihud.config.generic.comment.blockPosFormat": "§6[玩家所在方塊座標]§f 中顯示格式的字串。\n字串中需要至少三個\"%%d\"\n預設值: \"Block: %%d, %%d, %%d\"",
"minihud.config.generic.comment.bundleDisplayBgColor": "Enables tinting/coloring the Bundle display\nbackground texture with the dye color of the bundle",
"minihud.config.generic.comment.bundleDisplayRequireShift": "Whether or not holding shift is required for the Bundle preview\n§6NOTE: Disabling this causes the Vanilla Bundle tooltip to be fully disabled.",
"minihud.config.generic.comment.bundleDisplayRowWidth": "Adjust the Row Width size of the Bundle Preview display,\nAnything smaller or larger will cause texture display problems.",
"minihud.config.generic.comment.bundlePreview": "Enables rendering a preview of the Bundle contents,\nwhen you hold shift while hovering over a Bundle item",
"minihud.config.generic.comment.coordinateFormat": "§6[玩家座標資訊]§f 中顯示格式的字串。\n字串中需要至少三個\"%%f\"\n預設值: \"x: %%.1f y: %%.1f z: %%.1f\"",
"minihud.config.generic.comment.dateFormatMinecraft": "§6[格式化遊戲時間]§f 中顯示格式的字串\n支援的佔位符有:\n{DAY_1}(初始值為 1 的日)、{DAY}(初始值為 0 的日)、\n{HOUR}(小時)、{MIN}(分鐘)、{SEC}(秒)、\n{MOON}(月相)。",
Expand Down Expand Up @@ -177,6 +178,7 @@
"minihud.config.generic.name.blockPosFormat": "玩家方塊位置格式",
"minihud.config.generic.name.bundleDisplayBgColor": "bundleDisplayBgColor",
"minihud.config.generic.name.bundleDisplayRequireShift": "bundleDisplayRequireShift",
"minihud.config.generic.name.bundleDisplayRowWidth": "bundleDisplayRowWidth",
"minihud.config.generic.name.bundlePreview": "bundlePreview",
"minihud.config.generic.name.coordinateFormat": "玩家座標格式",
"minihud.config.generic.name.dateFormatMinecraft": "遊戲時間格式",
Expand Down

0 comments on commit 99f6eea

Please sign in to comment.