{
  "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.menu_autocomplete",
        "to_button_id": "button.rebind_mode",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.emote_selected",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.controller_secondary_select",
        "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",
    "$is_full_screen_layout": false,
    "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": "right",
          "property_bag": {
            "#index": "$emote_slot_index"
          }
        }
      }
    ]
  },

  "emote_wheel_screen_content": {
    "type": "stack_panel",
    "orientation": "vertical",
    "size": [ "100%", "100%" ],
    "controls": [
      {
        "top_padding": {
          "type": "panel",
          "size": [ "100%", "fill" ],
          "controls": [
            {
              "screen_header": {
                "type": "label",
                "size": [ "50%", "50%" ],
                "color": "$generic_button_text_color",
                "text_alignment": "center",
                "text": "emotes.header_text",
                "shadow": true
              }
            }
          ]
        }
      },
      {
        "root_panel": {
          "type": "panel",
          "size": [ "100%", 172 ],
          "controls": [
            {
              "emotes_panel@common_dialogs.main_panel": {
                "size": [ "100%y", "100%" ],
                "controls": [
                  {
                    "emote_name@persona.emote_label": {
                      "size": [ 56, 35 ],
                      "offset": [ 2, 9 ],
                      "text": "#emote_name",
                      "layer": 10,
                      "font_scale_factor": 0.8,
                      "shadow": true,
                      "bindings": [
                        {
                          "binding_name": "#emote_name",
                          "binding_condition": "always"
                        }
                      ]
                    }
                  },
                  {
                    "emote_wheel@persona.selection_wheel": {
                      "size": [ 185, "100%" ],
                      "inner_radius": 0.35,
                      "outer_radius": 1.0,
                      "$slice_count": 6,
                      "$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_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_select_0",
                            "$emote_image_offset": [ -31, -52 ],
                            "$emote_touch_label_offset": [ -102, -54 ]
                          }
                        },
                        {
                          "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_select_1",
                            "$emote_image_offset": [ 31, -52 ],
                            "$emote_touch_label_offset": [ 102, -54 ]
                          }
                        },
                        {
                          "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_select_2",
                            "$emote_image_offset": [ 62, 0 ],
                            "$emote_touch_label_offset": [ 133, 0 ]
                          }
                        },
                        {
                          "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_select_3",
                            "$emote_image_offset": [ 31, 52 ],
                            "$emote_touch_label_offset": [ 102, 54 ]
                          }
                        },
                        {
                          "emote_slot_4_content@persona.emote_wheel_slot_content": {
                            "$emote_slot_index": 4,
                            "$emote_slot_name": "emote_slot_4",
                            "$wheel_state_texture": "textures/ui/emote_wheel_select_4",
                            "$emote_image_offset": [ -31, 52 ],
                            "$emote_touch_label_offset": [ -103, 54 ]
                          }
                        },
                        {
                          "emote_slot_5_content@persona.emote_wheel_slot_content": {
                            "$emote_slot_index": 5,
                            "$emote_slot_name": "emote_slot_5",
                            "$wheel_state_texture": "textures/ui/emote_wheel_select_5",
                            "$emote_image_offset": [ -62, 0 ],
                            "$emote_touch_label_offset": [ -132, 0 ]
                          }
                        }
                      ],
                      "state_controls": [
                        "default_state",
                        "emote_slot_0",
                        "emote_slot_1",
                        "emote_slot_2",
                        "emote_slot_3",
                        "emote_slot_4",
                        "emote_slot_5"
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "gamepad_helper_panel": {
          "type": "panel",
          "size": [ "100%", " 100%c" ],
          "controls": [
            {
              "mid_padding_1": {
                "type": "panel",
                "size": [ "100%", 4 ]
              }
            },
            {
              "gamepad_helpers@common.empty_panel": {
                "type": "stack_panel",
                "orientation": "horizontal",
                "size": [ "100%c", "100%cm" ],
                "controls": [
                  {
                    "gamepad_y@common.gamepad_helper_y": {}
                  },
                  {
                    "gamepad_b@common.gamepad_helper_b": {}
                  },
                  {
                    "gamepad_ls@common.gamepad_helper_thumbstick_left": {}
                  },
                  {
                    "gamepad_a@common.gamepad_helper_a": {}
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "dressing_room_button_panel": {
          "type": "panel",
          "size": [ "100%", "100%c" ],
          "bindings": [
            {
              "binding_name": "(not #is_using_gamepad)",
              "binding_name_override": "#visible"
            }
          ],
          "controls": [
            {
              "mid_padding_2": {
                "type": "panel",
                "size": [ "100%", 4 ]
              }
            },
            {
              "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",
                "$font_type": "MinecraftTen",
                "$new_ui_label_offset": [ 0, -2 ],

                "focus_change_down": "FOCUS_OVERRIDE_STOP",
                "focus_change_left": "emote_wheel",
                "focus_change_right": "emote_wheel"
              }
            }
          ]
        }
      },
      {
        "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": "MinecraftTen",
    "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": [ "100%", 17 ],
    "text_alignment": "center",
    "color": "$dark_button_default_text_color"
  },

  "selection_wheel": {
    "type": "selection_wheel",

    "$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": 0,
    "$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"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "$button_name",
        "mapping_type": "focused"
      },
      {
        "to_button_id": "$button_name",
        "mapping_type": "pressed"
      },
      {
        "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"
      },
      {
        "from_button_id": "button.slot5",
        "to_button_id": "button.select_emote_slot_4",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.slot6",
        "to_button_id": "button.select_emote_slot_5",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_right",
        "to_button_id": "$iterate_right_button_name",
        "mapping_type": "global",
        "consume_event": false
      },
      {
        "from_button_id": "button.inventory_right",
        "to_button_id": "$iterate_right_button_name",
        "mapping_type": "global",
        "consume_event": false
      },
      {
        "from_button_id": "button.menu_left",
        "to_button_id": "$iterate_left_button_name",
        "mapping_type": "global",
        "consume_event": false
      },
      {
        "from_button_id": "button.inventory_left",
        "to_button_id": "$iterate_left_button_name",
        "mapping_type": "global",
        "consume_event": false
      }
    ],
    "property_bag": {
      "#hover_slice": 0
    },
    "$selection_wheel_bindings|default": [],
    "bindings": "$selection_wheel_bindings"
  }
}
