Skip to content

Commit

Permalink
Add New Plugin Lite Tree. Fix Gumeng's avaar
Browse files Browse the repository at this point in the history
  • Loading branch information
M1hono committed Sep 24, 2024
1 parent 85855bb commit 2bd0705
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 13 deletions.
19 changes: 14 additions & 5 deletions .vitepress/config/common-config.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { NolebaseInlineLinkPreviewPlugin } from "@nolebase/vitepress-plugin-inline-link-preview/client";
import { NolebaseGitChangelogPlugin } from "@nolebase/vitepress-plugin-git-changelog/client";

import { LiteTree } from '@lite-tree/vue'
import Layout from "./Layout.vue";
import themeControl from "./components/themeControl.vue";
import Comment from "./components/comment.vue";
Expand Down Expand Up @@ -94,6 +95,7 @@ export default {
ctx.app.component("commitsCounter", commitsCounter);
ctx.app.component("MNavLinks", MNavLinks);
ctx.app.component("PdfViewer", PdfViewer);
ctx.app.component('LiteTree',LiteTree);
},
setup() {
const route = useRoute();
Expand Down
8 changes: 8 additions & 0 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,12 @@

.text-yellow {
color: yellow;
}

.lite-tree {
border: none!important;
}

.lite-tree .icon {
color: var(--vp-c-text-1)!important;
}
1 change: 1 addition & 0 deletions docs/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {

Expand Down
39 changes: 38 additions & 1 deletion docs/zh/doc/samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,41 @@ do some thing4

:::demo
<PdfViewer pdfSource="/pdf/modding/java/test.pdf"/>
:::
:::

## 文件树

<!-- :::demo -->
<LiteTree>
#error=color:red;border: 1px solid red;background:#ffd2d2;padding:2px;
#blue=color:red;border: 1px sol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WdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMTUgMTUiPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBkPSJNMTIuNSA4di0uMTY3YzAtLjczNi0uNTk3LTEuMzMzLTEuMzMzLTEuMzMzSDEwYTEuNSAxLjUgMCAxIDAgMCAzaDFhMS41IDEuNSAwIDAgMSAwIDNoLTFBMS41IDEuNSAwIDAgMSA4LjUgMTFNOCA2LjVIM20yLjUgMFYxM00uNS41aDE0djE0SC41eiIvPjwvc3ZnPg==
---
- [airplane]A公司({color:red;}重点,{#blue}紧急) // 企业名称
行政中心
{color:red;font-weight:bold;background:#ffeaea}总裁办
[checked]人力资源部
[unchecked]{.blue}财务部
行政部 //+ 负责行政管理
法务部 //+ 打官司等
[airplane]审计部 //+ 审计财务[保存:tag](sss) [连接](sss)
信息中心 // 重点[保存](www.baidu.com)[tag][连接:tag](https://www.baidu.com)
[star][star][star][star][star][star] //{color:red} 保密工作
+ 市场中心
市场部({#error}出错,"{#warning}警告")
销售部 //-
客服部 //-
{#blue}品牌部 // this is cool
市场策划部 //! 重点
市场营销部 // {.blue}this is cool
研发中心
移动研发部 //!
平台研发部({success}Java,{error}Go)
{.success}测试部
运维部
产品部 //*
设计部 //*
项目管理部 //*
</LiteTree>
<!-- ::: -->
21 changes: 14 additions & 7 deletions docs/zh/mods/custom/MBD2/SingleBlockBasic.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ state: unfinished
progress: 10
backPath: ./Catalogue
---

# 单方块机器 {#SingleBlockMachine}

:::::: justify
Expand All @@ -16,6 +17,7 @@ backPath: ./Catalogue
其中,左侧的状态永远是右侧状态的``状态,``状态所体现的是一种继承关系,通常情况下,子类的一些基本设置都会==沿用`父类`==,例如模型渲染等。

::: center

```mermaid
---
title: 机器运行周期
Expand All @@ -40,14 +42,18 @@ flowchart TB
class C,D working;
class G,F special;
```

可以简单地将其理解为这个机器的 **`大脑`**
:::

## 设置 {#Options}

:::outlined
该篇将更专注于各个模块的介绍与使用的大致流程,并非所有的参数都将被提及,更加具体的文档可在此处(暂空)查看。
:::

每个模块都有着三种不同的`通用配置器`

1. [基础配置](#BasicOptions):一般为某种物件最基本的配置,例如机器的`方块属性``事件的触发节点`为模块的基本配置,而`UI`这类基本元素也使用基本配置器进行修改。

2. [其他配置]():一般是某种物件的独有配置,例如基本设置中对单个工作状态进行配置时就会打开其他配置。
Expand All @@ -62,8 +68,8 @@ flowchart TB

![basic option root](/imgs/mods/custom/mbd2/zh/basic-option-root.png)


#### 方块属性 {#BlockProperties}

:::outlined
该处配置机器的[`方块属性`](https://minecraft.fandom.com/zh/wiki/%E6%96%B9%E5%9D%97%E7%8A%B6%E6%80%81),游戏内部对每个属性都有着详细的提示,可通过将==鼠标移至问号框处获取==,因此只将它们列在此处并进行必要的拓展。
:::
Expand All @@ -72,12 +78,12 @@ flowchart TB
| 属性名 | 描述 | 选项 | 说明 |
|--------|------|------|------|
| `使用AO渲染 (Use AO)` | 是否开启环境光遮蔽渲染 |`boolean`| 开启后可增加方块阴影的细节,提高视觉效果 |
| `方块朝向 (Rotation State)` | 方块允许的旋转方向 | `ALL`: 所有方向<br>`NONE`: 无法旋转<br>`NONE_Y_AXIS`: X、Z轴方向<br>`Y_AXIS`: 仅Y轴方向 | 控制方块在游戏中的放置方向 |
| `方块朝向 (Rotation State)` | 方块允许的旋转方向 | `ALL`: 所有方向<br>`NONE`: 无法旋转<br>`NONE_Y_AXIS`: X、Z 轴方向<br>`Y_AXIS`: 仅 Y 轴方向 | 控制方块在游戏中的放置方向 |
| `方块碰撞箱 (Jas Collision)` | 是否启用碰撞检测 |`boolean`| 开启后玩家和其他实体将无法穿过该方块 |
| `动态形状 (Dynamic Shape)` | 是否启用动态形状 |`boolean`| 可能与方块的视觉效果或物理行为有关 |
| `能被岩浆点燃 (Ignited by lava)` | 方块是否可被岩浆点燃 |`boolean`| 影响方块与岩浆的交互 |
| `可被忽略 (Is Air)` | 方块是否被视为空气 |`boolean`| 如果为true,该方块将不会阻挡移动或放置 |
| `是否导致窒息 (Is Suffocating)` | 方块是否会导致实体窒息 |`boolean`| 如果为false,实体可以在方块内呼吸 |
| `可被忽略 (Is Air)` | 方块是否被视为空气 |`boolean`| 如果为 true,该方块将不会阻挡移动或放置 |
| `是否导致窒息 (Is Suffocating)` | 方块是否会导致实体窒息 |`boolean`| 如果为 false,实体可以在方块内呼吸 |
| `自发光 (Emissive)` | 方块是否会发光 |`boolean`| 开启后方块(的纹理)会在黑暗中发光 |
| `摩擦力 (Friction)` | 方块表面的摩擦系数 | `float` [0.0, 1.0] | 0.0 = 无摩擦力 (极滑)<br>1.0 = 最大摩擦力 (极粗糙) |
| `速度系数 (Speed Factor)` | 影响在方块上的移动速度 | `float` [0.0, +∞) | 1.0 = 正常速度<br>>1.0 = 加速 (如: 1.5 = 50%加速)<br><1.0 = 减速 (如: 0.5 = 50%减速) |
Expand All @@ -88,15 +94,16 @@ flowchart TB
:::

#### 物品属性 {#ItemProperties}

:::outlined
该处配置机器作为物品存在时的属性,游戏内部对每个属性都有着详细的提示,可通过将==鼠标移至问号框处获取==,因此只将它们列在此处并进行必要的拓展。
:::

:::details
| 属性名 | 描述 | 选项 | 说明 |
|--------|------|------|------|
| `方块光照 (Use AO)` | 控制方块作为物品在GUI内被照亮的逻辑 |`boolean`| `true`:物品将以方块形式在侧边被照亮<br>`false`:物品将以物品形式在正面被照亮 |
| `GUI物品3D (Use AO)` | 控制方块作为物品的渲染 |`boolean`| 控制物品在GUI内是否作为3D模型显示 |
| `方块光照 (Use AO)` | 控制方块作为物品在 GUI 内被照亮的逻辑 |`boolean`| `true`:物品将以方块形式在侧边被照亮<br>`false`:物品将以物品形式在正面被照亮 |
| `GUI物品3D (Use AO)` | 控制方块作为物品的渲染 |`boolean`| 控制物品在 GUI 内是否作为 3D 模型显示 |

:::
::::::
::::::
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"docs:preview": "vitepress preview"
},
"dependencies": {
"@lite-tree/vue": "^1.1.4",
"@mdit-vue/shared": "^2.1.3",
"@mdit/plugin-alert": "^0.13.0",
"@mdit/plugin-align": "^0.13.0",
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,13 @@
resolved "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz"
integrity sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==

"@lite-tree/vue@^1.1.4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@lite-tree/vue/-/vue-1.1.4.tgz#9bc3cc964a6e1cbf733c1b363239554333ba55eb"
integrity sha512-gOPHgZ7PmrQuMuB2GaB6PyDKvI00HhxMJn6gzUoNJ8ZhSIAwmpF6D0pdF0UNryA1wXA+MMNdiBBpoWOxvZg93A==
dependencies:
vue-slide-up-down "^3.0.0"

"@mdi/font@^7.4.47":
version "7.4.47"
resolved "https://registry.npmjs.org/@mdi/font/-/font-7.4.47.tgz"
Expand Down Expand Up @@ -4088,6 +4095,11 @@ vue-resize@^2.0.0-alpha.1:
resolved "https://registry.npmjs.org/vue-resize/-/vue-resize-2.0.0-alpha.1.tgz"
integrity sha512-7+iqOueLU7uc9NrMfrzbG8hwMqchfVfSzpVlCMeJQe4pyibqyoifDNbKTZvwxZKDvGkB+PdFeKvnGZMoEb8esg==

vue-slide-up-down@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/vue-slide-up-down/-/vue-slide-up-down-3.0.0.tgz#ea135f79b86b4890d3eaf6bdf9e9de06e12a73ff"
integrity sha512-4ckwKgpkPfjDmwVKdu5UANvxt7nKemIKpqbRGhcekgDuvEwep8YFwkb8G9dix4lL+Wt2G73X1Z90c1oPJvXdOQ==

vue@^3.4.34, vue@^3.4.38, vue@^3.5.4, vue@^3.5.7:
version "3.5.7"
resolved "https://registry.npmjs.org/vue/-/vue-3.5.7.tgz"
Expand Down

0 comments on commit 2bd0705

Please sign in to comment.