{
  "namespace": "persona",

  "emote_wheel_screen@common.base_screen": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.controller_start",
        "to_button_id": "button.dressing_room",
        "mapping_type": "global"
      },
      {
        "from_button_id": "key.emote",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      }

    ],
    "$screen_animations": [
      "@common.screen_exit_animation_push_fade",
      "@common.screen_exit_animation_pop_fade",
      "@common.screen_entrance_animation_push_fade",
      "@common.screen_entrance_animation_pop_fade"
    ],
    "$default_text_color": [ 0.7, 0.7, 0.7 ],
    "$screen_content": "persona.emote_wheel_screen_content",
    "$screen_bg_content": "emote_wheel_touch_zone",
    "$is_full_screen_layout": true,
    "$fill_alpha":  0.0,
    "gamepad_cursor_deflection_mode": true
  },

  /////////////////////////////////////////////////////////////
  //
  // requires:
  //   - $emote_slot_index : int
  //   - $emote_slot_name : string
  //   - $wheel_state_texture : string : texture path
  //   - $emote_image_offset : vec2
  //   - $emote_touch_label_offset : vec2
  //
  /////////////////////////////////////////////////////////////
  "emote_wheel_slot_content": {
    "type": "panel",
    "controls": [
      {
        "$emote_slot_name@persona.wheel_state": {}
      },
      {
        "image_0@persona.emote_image": {
          "offset": "$emote_image_offset",
          "$property_bag": {
            "#index": "$emote_slot_index"
          }
        }
      },
      {
        "touch_label_0@persona.touch_name_label": {
          "offset": "$emote_touch_label_offset",
          "text_alignment": "$emote_touch_label_alignment",
          "property_bag": {
            "#index": "$emote_slot_index"
          }
        }
      }
    ]
  },

  "keyboard_hotkey_helpers": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "$keyboard_helper_size": [ 17, 17 ],
    "$hide_description": true,
    "controls": [
      {
        "keyboard_1@common.keyboard_helper_keys": {
          "size": "$keyboard_helper_size",
          "offset": [ 0, "-50% - 11px" ],
          "$keyboard_character": "keyboard.keyName.1",
          "$text_color": "$generic_button_text_color"
        }
      },
      {
        "keyboard_2@common.keyboard_helper_keys": {
          "size": "$keyboard_helper_size",
          "offset": [ "50% + 10px", 0 ],
          "$keyboard_character": "keyboard.keyName.2",
          "$text_color": "$generic_button_text_color"
        }
      },
      {
        "keyboard_3@common.keyboard_helper_keys": {
          "size": "$keyboard_helper_size",
          "offset": [ 0, "50% + 5px" ],
          "layer": 3,
          "$keyboard_character": "keyboard.keyName.3",
          "$text_color": "$generic_button_text_color"
        }
      },
      {
        "keyboard_4@common.keyboard_helper_keys": {
          "size": "$keyboard_helper_size",
          "offset": [ "-50% - 11px", 0 ],
          "$keyboard_character": "keyboard.keyName.4",
          "$text_color": "$generic_button_text_color"
        }
      }
    ]
  },

  "gamepad_hotkey_helpers": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "$hide_description": true,
    "controls": [
      {
        "gamepad_y@common.gamepad_helper_y": {
          "offset": [ 0, "-50% - 10px" ]
        }
      },
      {
        "gamepad_b@common.gamepad_helper_b": {
          "offset": [ "50% + 10px", 0 ]
        }
      },
      {
        "gamepad_a@common.gamepad_helper_a": {
          "offset": [ 0, "50% + 10px" ]
        }
      },
      {
        "gamepad_x@common.gamepad_helper_x": {
          "offset": [ "-50% - 10px", 0 ]
        }
      }
    ]
  },

  "emote_wheel_touch_zone@common_buttons.light_content_button": {
    "size": [ "100%", "100%" ],
    "$pressed_button_name": "button.menu_exit",
    "alpha": 0
  },

  "emote_selection_wheel@persona.selection_wheel": {
    "inner_radius": 0.35,
    "outer_radius": 1.0,
    "$slice_count": 4,
    "$button_name": "button.emote_selected",

    "$button_focus_precedence": 10,
    "focus_identifier": "emote_wheel",
    "focus_change_left": "FOCUS_OVERRIDE_STOP",
    "focus_change_right": "FOCUS_OVERRIDE_STOP",
    "focus_change_up": "FOCUS_OVERRIDE_STOP",

    "controls": [
      {
        "default_state@persona.wheel_state": {
          "texture": "textures/ui/emote_wheel_updated_base"
        }
      },
      {
        "emote_slot_0_content@persona.emote_wheel_slot_content": {
          "$emote_slot_index": 0,
          "$emote_slot_name": "emote_slot_0",
          "$wheel_state_texture": "textures/ui/emote_wheel_updated_select_0",
          "$emote_image_offset": [ 0, "-33.57%" ],
          "$emote_touch_label_offset": [ 0, "-52%" ],
          "$emote_touch_label_alignment": "center"
        }
      },
      {
        "emote_slot_1_content@persona.emote_wheel_slot_content": {
          "$emote_slot_index": 1,
          "$emote_slot_name": "emote_slot_1",
          "$wheel_state_texture": "textures/ui/emote_wheel_updated_select_1",
          "$emote_image_offset": [ "32.8125%", 0 ],
          "$emote_touch_label_offset": [ "92%", 0 ],
          "$emote_touch_label_alignment": "left"
        }
      },
      {
        "emote_slot_2_content@persona.emote_wheel_slot_content": {
          "$emote_slot_index": 2,
          "$emote_slot_name": "emote_slot_2",
          "$wheel_state_texture": "textures/ui/emote_wheel_updated_select_2",
          "$emote_image_offset": [ 0, "33.57%" ],
          "$emote_touch_label_offset": [ 0, "62%" ],
          "$emote_touch_label_alignment": "center"
        }
      },
      {
        "emote_slot_3_content@persona.emote_wheel_slot_content": {
          "$emote_slot_index": 3,
          "$emote_slot_name": "emote_slot_3",
          "$wheel_state_texture": "textures/ui/emote_wheel_updated_select_3",
          "$emote_image_offset": [ "-32.8125%", 0 ],
          "$emote_touch_label_offset": [ "-92%", 0 ],
          "$emote_touch_label_alignment": "right"
        }
      }
    ],
    "state_controls": [
      "default_state",
      "emote_slot_0",
      "emote_slot_1",
      "emote_slot_2",
      "emote_slot_3"
    ]
  },

  "emote_wheel_screen_content": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "top_padding": {
          "type": "panel",
          "size": [ "100%", "fill" ]
        }
      },
      {
        "root_panel": {
          "type": "panel",
          "size": [ "100%", "55% + 35px" ],
          "controls": [
            {
              "emotes_panel@common_dialogs.main_panel": {
                "size": [ "100%y", "100%" ],
                "controls": [
                  {
                    "emote_name@persona.emote_label": {
                      "size": [ 56, 35 ],
                      "offset": [ 0, "7%" ],
                      "text": "#emote_name",
                      "layer": 10,
                      "font_type": "smooth",
                      "font_scale_factor": 0.8,
                      "shadow": true,
                      "bindings": [
                        {
                          "binding_name": "#emote_name",
                          "binding_condition": "always"
                        }
                      ]
                    }
                  },
                  {
                    "emote_wheel_content_panel": {
                      "type": "panel",
                      "size": [ "89.51%y", "100% - 40px" ],
                      "controls": [
                        { "gamepad_helpers@persona.gamepad_hotkey_helpers": {} },
                        { "keyboard_helpers@persona.keyboard_hotkey_helpers": {} },
                        { "emote_wheel@persona.emote_selection_wheel": {} }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "instruction_padding": {
          "type": "panel",
          "size": [ "100%", 2 ]
        }
      },
      {
        "instruction_panel": {
          "type": "panel",
          "size": [ "100%", "100%c" ],
          "controls": [
            {
              "instruction_background": {
                "type": "image",
                "texture": "textures/ui/Black",
                "alpha": 0.7,
                "size": [ "100%c + 10px", "100%c + 14px" ],
                "min_size": [ 1 , "100%c + 14px" ],
                "max_size": [ "100%c + 10px", "100%c + 14px" ],
                "controls": [
                  {
                    "gamepad_instruction_stack": {
                      "type": "stack_panel",
                      "orientation": "vertical",
                      "size": [ "100%cm", "100%c" ],
                      "controls": [
                        {
                          "instruction_label_gamepad": {
                            "type": "label",
                            "size": [ "default", "default" ],
                            "max_size": [ 300, 28 ],
                            "offset": [ 0, -3 ],
                            "layer": 2,
                            "color": "$emote_screen_gamepad_instruction_colors",
                            "text_alignment": "center",
                            "text": "#emote_screen_instructions",
                            "font_type": "MinecraftSeven",
                            "line_padding": 5.0,
                            "shadow": true,
                            "bindings": [
                              {
                                "binding_name": "#emote_screen_instructions",
                                "binding_condition": "always"
                              },
                              {
                                "binding_name": "#is_using_gamepad",
                                "binding_name_override": "#visible"
                              }
                            ]
                          }
                        },
                        {
                          "gamepad_helpers@common.empty_panel": {
                            "size": [ "100%sm", "100%c" ],
                            "controls": [
                              {
                                "gamepad_helper_stack": {
                                  "type": "stack_panel",
                                  "orientation": "horizontal",
                                  "size": [ "100%c", "100%cm" ],
                                  "offset": [ 0, 2 ],
                                  "controls": [
                                    {
                                      "gamepad_start@common.gamepad_helper_start": {}
                                    },
                                    {
                                      "gamepad_exit_panel@common.empty_panel": {
                                        "size": [ 100, "100%sm" ],
                                        "controls": [
                                          {
                                            "gamepad_exit": {
                                              "type": "label",
                                              "color": "$f_color_format",
                                              "text": "#emote_screen_exit",
                                              "text_alignment": "center",
                                              "bindings": [
                                                {
                                                  "binding_name": "#emote_screen_exit",
                                                  "binding_condition": "always"
                                                },
                                                {
                                                  "binding_name": "#is_using_gamepad",
                                                  "binding_name_override": "#visible"
                                                }
                                              ]
                                            }
                                          }
                                        ]
                                      }
                                    }
                                  ]
                                }
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  {
                    "instruction_label_keyboard": {
                      "type": "label",
                      "size": [ "default", "default" ],
                      "max_size": [ 300, 20 ],
                      "layer": 2,
                      "color": "$generic_button_text_color",
                      "text_alignment": "center",
                      "text": "emotes.instructions_keyboard",
                      "line_padding": 5.0,
                      "shadow": true,
                      "bindings": [
                        {
                          "binding_name": "#is_using_mouse",
                          "binding_name_override": "#visible"
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "dressing_room_button_panel": {
          "type": "panel",
          "size": [ "100%", 27 ],
          "bindings": [
            {
              "binding_name": "(not #is_using_gamepad)",
              "binding_name_override": "#visible"
            }
          ],
          "controls": [
            {
              "dressing_room_button@common_buttons.light_text_button": {
                "$pressed_button_name": "button.dressing_room",
                "size": [ 120, 23 ],
                "enabled": "(not $store_disabled)",
                "$button_text": "emotes.change_emotes",
                "$default_text_color": "$light_button_default_text_color",

                "focus_change_down": "FOCUS_OVERRIDE_STOP",
                "focus_change_left": "emote_wheel",
                "focus_change_right": "emote_wheel",
                "bindings": [
                  {
                    "binding_name": "#dressing_room_button_visible",
                    "binding_name_override": "#visible"
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "bottom_padding": {
          "type": "panel",
          "size": [ "100%", "fill" ]
        }
      }
    ]
  },

  "touch_name_label": {
    "type": "label",
    "size": [ 75, 22 ],
    "text_alignment": "left",
    "text": "#text",
    "shadow": true,
    "color": "$dark_button_default_text_color",
    "font_type": "smooth",
    "tts_skip_message": true,
    "bindings": [
      {
        "binding_name": "#is_touch_mode",
        "binding_name_override": "#visible"
      },
      {
        "binding_name": "#emote_name_touch",
        "binding_name_override": "#text",
        "binding_condition": "always"
      }
    ]
  },

  "emote_image@common.empty_panel": {
    "layer": 2,
    "size": [ "100%c", "100%c" ],
    "controls": [
      {
        "empty": {
          "type": "image",
          "texture": "textures/ui/icon_none",
          "size": [ 14, 14 ],
          "property_bag": "$property_bag",
          "bindings": [
            {
              "binding_name": "(not #emote_is_valid)",
              "binding_name_override": "#visible",
              "binding_condition": "always"
            }
          ]
        }
      },
      {
        "emote_preview": {
          "type": "panel",
          "size": [ 42, 42 ],
          "property_bag": "$property_bag",
          "bindings": [
            {
              "binding_name": "#emote_is_valid",
              "binding_name_override": "#visible",
              "binding_condition": "always"
            }
          ],
          "controls": [
            {
              "valid": {
                "type": "image",
                "size": [ "100%", "100%" ],
                "texture": "#texture",
                "property_bag": "$property_bag",
                "bindings": [
                  {
                    "binding_name": "#emote_image",
                    "binding_name_override": "#texture",
                    "binding_condition": "always"
                  },
                  {
                    "binding_name": "#emote_image_file_system",
                    "binding_name_override": "#texture_file_system",
                    "binding_condition": "always"
                  },
                  {
                    "binding_name": "#emote_image_tint",
                    "binding_name_override": "#color",
                    "binding_condition": "always"
                  },
                  {
                    "binding_name": "#image_is_valid",
                    "binding_name_override": "#visible",
                    "binding_condition": "always"
                  }
                ]
              }
            },
            {
              "valid_no_image": {
                "type": "panel",
                "size": [ "100%", "100%" ],
                "property_bag": "$property_bag",
                "bindings": [
                  {
                    "binding_name": "(not #image_is_valid)",
                    "binding_name_override": "#visible",
                    "binding_condition": "always"
                  }
                ],
                "controls": [
                  {
                    "valid_text": {
                      "type": "label",
                      "size": [ "100%", 13 ],
                      "text_alignment": "center",
                      "color": "$dark_button_default_text_color",
                      "font_scale_factor": 1.5,
                      "shadow": true,
                      "property_bag": "$property_bag",
                      "text": "#text",
                      "bindings": [
                        {
                          "binding_name": "#emote_index_name",
                          "binding_name_override": "#text",
                          "binding_condition": "always"
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },

  "swap_emote_button@common_buttons.dark_text_button": {
    "$pressed_button_name": "button.rebind_emote",
    "size": [ "16%", "100%" ]
  },

  "wheel_state": {
    "type": "image",
    "layer": 1,
    "texture": "$wheel_state_texture"
  },

  "emote_label": {
    "ignored": "(not #visible)",
    "type": "label",
    "size": [ "200%", 100 ],
    "text_alignment": "center",
    "color": "$dark_button_default_text_color"
  },

  "selection_wheel": {
    "type": "selection_wheel",
    "size": [ "100%", "100%" ],

    "$slice_count|default": 1,
    "$inner_radius|default": 0.0,
    "$outer_radius|default": 1.0,
    "$button_name|default": "",
    "$iterate_left_button_name|default": "button.iterate_selection_left",
    "$iterate_right_button_name|default": "button.iterate_selection_right",
    "slice_count": "$slice_count",
    "inner_radius": "$inner_radius",
    "outer_radius": "$outer_radius",

    "focus_enabled": true,

    "button_name": "$button_name",
    "iterate_left_button_name": "$iterate_left_button_name",
    "iterate_right_button_name": "$iterate_right_button_name",
    "initial_button_slice": -1,
    "$button_focus_precedence|default": 0,
    "default_focus_precedence": "$button_focus_precedence",

    "$button_tts_name|default": "",
    "$button_tts_header|default": "",
    "$tts_section_header|default": "",
    "$button_tts_control_type_order_priority|default": 100,

    "tts_name": "$button_tts_name",
    "tts_control_header": "$button_tts_header",
    "tts_section_header": "$tts_section_header",
    "tts_control_type_order_priority": "$button_tts_control_type_order_priority",
    "tts_skip_message": true,

    "layer": 1,
    "sound_name": "random.click",
    "sound_volume": 1.0,
    "sound_pitch": 1.0,
    "state_controls": [],
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "$button_name",
        "mapping_type": "pressed"
      },
      {
        "to_button_id": "$button_name",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_secondary_select",
        "to_button_id": "button.select_emote_slot_0",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.select_emote_slot_1",
        "scope": "controller",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.select_emote_slot_2",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_clear",
        "to_button_id": "button.select_emote_slot_3",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.slot1",
        "to_button_id": "button.select_emote_slot_0",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.slot2",
        "to_button_id": "button.select_emote_slot_1",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.slot3",
        "to_button_id": "button.select_emote_slot_2",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.slot4",
        "to_button_id": "button.select_emote_slot_3",
        "mapping_type": "global"
      }
    ],
    "property_bag": {
      "#hover_slice": 0
    },
    "$selection_wheel_bindings|default": [],
    "bindings": "$selection_wheel_bindings"
  }
}
