diff --git a/src/main/java/com/hfstudio/guidenh/guide/compiler/tags/BlockImageCompiler.java b/src/main/java/com/hfstudio/guidenh/guide/compiler/tags/BlockImageCompiler.java index 8aefabb7..24f1c459 100644 --- a/src/main/java/com/hfstudio/guidenh/guide/compiler/tags/BlockImageCompiler.java +++ b/src/main/java/com/hfstudio/guidenh/guide/compiler/tags/BlockImageCompiler.java @@ -32,7 +32,7 @@ protected void compile(PageCompiler compiler, LytBlockContainer parent, MdxJsxEl int meta = MdxAttrs.getInt(compiler, parent, el, "meta", Integer.MIN_VALUE); String nbt = MdxAttrs.getString(compiler, parent, el, "nbt", null); - float scale = MdxAttrs.getFloat(compiler, parent, el, "scale", 1f); + float scale = MdxAttrs.getFloat(compiler, parent, el, "scale", 4f); String perspective = MdxAttrs.getString(compiler, parent, el, "perspective", null); int width = MdxAttrs.getInt(compiler, parent, el, "width", 128); int height = MdxAttrs.getInt(compiler, parent, el, "height", 128); diff --git a/src/main/java/com/hfstudio/guidenh/guide/siteexport/site/GuideSiteMdxTagRenderer.java b/src/main/java/com/hfstudio/guidenh/guide/siteexport/site/GuideSiteMdxTagRenderer.java index 3fe838ef..184a84c9 100644 --- a/src/main/java/com/hfstudio/guidenh/guide/siteexport/site/GuideSiteMdxTagRenderer.java +++ b/src/main/java/com/hfstudio/guidenh/guide/siteexport/site/GuideSiteMdxTagRenderer.java @@ -788,7 +788,7 @@ private String renderBlockImage(MdxJsxElementFields element, String defaultNames currentPageId, templates, false, - readFloat(element, "scale")); + readBlockImageScale(element)); } GuideSiteExportedScene exportedScene = sceneResolver.nextScene(); @@ -806,7 +806,7 @@ private String renderBlockImage(MdxJsxElementFields element, String defaultNames currentPageId, templates, false, - readFloat(element, "scale"), + readBlockImageScale(element), true); } @@ -821,6 +821,11 @@ private String wrapBlockImageFloat(MdxJsxElementFields element, String html) { return "" + html + ""; } + private Float readBlockImageScale(MdxJsxElementFields element) { + Float scale = readFloat(element, "scale"); + return scale == null ? 4f : scale; + } + @Nullable private String resolveBlockFloatDirection(MdxJsxElementFields element) { String wrap = readOptional(element, "wrap"); diff --git a/wiki/Images-And-Assets-zh-CN.md b/wiki/Images-And-Assets-zh-CN.md index 0dab59a9..a67d1ec2 100644 --- a/wiki/Images-And-Assets-zh-CN.md +++ b/wiki/Images-And-Assets-zh-CN.md @@ -288,7 +288,7 @@ GuideNH 页面也可以引用非图片类运行时资源,最常见的是结构 - 背景透明,边框透明 - 没有场景按钮,没有 layer 滑条,也没有注解编辑面 - 悬停时依然会显示方块选中线框与 tooltip -- `scale` 控制相机缩放 +- `scale` 控制相机缩放,默认值为 `4` - `perspective` 支持 `isometric-north-east`、`isometric-north-west`、`up` - `nbt` 用于提供 TileEntity SNBT;`id="mod:block:meta:{...}"` 形式的内联 SNBT 仍然可用, 但独立 `nbt` 属性更清晰,推荐优先使用 @@ -296,7 +296,7 @@ GuideNH 页面也可以引用非图片类运行时资源,最常见的是结构 示例: ````md - + + ` | 纵向 flex 布局 | `gap`, `alignItems`, `fullWidth`, `width` | | `` | 运行时 Markdown 脚注使用的限宽脚注容器 | `width` | | `` | 紧凑物品图标网格 | 子元素必须是 `` 或 `` | -| `` | 非交互式的 3D 单方块预览 | `id` 或 `ore`,`scale`,`float`,`perspective`,`nbt` | +| `` | 非交互式的 3D 单方块预览 | `id` 或 `ore`,可选 `scale`(默认 `4`),`float`,`perspective`,`nbt` | | `` | 支持浮动或真正行内放置的裁剪图片块 | `src`, `x`, `y`, `width` / `w`, `height` / `h`, `scaleX`, `scaleY`, `displayWidth`, `displayHeight`, `wrap`, `align`, `title` | | `` | 导航子页面列表 | `id`, `alphabetical` | | `` | 分类页面列表 | `name`, `rows` | @@ -459,7 +459,7 @@ GuideNH 会在运行时 Markdown 脚注展开后内部使用这个块标签。 | --- | --- | | `id` | 方块 id;支持常规 `modid:block[:meta][:{snbt}]` 写法 | | `ore` | 矿辞查询;使用第一个匹配到的方块物品 | -| `scale` | 相机缩放倍率,默认 `1` | +| `scale` | 相机缩放倍率,默认 `4` | | `float` | 旧版流式浮动支持:`left` 或 `right` | | `perspective` | `isometric-north-east`(默认)、`isometric-north-west` 或 `up` | | `nbt` | 可选的 TileEntity SNBT;会合并到 `id` 内联 SNBT 之上 | diff --git a/wiki/Tags-Reference.md b/wiki/Tags-Reference.md index 73f0d6d3..e3abdf30 100644 --- a/wiki/Tags-Reference.md +++ b/wiki/Tags-Reference.md @@ -54,7 +54,7 @@ Inline markdown also supports action links for sound playback: | `` | vertical flex layout | `gap`, `alignItems`, `fullWidth`, `width` | | `` | width-constrained footnote container used by runtime markdown footnotes | `width` | | `` | compact grid of item icons | children must be `` or `` | -| `` | non-interactive 3D single-block preview | `id` or `ore`, `scale`, `float`, `perspective`, `nbt` | +| `` | non-interactive 3D single-block preview | `id` or `ore`, optional `scale` (defaults to `4`), `float`, `perspective`, `nbt` | | `` | cropped image block with float or true inline placement | `src`, `x`, `y`, `width` / `w`, `height` / `h`, `scaleX`, `scaleY`, `displayWidth`, `displayHeight`, `wrap`, `align`, `title` | | `` | navigation child listing | `id`, `alphabetical` | | `` | list pages from a category | `name`, `rows` | @@ -486,7 +486,7 @@ selection outline and tooltip. `ore` must resolve to a block item stack. | --- | --- | | `id` | block id; supports the normal `modid:block[:meta][:{snbt}]` spelling | | `ore` | ore dictionary lookup; the first matching block item wins | -| `scale` | camera zoom multiplier, default `1` | +| `scale` | camera zoom multiplier, default `4` | | `float` | legacy flow float support: `left` or `right` | | `perspective` | `isometric-north-east` (default), `isometric-north-west`, or `up` | | `nbt` | optional SNBT tile-entity data merged onto any inline SNBT from `id` | diff --git a/wiki/resourcepack/assets/guidenh/guidenh/_en_us/images.md b/wiki/resourcepack/assets/guidenh/guidenh/_en_us/images.md index 6d66dc14..f039169b 100644 --- a/wiki/resourcepack/assets/guidenh/guidenh/_en_us/images.md +++ b/wiki/resourcepack/assets/guidenh/guidenh/_en_us/images.md @@ -186,8 +186,10 @@ Icon shown, no tooltip: ## BlockImage Scale `BlockImage` now renders a transparent 3D placed-block preview rather than an item-form icon. +When `scale` is omitted, it defaults to `4`. + diff --git a/wiki/resourcepack/assets/guidenh/guidenh/_zh_cn/images.md b/wiki/resourcepack/assets/guidenh/guidenh/_zh_cn/images.md index c9567dd1..3cce8aef 100644 --- a/wiki/resourcepack/assets/guidenh/guidenh/_zh_cn/images.md +++ b/wiki/resourcepack/assets/guidenh/guidenh/_zh_cn/images.md @@ -176,8 +176,10 @@ categories: ## BlockImage 缩放 `BlockImage` 现在显示的是透明背景的 3D 放置方块预览,而不是物品形态图标。 +省略 `scale` 时,默认值为 `4`。 +