Files
2026-03-08 15:34:38 -05:00

747 lines
20 KiB
JSON

{
"namespace": "chat",
// Button Images //
"down_arrow_image": {
"type": "image",
"size": [ 12, 8 ],
"texture": "textures/ui/chat_down_arrow"
},
"keyboard_image": {
"type": "image",
"size": [ 9, 7 ],
"texture": "textures/ui/chat_keyboard"
},
"send_image": {
"type": "image",
"size": [ 21, 18 ],
"texture": "textures/ui/chat_send"
},
"send_panel": {
"type": "stack_panel",
"orientation": "horizontal",
"size": [ 44, 17 ],
"controls": [
{
"send_image_panel": {
"type": "panel",
"size": [ "fill", "100%c" ],
"controls": [
{ "send_image@send_image": {} }
]
}
},
{
"gamepad_x_button": {
"type": "stack_panel",
"orientation": "horizontal",
"size": [ 23, "100%" ],
"controls": [
{
"side_padding": {
"type": "panel",
"size": [ 2, "100%" ]
}
},
{
"gamepad_x_button_image": {
"type": "panel",
"controls": [
{
"icon@common.gamepad_helper_x": {
"$icon_description_bind_type": "none"
}
}
]
}
}
],
"bindings": [
{
"binding_name": "#gamepad_helper_visible",
"binding_name_override": "#visible"
}
]
}
}
]
},
"keyboard_image_panel": {
"type": "panel",
"controls": [
{
"keyboard_image@chat.keyboard_image": {
"bindings": [
{
"binding_name": "(not #keyboard_being_used)",
"binding_name_override": "#visible"
}
]
}
},
{
"down_arrow_image@chat.down_arrow_image": {
"bindings": [
{
"binding_name": "#keyboard_being_used",
"binding_name_override": "#visible"
}
]
}
}
]
},
// Buttons //
"small_button@common_buttons.light_content_button": {
"size": [ 27, 27 ],
"$pressed_button_name": "button.send_message",
"anchor_from": "bottom_right",
"anchor_to": "bottom_right"
},
"keyboard_button@chat.small_button": {
"$button_content": "chat.keyboard_image_panel",
"$pressed_button_name": "button.keyboard_toggle",
"$focus_id": "keyboard_button_focus_id",
"bindings": [
{
"binding_name": "#keyboard_button_focus_override_up",
"binding_name_override": "#focus_change_up"
},
{
"binding_name": "#keyboard_button_focus_override_down",
"binding_name_override": "#focus_change_down"
}
]
},
"send_button@common_buttons.light_text_form_fitting_button": {
"$pressed_button_name": "button.send_message",
"$anchor": "bottom_right",
"size": [ "100%c", 27 ],
"focus_enabled": false,
"$button_type_panel": "chat.send_panel",
"bindings": [
{
"binding_name": "#send_button_visible",
"binding_name_override": "#enabled"
}
]
},
"hide_toggle@settings_common.option_toggle": {
"$option_binding_name": "#hide_chat",
"$option_enabled_binding_name": "#hide_chat_enabled",
"$toggle_name": "hide_chat"
},
// Messages Panel //
"messages_text": {
"type": "panel",
"size": [ "100%", "100%c" ],
"controls": [
{
"text": {
"type": "label",
"color": "$chat_text_color",
"localize": false,
"size": [ "100%", "default" ],
"text": "#text"
}
}
],
"bindings": [
{
"binding_name": "#chat_visible",
"binding_name_override": "#visible"
}
]
},
"messages_stack_panel": {
"type": "stack_panel",
"orientation": "vertical",
"$scrolling_content_anchor_from": "bottom_left",
"$scrolling_content_anchor_to": "bottom_left",
"factory": {
"name": "messages_factory",
"control_name": "messages_text",
"max_children_size": 100
}
},
"messages_scrolling_panel@common.scrolling_panel": {
"type": "panel",
"size": [ "100%-2px", "100%-50px" ],
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"offset": [ 2, -27 ],
"$scrolling_content": "chat.messages_stack_panel",
"$scroll_size": [ 5, "100%-4px" ],
"$jump_to_bottom_on_update": true,
"$show_background": false
},
// Chat Text Edit //
"text_edit_box@common.text_edit_box": {
"$enable_profanity_filter": false,
"anchor_from": "top_left",
"anchor_to": "top_left",
"size": [ "fill", 27 ],
"max_length": 512,
"$text_box_name": "#message_text_box",
"$text_edit_box_content_binding_name": "#text_box_text",
"$text_edit_box_label_size": [ "default", "default" ],
"$text_edit_box_deselected_to_button_id": "button.chat_menu_cancel",
"place_holder_control": "",
"selected": "$mouse", // Only start selected if input is currently mouse
// This one thinks it's so important, it gets selected first
"default_focus_precedence": 1,
"$focus_id": "text_edit_box_focus_id",
"$focus_override_right": "keyboard_button_focus_id",
"$focus_override_left": "host_main_button_focus_id",
"$focus_override_down": "text_edit_box_focus_id",
"$focus_override_up": "text_edit_box_focus_id",
"$mouse_controls": false,
"$deselectable_binding_name": "(not #is_input_type_mouse)",
"$deselectable_binding_type": "global",
"variables": [
{
"requires": "$mouse",
"$mouse_controls": true
}
],
"bindings": [
{
"binding_type": "$text_edit_box_enabled_binding_type",
"binding_collection_name": "$text_edit_box_grid_collection_name",
"binding_name": "$text_box_enabled_binding_name",
"binding_name_override": "#enabled"
},
{
"binding_type": "$deselectable_binding_type",
"binding_name": "$deselectable_binding_name",
"binding_name_override": "#can_be_deselected"
},
{
"binding_name": "#bottom_button_focus_override_up",
"binding_name_override": "#focus_change_up"
},
{
"binding_name": "#bottom_button_focus_override_down",
"binding_name_override": "#focus_change_down"
}
],
"button_mappings": [
// Original Mappings //
{
"from_button_id": "button.menu_select",
"to_button_id": "button.menu_select",
"handle_select": true,
"handle_deselect": false,
"mapping_type": "pressed"
},
{
"from_button_id": "button.menu_ok",
"to_button_id": "button.menu_select",
"handle_select": true,
"handle_deselect": true,
"mapping_type": "focused"
},
{
"from_button_id": "button.menu_cancel",
"to_button_id": "button.chat_menu_cancel",
"handle_select": false,
"handle_deselect": false,
"ignored": "$mouse_controls",
"mapping_type": "global"
},
{
"from_button_id": "button.menu_cancel",
"to_button_id": "button.menu_cancel",
"handle_select": false,
"handle_deselect": true,
"ignored": "(not $mouse_controls)",
"mapping_type": "global"
},
// Extra Mappings //
{
"from_button_id": "button.menu_select",
"to_button_id": "button.menu_select",
"handle_select": false,
"handle_deselect": "$mouse_controls",
"mapping_type": "global"
},
{
"from_button_id": "button.menu_autocomplete",
"to_button_id": "button.menu_autocomplete",
"handle_select": true,
"handle_deselect": false,
"mapping_type": "global"
},
{
"from_button_id": "button.menu_autocomplete_back",
"to_button_id": "button.menu_autocomplete_back",
"handle_select": true,
"handle_deselect": false,
"mapping_type": "global"
},
{
"from_button_id": "button.menu_textedit_up",
"to_button_id": "button.menu_textedit_up",
"handle_select": true,
"handle_deselect": false,
"mapping_type": "global"
},
{
"from_button_id": "button.menu_textedit_down",
"to_button_id": "button.menu_textedit_down",
"handle_select": true,
"handle_deselect": false,
"mapping_type": "global"
},
// Controller Mappings //
{
"from_button_id": "button.controller_secondary_select",
"to_button_id": "button.mute_chat",
"handle_select": false,
"handle_deselect": false,
"mapping_type": "global"
},
{
"from_button_id": "button.controller_select",
"to_button_id": "button.send_message",
"mapping_type": "global",
"handle_select": false,
"handle_deselect": false
},
{
"from_button_id": "button.controller_start",
"to_button_id": "button.send_message",
"mapping_type": "global",
"handle_select": false,
"handle_deselect": false
},
{
"from_button_id": "button.controller_autocomplete",
"to_button_id": "button.menu_autocomplete",
"handle_select": false,
"handle_deselect": false,
"mapping_type": "global"
},
{
"from_button_id": "button.controller_autocomplete_back",
"to_button_id": "button.menu_autocomplete_back",
"handle_select": false,
"handle_deselect": false,
"mapping_type": "global"
},
{
"from_button_id": "button.controller_textedit_up",
"to_button_id": "button.menu_textedit_up",
"handle_select": false,
"handle_deselect": false,
"mapping_type": "global"
},
{
"from_button_id": "button.controller_textedit_down",
"to_button_id": "button.menu_textedit_down",
"handle_select": false,
"handle_deselect": false,
"mapping_type": "global"
}
]
},
// Commands Background //
"commands_background": {
"type": "image",
"size": [ "100%", "100%c" ],
"texture": "textures/ui/White",
"color": [ 0.0, 0.0, 0.0 ]
},
// Auto Complete //
"auto_complete_panel_contents_with_item": {
"type": "panel",
"anchor_from": "top_left",
"anchor_to": "top_left",
// We have to manually put in the size because item renderer is weird.
"size": [ "100%", 10 ],
"layer": 5,
"controls": [
{
"auto_complete_item_renderer@common.item_renderer": {
"size": [ 9, 9 ],
"offset": [ -2, -4 ],
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"bindings": [
{
"binding_name": "#auto_complete_item",
"binding_type": "collection",
"binding_name_override": "#item_id_aux",
"binding_collection_name": "auto_complete"
}
]
}
},
{
"text": {
"type": "label",
"color": "$chat_text_color",
"offset": [ 2, 0 ],
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"text": "#text",
"bindings": [
{
"binding_type": "collection",
"binding_name": "#auto_complete_text",
"binding_name_override": "#text",
"binding_collection_name": "auto_complete"
}
]
}
}
]
},
"auto_complete_panel": {
"type": "panel",
"size": [ "100%", "100%" ],
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"controls": [
{
"panel": {
"type": "panel",
"size": [ "100%", "100%" ],
"max_size": [ "100%", "100%" ],
"min_size": [ 0, 0 ],
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"controls": [
{
"auto_complete_grid": {
"type": "grid",
"grid_item_template": "chat.auto_complete_panel_contents_with_item",
"grid_fill_direction": "vertical",
"collection_name": "auto_complete",
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"size": [ "100%", "100%" ],
"bindings": [
{
"binding_name": "#get_grid_size",
"binding_type": "collection",
"binding_collection_name": "auto_complete"
}
]
}
}
]
}
}
]
},
// Commands Stack Panel //
"commands_panel": {
"type": "panel",
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"offset": [ 0, -27 ],
"size": [ "100%", "100%-50px" ],
"controls": [
{
"auto_complete_panel@chat.auto_complete_panel": {
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"layer": 1
}
}
]
},
// Chat Bottom Panel //
"chat_bottom_panel": {
"type": "stack_panel",
"orientation": "horizontal",
"anchor_from": "bottom_middle",
"anchor_to": "bottom_middle",
"size": [ "100%", 27 ],
"min_size": [ "100%", 27 ],
"controls": [
{ "keyboard_button@chat.keyboard_button": { "layer": 2 } },
{ "host_main_button@host_options.host_main_button": { "layer": 2 } },
{ "text_box@chat.text_edit_box": {} },
{
"send_button@chat.send_button": {
"offset": [ -20, 0 ],
"layer": 2
}
}
]
},
// Title Bar //
"title_text": {
"type": "panel",
"size": [ "fill", "100%" ],
"controls": [
{
"title_panel": {
"type": "label",
"size": [ "default", 10 ],
"text": "#text",
"offset": [ 28, -1 ],
"color": "$title_text_color",
"layer": 2,
"bindings": [
{
"binding_name": "#chat_title_text",
"binding_name_override": "#text"
}
]
}
}
]
},
"mute_text": {
"type": "panel",
"size": [ "100%c", "100%" ],
"controls": [
{
"title_panel": {
"type": "label",
"size": [ "default", 10 ],
"text": "chat.mute",
"offset": [ 2, -1 ],
"color": "$title_text_color",
"layer": 2
}
}
]
},
"mute_interaction": {
"type": "panel",
"size": [ "100%c", "100%" ],
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"controls": [
// Yes or No //
{
"yes_or_no_panel": {
"type": "panel",
"size": [ 24, "100%" ],
"controls": [
{
"yes_or_no_label": {
"type": "label",
"size": [ 20, 8 ],
"offset": [ -20, -2 ],
"text": "#text",
"color": "$title_text_color",
"layer": 2,
"bindings": [
{
"binding_name": "#text_chat_hidden",
"binding_name_override": "#text"
}
]
}
}
]
}
},
// Toggle for Keyboad and Touch //
{
"toggle_panel": {
"type": "panel",
"size": [ "100%c", "100%c" ],
"anchor_from": "bottom_left",
"anchor_to": "bottom_left",
"controls": [
{
"hide_toggle@chat.hide_toggle": {
"size": [ 32, "100%c" ],
"offset": [ 20, 1 ],
"bindings": [
{
"binding_name": "(not #gamepad_helper_visible)",
"binding_name_override": "#visible"
}
]
}
}
]
}
},
{
"gamepad_y_button": {
"type": "panel",
"size": [ 24, 17 ],
"offset": [ 6, -1 ],
"controls": [
{
"icon@common.gamepad_helper_y": {
"$icon_description_bind_type": "none"
}
}
],
"bindings": [
{
"binding_name": "#gamepad_helper_visible",
"binding_name_override": "#visible"
}
]
}
}
]
},
"back_content_panel": {
"type": "panel",
"size": [ "100%c", "100%" ],
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"controls": [
{
"back_button@common.back_button": {
"offset": [ 0, -1 ],
"$button_text_binding_type": "global",
"$button_text": "#back_button_text"
}
},
{
"gamepad_back_helper": {
"type": "panel",
"size": [ "100%c", 26 ],
"offset": [ -4, -1 ],
"$gamepad_helper_icon_description_text_color": "$light_glyph_default_color",
"$gamepad_helper_icon_description_shadow": false,
"controls": [
{
"gamepad_helper_button@common.gamepad_helper_b": {
"$icon_description_bind": "#back_button_text"
}
}
]
}
}
]
},
"chat_header_with_mute": {
"type": "stack_panel",
"size": [ "100%", "100%" ],
"$back_button_text": "controller.buttonTip.back",
"controls": [
{
"top_bar@common_store.store_top_bar": {
"size": [ "100%", 23 ],
"controls": [
{
"title_stack_panel": {
"type": "stack_panel",
"size": [ "100%", 19 ],
"orientation": "horizontal",
"controls": [
{
"padding1": {
"type": "panel",
"size": [ 2, "100%" ]
}
},
{
"back_button_content_panel@chat.back_content_panel": {
}
},
{ "title@chat.title_text": {} },
{
"padding2": {
"type": "panel",
"size": [ 2, "100%" ]
}
},
{ "mute@chat.mute_text": {} },
{
"padding3": {
"type": "panel",
"size": [ 16, "100%" ]
}
},
{ "mute_interact@chat.mute_interaction": {} },
{
"padding4": {
"type": "panel",
"size": [ 2, "100%" ]
}
}
]
}
}
]
}
}
]
},
// Main Screen //
"chat_screen@common.base_screen": {
"close_on_player_hurt": true,
"$screen_content": "chat.chat_screen_content"
},
"chat_screen_content": {
"type": "panel",
"controls": [
{
"background": {
"type": "image",
"size": [ "100%", "100%" ],
"texture": "textures/ui/White",
"color": [ 0.0, 0.0, 0.0 ],
"alpha": 0.5
}
},
{ "messages_panel@chat.messages_scrolling_panel": {} },
{ "chat_bottom_panel@chat.chat_bottom_panel": {} },
{ "chat_top_panel@chat.chat_header_with_mute": { } },
{ "commands_panel@chat.commands_panel": { "layer": 11 } },
{ "host_main_panel@host_options.host_panel": { "layer": 12 } }
]
}
}