添加 'DragonCore/CommonItemTip.yml'

This commit is contained in:
502647092 2021-12-12 17:28:36 +00:00
parent 09ff991bc1
commit 65222fc056

View File

@ -0,0 +1,135 @@
鼠标X偏移: 10
鼠标Y偏移: -7
match: '.*'
priority: -999
Functions:
open: |-
界面变量.鼠标X偏移 = 方法.取YAML值('鼠标X偏移');
界面变量.鼠标Y偏移 = 方法.取YAML值('鼠标Y偏移');
界面变量.滚动值 = 0;
界面变量.宽度 = 方法.min(lore.width, 方法.取屏幕宽度) + 12;
界面变量.高度 = 方法.min(lore.height, 方法.取屏幕高度) + 8;
界面变量.X = 方法.取鼠标X + 界面变量.鼠标X偏移;
界面变量.Y = 方法.取鼠标Y + 界面变量.鼠标Y偏移;
(界面变量.Y + 界面变量.高度) > 方法.取屏幕高度 ? {
界面变量.鼠标Y偏移 = 界面变量.Y - ((界面变量.高度 + 界面变量.Y) - 方法.取屏幕高度);
(界面变量.Y + 界面变量.高度) > 方法.取屏幕高度 ? {
界面变量.高度 = 方法.取屏幕高度 - 15 - 方法.取鼠标Y;
};
} : 0;
lore.height > 界面变量.高度 ? {
界面变量.允许滚动 = true;
界面变量.最大可滚动值 = lore.height - 界面变量.高度 + 8;
界面变量.每次滚动距离 = 界面变量.最大可滚动值 / 5;
tip.texts = "鼠标滚轮查看更多";
} : 0;
界面变量.提示X = (界面变量.宽度 - tip.width) / 2 + 界面变量.X;
wheel: |-
界面变量.允许滚动 ? 0 : return 1;
界面变量.滚动距离 = 界面变量.滚动距离 - 方法.取滚轮值 * 界面变量.每次滚动距离;
界面变量.滚动距离 < 0 ? {
界面变量.滚动距离 = 0;
tip.texts = "鼠标滚轮查看更多";
} : {
界面变量.滚动距离 > 界面变量.最大可滚动值 ? {
界面变量.滚动距离 = 界面变量.最大可滚动值;
tip.texts = "";
} : 0;
};
preRender: |-
界面变量.X = 方法.取鼠标X + 界面变量.鼠标X偏移;
界面变量.Y = 方法.取鼠标Y + 界面变量.鼠标Y偏移;
界面变量.提示X = (界面变量.宽度 - tip.width) / 2 + 界面变量.X;
bg:
type: texture
x: 界面变量.X
y: 界面变量.Y
width: 界面变量.宽度
height: 界面变量.高度
texture: "tip/背景.png"
左边:
type: "texture"
x: "bg.x-2"
y: "bg.y+2"
width: "5"
height: "bg.height-4"
texture: "tip/左边.png"
上边:
type: "texture"
x: "bg.x+2"
y: "bg.y-2"
width: "bg.width-4"
height: "4"
texture: "tip/上边.png"
下边:
type: "texture"
x: "bg.x+2"
y: "bg.y+bg.height-2"
width: "bg.width-4"
height: "4"
texture: "tip/下边.png"
右边:
type: "texture"
x: "bg.x+bg.width-2"
y: "bg.y+2"
width: "4"
height: "bg.height-4"
texture: "tip/右边.png"
左上角:
type: "texture"
x: "bg.x-2"
y: "bg.y-2"
width: "5"
height: "5"
texture: "tip/左上角.png"
左下角:
type: "texture"
x: "bg.x-2"
y: "bg.y+bg.height-3"
width: "5"
height: "5"
texture: "tip/左下角.png"
右上角:
type: "texture"
x: "bg.x+bg.width-3"
y: "bg.y-2"
width: "5"
height: "5"
texture: "tip/右上角.png"
右下角:
type: "texture"
x: "bg.x+bg.width-3"
y: "bg.y+bg.height-3"
width: "5"
height: "5"
texture: "tip/右下角.png"
lore:
type: label
x: bg.x+5
y: bg.y+5-界面变量.滚动距离
texts: 界面变量.lines
limitX: bg.x
limitY: bg.y
limitWidth: bg.width
limitHeight: bg.height
tip:
type: label
x: 界面变量.提示X
y: bg.y + bg.height - 2
scale: 0.7
texts: ""