自定义物品描述界面
默认配置
该配置文件应位于
plugins/GermPlugin/gui文件夹内
第一步,在服务端中新建tooltip.yml,并填入对应基础配置
#只有该界面才有以下变量
# %tipX% 代表原tooltip 显示的X位置
# %tipY% 代表原tooltip 显示的Y位置
# %tipW% 代表原tooltip 显示的宽度
# %tipH% 代表原tooltip 显示的高度
# %tipS% 代表原tooltip 可显示的lore的行数
# %tipRealS% 代表原tooltip 可显示和不可显示的lore行数
# %tip0% 代表原tooltip 的标题
# %tip1% 代表原tooltip 的第一行
# %tip2% 代表原tooltip 的第二行
# .........
# %tip100% 代表原tooltip 的第一百行
# %tipLores% 代表所有lore
#
# 经过萌芽修改过的lore描述中可以用PAPI变量哦
tooltip:
#该界面的私有选项
private:
#描述隐藏
# %tip0_hide_prefix% 代表用prefix隐藏的第一行
# %tip100_hide_prefix% 代表用prefix隐藏的第一百零一行 [其他隐藏功能请类同]
# %tip0_hide_suffix% 代表用suffix隐藏的第一行
# %tip0_hide_contain% 代表用contain隐藏的第一行
# %tip0_hide_fragment% 代表用fragment隐藏的第一段
#
# %tipPrefixS% 代表用prefix隐藏的lore行数 [其他隐藏请类同]
#
# loreHide`<->`fragment@false 关闭片段隐藏功能
# loreHide`<->`fragment@true 启动片段隐藏功能 [其他隐藏请类同]
hides:
#如果一行描述的开头为 prefix 所填写的 就不显示该行
prefix: '[-]'
#如果一行描述的结尾为 suffix 所填写的 就不显示该行
suffix: '[-]'
#如果一行描述中含有 contain 所填写的 就不显示该行
contain: '[~]'
#整段隐藏写法
fragment:
#如果一行描述等于 start 所填写内容 则开始隐藏接下来的每一行
start: '[start]'
#如果一行描述等于 end 所填写内容 则不再隐藏剩下的行
end: '[end]'
#自定义隐藏段写法 since 4.4.2
fragments:
#变量 %tip0_hide_custom1%
custom1:
start: '宝石镶嵌隐藏模块开始'
end: '宝石镶嵌隐藏模块结束'
#相当于一个条件dos 有一个条件未达该玩家将无法打开自定义的tooltip
conditions:
# 当玩家看的tooltip有物品时候才显示(如果是在聊天框上悬浮出来的tooltip就没有物品)
- 'str(%germmod_tooltip_has_item%,true)'
# 以下条件为 玩家的等级大于-1 并且 玩家名字不等于笨蛋 并且 血量大于-1 才可看到自定义的tooltip
- '%player_level% >= -1 && notStr(%player_name%,笨蛋)'
- '%player_max_health% >= -1'
#界面的参数设置
options:
#当玩家在此界面按下按键时触发
keyDos:
#当玩家按下左边的shift
keyDown_42:
- "loreHide`<->`fragment@false" #这里意为关闭片段隐藏器功能 当关闭后 原本被隐藏的会出现在lore上
keyUp_42:
- "loreHide`<->`fragment@true"
openDos:
- "update`<->`thisGui@all"
- "goto`<->`1"
#组件设置
canvas:
type: 11
locationX: "%tipX%-7"
locationY: "%tipY%-2"
locationZ: "450"
relativeParts:
p01:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqW26A.png"
locationX: "0"
locationY: "0"
width: "7"
height: "7"
p02:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWgld.png"
locationX: "%tooltip_canvas$p01_width%"
locationY: "0"
#适应宽度
width: "if(%tipW%-%tooltip_canvas$p01_width%>0,%tipW%-%tooltip_canvas$p01_width%,1)"
height: "%tooltip_canvas$p01_height%"
p03:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWcSH.png"
locationX: "%tooltip_canvas$p01_width% + if(%tipW%-%tooltip_canvas$p01_width%>0,%tipW%-%tooltip_canvas$p01_width%,1)"
locationY: "0"
width: "7"
height: "%tooltip_canvas$p01_height%"
p04:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWsYD.png"
locationX: "0"
locationY: "%tooltip_canvas$p01_height%"
#适应高度
width: "%tooltip_canvas$p01_width%"
height: "if(%tipH%-%tooltip_canvas$p01_height%>0,%tipH%-%tooltip_canvas$p01_height%,1)"
p05:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWrFO.png"
locationX: "%tooltip_canvas$p01_width%"
locationY: "%tooltip_canvas$p01_height%"
#适应高度且适应宽度
width: "if(%tipW%-%tooltip_canvas$p01_width%>0,%tipW%-%tooltip_canvas$p01_width%,1)"
height: "if(%tipH%-%tooltip_canvas$p01_height%>0,%tipH%-%tooltip_canvas$p01_height%,1)"
p06:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWyfe.png"
locationX: "%tooltip_canvas$p01_width% + if(%tipW%-%tooltip_canvas$p01_width%>0,%tipW%-%tooltip_canvas$p01_width%,1)"
locationY: "%tooltip_canvas$p01_height%"
#适应高度
width: "%tooltip_canvas$p03_width%"
height: "if(%tipH%-%tooltip_canvas$p01_height%>0,%tipH%-%tooltip_canvas$p01_height%,1)"
p07:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWROI.png"
locationX: "0"
locationY: "%tooltip_canvas$p01_height% + if(%tipH%-%tooltip_canvas$p01_height%>0,%tipH%-%tooltip_canvas$p01_height%,1)"
width: "%tooltip_canvas$p01_width%"
height: "7"
p08:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWfmt.png"
locationX: "%tooltip_canvas$p01_width%"
locationY: "%tooltip_canvas$p01_height%+ if(%tipH%-%tooltip_canvas$p01_height%>0,%tipH%-%tooltip_canvas$p01_height%,1)"
#适应宽度
width: "if(%tipW%-%tooltip_canvas$p01_width%>0,%tipW%-%tooltip_canvas$p01_width%,1)"
height: "%tooltip_canvas$p07_height%"
p09:
type: 0
path: "url`<->`https://s3.ax1x.com/2021/02/23/yqWh0P.png"
locationX: "%tooltip_canvas$p01_width% + if(%tipW%-%tooltip_canvas$p01_width%>0,%tipW%-%tooltip_canvas$p01_width%,1)"
locationY: "%tooltip_canvas$p01_height%+ if(%tipH%-%tooltip_canvas$p01_height%>0,%tipH%-%tooltip_canvas$p01_height%,1)"
width: "%tooltip_canvas$p03_width%"
height: "%tooltip_canvas$p07_height%"
title:
type: 4
align: "left"
scale: "1.00"
locationX: "4"
locationY: "3.5"
texts:
- "%tip0%"
lore3:
type: 4
align: "left"
scale: "1.00"
lineSpace: "1"
locationX: "4"
locationY: "4+11"
texts:
- "%tip1%"
- "%tip2%"
- "%tip3%"
- "%tip4%"
- "%tip5%"
- "%tip6%"
- "%tip7%"
- "%tip8%"
- "%tip9%"
- "%tip10%"
- "%tip11%"
- "%tip12%"
- "%tip13%"
- "%tip14%"
- "%tip15%"
- "%tip16%"
- "%tip17%"
- "%tip18%"
- "%tip19%"
- "%tip20%"
- "%tip21%"
- "%tip22%"
- "%tip23%"
- "%tip24%"
- "%tip25%"
- "%tip26%"
- "%tip27%"
- "%tip28%"
- "%tip29%"
- "%tip30%"
- "%tip31%"
- "%tip32%"
- "%tip33%"
- "%tip34%"
- "%tip35%"
- "%tip36%"
- "%tip37%"
- "%tip38%"
- "%tip39%"
