{
  "namespace": "beacon",
  //---------------------------------------------------------------------------
  // Screens
  //---------------------------------------------------------------------------

  "selected_item_details@common.selected_item_details": {
    "offset": [ 0, 0 ]
  },

  "beacon_panel": {
    "type": "panel",
    "controls": [
      { "container_gamepad_helpers@common.container_gamepad_helpers": {} },
      {
        "selected_item_details_factory@common.selected_item_details_factory": {
          "control_name": "@beacon.selected_item_details"
        }
      },
      { "item_lock_notification_factory@common.item_lock_notification_factory": {} },
      {
        "root_panel@common.root_panel": {
          "layer": 1,
          "size": [ 256, 219 ],
          "controls": [
            { "common_panel@common.common_panel": {} },
            {
              "beacon_inventory": {
                "type": "panel",
                "controls": [
                  {
                    "beacon_inner_panel@beacon.beacon_inner_panel": {
                      "offset": [ 0, 4 ],
                      "layer": 2
                    }
                  },
                  {
                    "payment_panel@beacon.payment_panel": {
                      "offset": [ 0, 8 ],
                      "layer": 2
                    }
                  },
                  {
                    "inventory_panel_bottom_half@common.inventory_panel_bottom_half": {
                      "layer": 2,
                      "$button_ref": "beacon.inventory_slot_button"
                    }
                  },
                  {
                    "hotbar_grid_template@common.hotbar_grid_template": {
                      "$button_ref": "beacon.hotbar_slot_button"
                    }
                  },
                  { "inventory_selected_icon_button@common.inventory_selected_icon_button": {} },
                  { "gamepad_cursor@common.gamepad_cursor_button": {} }
                ]
              }
            }
          ]
        }
      },
      { "flying_item_renderer@common.flying_item_renderer": { "layer": 12 } }
    ]
  },

  "inventory_slot_button@common.container_slot_button_prototype": {
    "focus_mapping": [
      {
        "focus_identifier": "inventory_items8",
        "focus_change_right": "FOCUS_OVERRIDE_STOP"
      },
      {
        "focus_identifier": "inventory_items17",
        "focus_change_right": "FOCUS_OVERRIDE_STOP"
      },
      {
        "focus_identifier": "inventory_items26",
        "focus_change_right": "FOCUS_OVERRIDE_STOP"
      }
    ]
  },

  "hotbar_slot_button@common.container_slot_button_prototype": {
    "focus_mapping": [
      {
        "focus_identifier": "hotbar_items8",
        "focus_change_right": "FOCUS_OVERRIDE_STOP"
      }
    ]
  },

  "image_atlas": {
    "type": "image"
  },

  "pyramid_image@beacon.image_atlas": {
    "size": [ 19, 20 ],
    "anchor_to": "top_left",
    "anchor_from": "top_middle"
  },

  "pyramid_panel": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "anchor_to": "top_middle",
    "anchor_from": "top_middle",
    "controls": [
      {
        "level1@beacon.pyramid_image": {
          "texture": "textures/ui/pyramid_level_1",
          "offset": [ -98, 18 ]
        }
      },
      {
        "level2@beacon.pyramid_image": {
          "texture": "textures/ui/pyramid_level_2",
          "offset": [ -98, 43 ]
        }
      },
      {
        "level3@beacon.pyramid_image": {
          "texture": "textures/ui/pyramid_level_3",
          "offset": [ -98, 68 ]
        }
      },
      {
        "level4@beacon.pyramid_image": {
          "texture": "textures/ui/pyramid_level_4",
          "offset": [ 42, 18 ]
        }
      }
    ]
  },
  "item_seperator@beacon.image_atlas": {
    "size": [ 5, 18 ],
    "texture": "textures/ui/item_seperator",
    "anchor_to": "top_left",
    "anchor_from": "top_left"
  },
  "item_renderer": {
    "type": "custom",
    "renderer": "inventory_item_renderer",
    "size": [ 16, 16 ],
    "anchor_to": "top_left",
    "anchor_from": "top_left"
  },
  "usable_items_panel": {
    "type": "panel",
    "size": [ 104, 18 ],
    "controls": [
      {
        "netherite@beacon.item_renderer": {
          "offset": [ 0, 0 ],
          "property_bag": {
            "#item_id_aux": 48627712
          },
          "bindings": [
            {
              "binding_name": "#supports_netherite",
              "binding_name_override": "#visible"
            }
          ]
        }
      },
      {
        "item_seperator_0@beacon.item_seperator": {
          "offset": [ 16, 0 ],
          "bindings": [
            {
              "binding_name": "#supports_netherite",
              "binding_name_override": "#visible"
            }
          ]
        }
      },
      {
        "emerald@beacon.item_renderer": {
          "offset": [ 22, 0 ],
          "property_bag": {
            "#item_id_aux": 25427968
          }
        }
      },
      {
        "item_seperator_1@beacon.item_seperator": {
          "offset": [ 38, 0 ]
        }
      },
      {
        "diamond@beacon.item_renderer": {
          "offset": [ 44, 0 ],
          "property_bag": {
            "#item_id_aux": 17301504
          }
        }
      },
      {
        "item_seperator_2@beacon.item_seperator": {
          "offset": [ 60, 0 ]
        }
      },
      {
        "gold@beacon.item_renderer": {
          "offset": [ 66, 0 ],
          "property_bag": {
            "#item_id_aux": 17432576
          }
        }
      },
      {
        "item_seperator_3@beacon.item_seperator": {
          "offset": [ 82, 0 ]
        }
      },
      {
        "iron@beacon.item_renderer": {
          "offset": [ 88, 0 ],
          "property_bag": {
            "#item_id_aux": 17367040
          }
        }
      }
    ]
  },
  "base_image@beacon.image_atlas": {
    "$image_size|default": [ 18, 18 ],
    "size": "$image_size",
    "texture": "$image_texture",
    "bindings": [
      {
        "binding_name": "#button_visible",
        "binding_name_override": "#visible",
        "binding_collection_name": "$button_name",
        "binding_type": "collection"
      }
    ]
  },
  "hover_text@common.hover_text": {
    "bindings": [
      {
        "binding_name": "#button_hover",
        "binding_name_override": "#hover_text",
        "binding_collection_name": "$button_name",
        "binding_type": "collection"
      }
    ]
  },
  "hover_state": {
    "type": "image",
    "texture": "",
    "controls": [
      { "hover_text@beacon.hover_text": {} }
    ]
  },

  "button_unchecked_default@beacon.image_atlas": {
    "texture": "textures/ui/beacon_button_default"
  },
  "button_unchecked_hover@beacon.image_atlas": {
    "size": [ 22, 22 ],
    "texture": "textures/ui/beacon_button_hover",
    "controls": [
      { "hover_text@beacon.hover_text": {} }
    ]
  },
  "button_checked_hover@beacon.image_atlas": {
    "texture": "textures/ui/beacon_button_pressed",
    "controls": [
      { "hover_text@beacon.hover_text": {} }
    ]
  },
  "button_locked@beacon.image_atlas": {
    "texture": "textures/ui/beacon_button_locked"
  },
  "button_locked_hover@beacon.image_atlas": {
    "texture": "textures/ui/beacon_button_locked",
    "controls": [
      { "hover_text@beacon.hover_text": {} }
    ]
  },
  "button_checked@beacon.image_atlas": {
    "texture": "textures/ui/beacon_button_pressed"
  },
  "toggle_button@common.toggle": {
    "size": [ 22, 22 ],
    "layer": 1,
    "focus_wrap_enabled": false,
    "$toggle_name": "$button_name",
    "$unchecked_control": "beacon.button_unchecked_default",
    "$checked_control": "beacon.button_checked",
    "$unchecked_hover_control": "beacon.button_unchecked_hover",
    "$checked_hover_control": "beacon.button_checked_hover",
    "$unchecked_locked_control": "beacon.button_locked",
    "$checked_locked_control": "beacon.button_locked",
    "$unchecked_locked_hover_control": "beacon.button_locked_hover",
    "$checked_locked_hover_control": "beacon.button_locked_hover",

    "bindings": [
      {
        "binding_name": "#button_visible",
        "binding_name_override": "#visible",
        "binding_collection_name": "$button_name",
        "binding_type": "collection"
      },
      {
        "binding_collection_name": "$button_name",
        "binding_type": "collection_details"
      },
      {
        "binding_type": "collection",
        "binding_name": "#selected",
        "binding_collection_name": "$button_name",
        "binding_name_override": "#toggle_state"
      }
    ],
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.menu_ok",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.menu_ok",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_back",
        "to_button_id": "button.menu_ok",
        "mapping_type": "pressed",
        "ignored": "(not $is_ps4)"
      }
    ]
  },
  "base_button@common.button": {
    "size": [ 22, 22 ],
    "layer": 0,
    "focus_wrap_enabled": false,
    "bindings": [
      {
        "binding_name": "$button_active",
        "binding_name_override": "#visible",
        "binding_collection_name": "$button_name",
        "binding_type": "collection"
      },
      {
        "binding_collection_name": "$button_name",
        "binding_type": "collection_details"
      }
    ],
    "controls": [
      {
        "default": {
          "type": "image",
          "texture": "textures/ui/beacon_button_default"
        }
      },
      {
        "hover": {
          "type": "image",
          "texture": "textures/ui/beacon_button_hover"
        }
      },
      {
        "pressed": {
          "type": "image",
          "texture": "textures/ui/beacon_button_pressed"
        }

      }
    ]
  },
  "active_button@beacon.base_button": {
    "$button_active": "#active",
    "button_mappings": [
      {
        "from_button_id": "button.menu_select",
        "to_button_id": "button.menu_ok",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.menu_ok",
        "to_button_id": "button.menu_ok",
        "mapping_type": "pressed"
      },
      {
        "from_button_id": "button.controller_back",
        "to_button_id": "button.menu_ok",
        "mapping_type": "pressed",
        "ignored": "(not $is_ps4)"
      }
    ]
  },
  "inactive_button@beacon.base_button": {
    "$button_active": "#inactive",
    "pressed_control": "",
    "button_mappings": [],
    "controls": [
      {
        "default": {
          "type": "image",
          "texture": "textures/ui/beacon_button_locked"
        }
      },
      {
        "hover@beacon.hover_state": {
          "texture": "textures/ui/beacon_button_locked"
        }
      }
    ]
  },
  "selected_button@beacon.base_button": {
    "$button_active": "#selected",
    "button_mappings": [],
    "pressed_control": "",
    "controls": [
      {
        "default": {
          "type": "image",
          "texture": "textures/ui/beacon_button_pressed"
        }
      },
      {
        "hover": {
          "type": "image",
          "texture": "textures/ui/beacon_button_pressed"
        }
      }
    ]
  },
  "secondary_effect_base@beacon.base_image": {
    "bindings": [
      {
        "binding_name": "#extra_image_selection",
        "binding_name_override": "#visible",
        "binding_collection_name": "$effect_name",
        "binding_type": "collection"
      }
    ]
  },
  "speed_secondary@beacon.secondary_effect_base": {
    "$effect_name": "speed",
    "$image_texture": "textures/ui/speed_effect"
  },
  "haste_secondary@beacon.secondary_effect_base": {
    "$effect_name": "haste",
    "$image_texture": "textures/ui/haste_effect"
  },
  "resist_secondary@beacon.secondary_effect_base": {
    "$effect_name": "resist",
    "$image_texture": "textures/ui/resistance_effect"
  },
  "jump_secondary@beacon.secondary_effect_base": {
    "$effect_name": "jump",
    "$image_texture": "textures/ui/jump_boost_effect"
  },
  "strength_secondary@beacon.secondary_effect_base": {
    "$effect_name": "strength",
    "$image_texture": "textures/ui/strength_effect"
  },
  "image_template": {
    "type": "panel",
    "size": [ 18, 18 ],
    "layer": 3,
    "controls": [
      { "base_image@beacon.base_image": {} }
    ]
  },
  "secondary_effect_images@beacon.image_template": {
    "controls": [
      { "speed_secondary@beacon.speed_secondary": {} },
      { "haste_secondary@beacon.haste_secondary": {} },
      { "resist_secondary@beacon.resist_secondary": {} },
      { "jump_secondary@beacon.jump_secondary": {} },
      { "strength_secondary@beacon.strength_secondary": {} }
    ]
  },
  "toggle_template": {
    "type": "panel",
    "size": [ "100%", "100%" ],
    "$image_control|default": "beacon.image_template",
    "controls": [
      { "toggle_button@beacon.toggle_button": {} },
      { "$image_control@$image_control": {} }
    ]
  },
  "button_template@beacon.toggle_template": {
    "controls": [
      { "active_button@beacon.active_button": {} },
      { "inactive_button@beacon.inactive_button": {} },
      { "image_template@beacon.image_template": {} }
    ]
  },
  "panel_template": {
    "type": "panel",
    "size": [ 22, 22 ],
    "layer": 4,
    "anchor_from": "top_middle",
    "anchor_to": "top_left",
    "$button_control|default": "beacon.toggle_template",
    "bindings": [
      {
        "binding_type": "collection",
        "binding_name": "#active",
        "binding_collection_name": "$button_name",
        "binding_name_override": "#enabled"
      }
    ],
    "controls": [
      { "$button_control@$button_control": {} }
    ]
  },
  "button_panel": {
    "type": "panel",
    "controls": [
      {
        "speed_panel@beacon.panel_template": {
          "offset": [ -63, 18 ],
          "$button_name": "speed",
          "controls": [
            {
              "toggle_template@beacon.toggle_template": {
                "$image_texture": "textures/ui/speed_effect"
              }
            }
          ]
        }
      },
      {
        "haste_panel@beacon.panel_template": {
          "offset": [ -39, 18 ],
          "$button_name": "haste",
          "$image_texture": "textures/ui/haste_effect"
        }
      },
      {
        "resist_panel@beacon.panel_template": {
          "offset": [ -63, 43 ],
          "$button_name": "resist",
          "$image_texture": "textures/ui/resistance_effect"
        }
      },
      {
        "jump_panel@beacon.panel_template": {
          "offset": [ -39, 43 ],
          "$button_name": "jump",
          "$image_texture": "textures/ui/jump_boost_effect"
        }
      },
      {
        "strength_panel@beacon.panel_template": {
          "offset": [ -51, 68 ],
          "$button_name": "strength",
          "$image_texture": "textures/ui/strength_effect"
        }
      },
      {
        "regen_panel@beacon.panel_template": {
          "offset": [ 28, 43 ],
          "$button_name": "regen",
          "$image_texture": "textures/ui/regeneration_effect"
        }
      },
      {
        "extra_panel@beacon.panel_template": {
          "offset": [ 52, 43 ],
          "$button_name": "extra",
          "$image_control": "beacon.secondary_effect_images"
        }
      }
    ]
  },

  // Payment Panel //

  "payment_panel": {
    "type": "panel",
    "size": [ "100%", 22 ],
    "controls": [
      {
        "confirm_panel@beacon.panel_template": {
          "offset": [ 48, 0 ],
          "$button_name": "confirm",
          "$image_texture": "textures/ui/confirm",
          "$image_size": [ 14, 12 ],
          "$button_control": "beacon.button_template",
          "anchor_from": "center",
          "anchor_to": "left_middle"
        }
      },
      {
        "cancel_panel@beacon.panel_template": {
          "offset": [ 74, 0 ],
          "$button_name": "cancel",
          "$image_texture": "textures/ui/cancel",
          "$image_size": [ 13, 13 ],
          "$button_control": "beacon.button_template",
          "anchor_from": "center",
          "anchor_to": "left_middle"
        }
      },
      {
        "ingredient_item@common.container_item": {
          "$item_collection_name": "beacon_payment_items",
          "offset": [ 19, 0 ],
          "anchor_from": "center",
          "anchor_to": "left_middle"
        }
      },
      {
        "usable_items_panel@beacon.usable_items_panel": {
          "offset": [ 8, 0 ],
          "anchor_from": "center",
          "anchor_to": "right_middle"
        }
      }
    ]
  },

  "beacon_label@common.section_heading_label": {
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "color": "$beacon_power_title_text_color",
    "shadow": true
  },
  "beacon_inner_panel": {
    "type": "image",
    "texture": "textures/ui/effect_background",
    "size": [ 212, 97 ],
    "anchor_from": "top_middle",
    "anchor_to": "top_middle",
    "controls": [
      { "button_panel@beacon.button_panel": {} },
      { "pyramid_panel@beacon.pyramid_panel": { "layer": 1 } },
      {
        "middle_strip@beacon.image_atlas": {
          "offset": [ 0, 3 ],
          "layer": 1,
          "anchor_from": "top_middle",
          "anchor_to": "top_middle",
          "texture": "textures/ui/middle_strip",
          "size": [ 2, "100%-6px" ]
        }
      },
      {
        "primary_power_label@beacon.beacon_label": {
          "text": "tile.beacon.primary",
          "offset": [ -54, 6 ]
        }
      },
      {
        "secondary_power_label@beacon.beacon_label": {
          "text": "tile.beacon.secondary",
          "offset": [ 52, 6 ]
        }
      }
    ]
  },

  "beacon_screen@common.inventory_screen_common": {
    "$close_on_player_hurt|default": true,
    "close_on_player_hurt": "$close_on_player_hurt",
    "variables": [
      {
        "requires": "$desktop_screen",
        "$screen_content": "beacon.beacon_panel",
        "$screen_bg_content": "common.screen_background",
        "$screen_background_alpha": 0.4
      },
      {
        "requires": "$pocket_screen",
        "$screen_content": "beacon_pocket.beacon_panel",
        "$screen_bg_content": "common.screen_background",
        "$screen_background_alpha": 0.4
      }
    ]
  }
}
