自定义聊天界面
配置文件
game_gui_chat.yml
game_gui_chat:
private:
background: true
enterClose: true
autoClear: true
permanentFocus: true
limit: 256
locationX: "4"
locationY: "h-12"
width: "w-4"
height: "12"
enterDos:
- "hudMessage<->left1@%input%"
color:
type: color
shape: 0
locationX: "2"
locationY: "h-14"
width: "w-4"
height: "12"
color: 0x88880000
endColor: 0x88880000
button:
type: button
defaultPath: 'local<->textures/gui/chat/emoji.png'
hoverPath: 'local<->textures/gui/chat/emoji_hover.png'
hoverSound: 'minecraft:ui.button.click'
clickSound: 'minecraft:ui.button.click'
locationX: "4"
locationY: "h-18-12-4"
width: "34"
height: "18"
clickDos:
- "condition<->str(%chat_input_emoji_child_opened%,true)@[2,3]@[4]"
- "closeChild<->chat_input_emoji_child"
- "invalidChat<->false"
- "openChild<->chat_input_emoji_child"
- "invalidChat<->true"
chat_input_emoji_child:
color:
type: color
shape: 0
locationX: "2"
locationY: "h-35-50"
width: "180"
height: "50"
color: 0x88000000
endColor: 0x88000000
button:
type: button
defaultPath: 'local<->textures/misc/air.png'
hoverPath: 'local<->textures/misc/translucent.png'
hoverSound: 'minecraft:ui.button.click'
clickSound: 'minecraft:ui.button.click'
locationX: "2"
locationY: "h-35-50"
width: "9"
height: "9"
texts:
- "鴀"
hoverTexts:
- "&c鴀"
clickDos:
- "writeChat<->鴀"
game_hud_chat.yml
game_hud_chat:
private:
EssentialSettings:
disableMinecraftHudChat: false
ChannelSettings:
channel1:
condition: "startStr(chatMessage,§公)"
limit: 100
splitWidth: "w*0.4+40"
collectDos:
- "insertLabel<->thisGui@canvasChannel1$MessageList@%chat_channel_channel1_size%@chatMessage"
- "addLabel<->thisGui@canvasChannel1$MessageList@chatMessage"
- "removeLabel<->thisGui@canvasChannel1$MessageList@100"
- "removeLabel<->thisGui@canvasChannel1$MessageList@first"
- "removeLabel<->thisGui@canvasChannel1$MessageList@last"
channel2:
condition: "startStr(chatMessage,§喇)"
splitWidth: "w*0.4+40"
limit: 100
collectDos:
- 'message<->channel2 频道收到了消息 chatMessage'
channel3:
condition: "startStr(chatMessage,§附)"
splitWidth: "w*0.4+40"
limit: 100
collectDos:
- 'message<->channel3 频道收到了消息 chatMessage'
default:
splitWidth: "w*0.4+40"
limit: 100
collectDos:
- 'message<->channel3 频道收到了消息 chatMessage'
other:
splitWidth: "w*0.4+40"
limit: 100
collectDos:
- 'message<->channel3 频道收到了消息 chatMessage'
channel1Switcher:
type: button
defaultPath: 'local<->textures/gui/chat/公告.png'
hoverPath: 'local<->textures/gui/chat/公告.png'
clickSound: 'minecraft:ui.button.click'
width: "w*0.05"
height: "w*0.025"
locationX: "w*0.1"
locationY: "h*0.89"
locationZ: "0"
clickDos:
- 'switchChannel<->channel1'
- 'calPlaceholder<->abc@%abc%+1'
- 'message<->§公 这是一条测试的公告,序号 %abc%'
channel2Switcher:
type: button
defaultPath: 'local<->textures/gui/chat/喇叭.png'
hoverPath: 'local<->textures/gui/chat/喇叭.png'
clickSound: 'minecraft:ui.button.click'
width: "w*0.05"
height: "w*0.025"
locationX: "w*0.18"
locationY: "h*0.89"
locationZ: "0"
clickDos:
- 'switchChannel<->channel2'
- 'calPlaceholder<->abc@%abc%+1'
- 'message<->§喇 这是一条测试的喇叭,序号 %abc%'
channel3Switcher:
type: button
defaultPath: 'local<->textures/gui/chat/附近.png'
hoverPath: 'local<->textures/gui/chat/附近.png'
clickSound: 'minecraft:ui.button.click'
width: "w*0.05"
height: "w*0.025"
locationX: "w*0.26"
locationY: "h*0.89"
locationZ: "0"
clickDos:
- 'switchChannel<->channel3'
- 'calPlaceholder<->abc@%abc%+1'
- 'message<->§私 这是一条测试的附近消息,序号 %abc%'
channel4Switcher:
type: button
defaultPath: 'local<->textures/gui/chat/其他.png'
hoverPath: 'local<->textures/gui/chat/其他.png'
clickSound: 'minecraft:ui.button.click'
width: "w*0.05"
height: "w*0.025"
locationX: "w*0.34"
locationY: "h*0.89"
locationZ: "0"
clickDos:
- 'switchChannel<->other'
- 'calPlaceholder<->abc@%abc%+1'
- 'message<->切换到了其他频道'
公告频道:
type: canvas
locationX: '0'
locationY: '0'
drag:
locationX: '8'
locationY: '1'
width: '184'
height: '8'
relativeParts:
公告滚动列表背景:
type: texture
path: "textures/gui/chat/背景.png"
locationX: '0'
locationY: '0'
width: '200'
height: '180'
公告滚动列表:
type: scroll
invalid: false
width: '184'
height: '164'
locationX: '8'
locationY: '8'
sliderV:
type: 1
width: "8"
height: "16"
color: 0x88888800
texts:
- "&e我是竖向滑块"
locationVX: '180'
locationVY: '12'
widthV: '10'
heightV: '164-24'
invalidV: false
scrollableV: '1000'
scrolledV: '0'
scrollableParts:
label:
type: label
align: "left"
scale: '1'
texts:
- "亲爱的: %player_name%"
- "您的世界: %world_name%"
locationX: "10"
locationY: "10"