{
  "namespace": "bed",

  // Screen //

  "in_bed_screen@common.base_screen": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.wake_up_button",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_exit",
        "to_button_id": "button.wake_up_button",
        "mapping_type": "global"
      }
    ],

    "$screen_content": "bed.in_bed_screen_content",
    "$screen_bg_content": "bed.background"
  },

  "in_bed_screen_content": {
    "type": "panel",
    "controls": [
      {
        "wake_up_button_panel": {
          "type": "stack_panel",
          "orientation": "horizontal",
          "size": [ 128, "15%" ],
          "anchor_from": "bottom_middle",
          "anchor_to": "bottom_middle",
          "offset": [ 0, "-15.0%" ],
          "controls": [
            {
              "wake_up_button@common_buttons.light_text_form_fitting_button": {
                "layer": 1,
                // Size is defaulted to the size of the text fitting on one line
                // Must specify a max size for layout to solve
                "$button_text_max_size": [ 120, 10 ],
                "$button_text": "multiplayer.stopSleeping",
                "button_mappings": [
                  {
                    "from_button_id": "button.menu_select",
                    "to_button_id": "button.wake_up_button",
                    "mapping_type": "pressed"
                  },
                  {
                    "from_button_id": "button.menu_ok",
                    "to_button_id": "button.wake_up_button",
                    "mapping_type": "pressed"
                  }
                ]
              }
            },
            {
              "spacer": {
                "type": "panel",
                "size": [ 20, 0 ]
              }
            },
            {
              "chat_button@common_buttons.light_text_form_fitting_button": {
                "layer": 1,
                "$button_text_max_size": [ 120, 10 ],
                "$button_text": "multiplayer.inBedOpenChat",
                "button_mappings": [
                  {
                    "from_button_id": "button.menu_select",
                    "to_button_id": "button.chat",
                    "mapping_type": "pressed"
                  },
                  {
                    "from_button_id": "button.menu_ok",
                    "to_button_id": "button.chat",
                    "mapping_type": "pressed"
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "select_button@death.a_button_panel": {
          "layer": 1,
          "offset": [ 0, "-5%" ]
        }
      }
    ]
  },

  "background": {
    "type": "image",
    "size": [ "100%", "100%" ],
    "texture": "textures/ui/White",
    "color": [ 0.0, 0.0, 0.0 ],
    "alpha": 0.5
  }
}