//This JSON was modified by LukasPAH (@LukasPAH) and AgentMindStorm (@agentms_). Please do not use this document without permission.
{
  "arrow_right_image": {
    "texture": "$trade_right_arrow_texture",
	"size": "$trade_right_arrow_size",
	"offset": "$trade_center_offset",
	"$trade_center_offset|default": [ 0, 0 ],
    "$trade_center_unchanged|default": false,
	"$trade_right_arrow_size|default": [ 16, 13 ],
    "$trade_right_arrow_texture|default": "textures/ui/arrow_dark_right_stretch",
    "variables": [
      {
        "requires": "($pocket_screen and not $trade_center_unchanged)",
		"$trade_center_offset": [ 6, 0 ],
		"$trade_right_arrow_size": [ 24, 19 ],
        "$trade_right_arrow_texture": "textures/ui/arrow_dark_right"
      }
    ]
  },
  "cross_out_image": {
	"size": "$trade_cross_out_size",
	"offset": "$trade_center_offset",
	"$trade_center_offset|default": [ 0, 0 ],
    "$trade_center_unchanged|default": false,
	"$trade_cross_out_size|default": [ 15, 15 ],
    "variables": [
      {
        "requires": "($pocket_screen and not $trade_center_unchanged)",
		"$trade_center_offset": [ 10, 0 ],
		"$trade_cross_out_size": [ 22, 22 ]
      }
    ]
  },
  "lock_image": {
	"size": "$trade_lock_size",
	"offset": "$trade_center_offset",
	"$trade_center_offset|default": [ 0, 0 ],
    "$trade_center_unchanged|default": false,
	"$trade_lock_size|default": [ 8, 8 ],
    "variables": [
      {
        "requires": "($pocket_screen and not $trade_center_unchanged)",
		"$trade_center_offset": [ 6, 0 ],
		"$trade_lock_size": [ 16, 16 ]
      }
    ]
  },
  "item_slots_stack_panel": {
    "$trade_center_unchanged": true
  },
  "specific_trade_icon_renderer": {
    "type": "custom",
    "renderer": "inventory_item_renderer",
    "size": "$icon_size",
    "variables": [
      {
        "requires": "$desktop_screen",
        "$icon_size": [ 15.98, 15.98 ]
      },
      {
        "requires": "$pocket_screen",
        "$icon_size": [ 23.97, 23.97 ]
      }
    ],
    "layer": 1,
    "bindings": [
      {
        "binding_type": "collection_details"
      },
      {
        "binding_name": "#item_id_aux"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not (not (#item_id_aux < 6684672) and not (#item_id_aux > 6717439)))",
        "target_property_name": "#visible"
      },
      {
        "binding_name": "#item_custom_color"
      },
      {
        "binding_name": "#item_pickup_time"
      },
      {
        "binding_name": "#banner_patterns"
      },
      {
        "binding_name": "#banner_colors"
      },
      {
        "binding_name": "#banner_type"
      }
    ]
  },
  "glass_pane_icon": {
    "type": "image",
    "texture": "textures/blocks/glass",
    "size": "$glass_icon_size",
    "variables": [
      {
        "requires": "$desktop_screen",
        "$glass_icon_size": [ 16, 16 ]
      },
      {
        "requires": "$pocket_screen",
        "$glass_icon_size": [ 24, 24 ]
      }
    ],
    "layer": 1,
    "bindings": [
      {
        "binding_type": "collection_details"
      },
      {
        "binding_name": "#item_id_aux"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not (#item_id_aux < 6684672) and not (#item_id_aux > 6717439))",
        "target_property_name": "#visible"
      }
    ]
  },
  "hover_button": {
    "bindings": [
      {
        "binding_type": "collection_details"
      }
    ]
  },
  "trade_toggle_content@common.empty_button_element": { //This element, which replaces the default trade icons, is given no size and an offset outside the button to keep it from interfering with pressing the button. Even with size set to 0, controllers that target the center of the button still get stuck, so the offset is also necessary.
    "size": [ 0, 0 ],
    "offset": [ "-100% - 1px", 0 ] //This offset just barely places the button outside the trade toggle holder panel.
  },
  "trade_toggle": {
    "$button_content": "trade2.trade_toggle_content"
  },
  "trade_icons@trade2.trade_toggle": {
    "layer": 11,
    "controls": [
      {
        "trade_content@trade2.toggle_content": {
          "bindings": [
            {
              "binding_type": "$toggle_tab_focus_binding_type",
              "binding_name": "$toggle_tab_focus_binding_name",
              "binding_name_override": "#default_focus_precedence"
            },
            {
              "binding_type": "$toggle_on_hover_binding_type",
              "binding_name": "$toggle_on_hover_binding_name",
              "binding_name_override": "#toggle_on_hover"
            }
          ]
        }
      }
    ]
  },
  "trade_toggle_holder": {
    "type": "panel",
    "size": [ "100%", "50%c - 1px" ],
    "controls": [
      {
        "trade_toggle@trade2.trade_toggle": {
          "anchor_from": "top_middle",
          "anchor_to": "top_middle"
        }
      },
      {
        "trade_icons@trade2.trade_icons": {
          "anchor_from": "top_middle",
          "anchor_to": "top_middle"
        }
      }
    ]
  },
  "single_item_grid": {
    "controls": [
      {
        "item_with_count": {
          "type": "panel",
          "size": [ "100%cm", "100%cm" ],
          "$stack_count_required": true,
          "controls": [
            {
              "item_renderer": {
                "type": "panel",
                "size": "$item_renderer_size",
                "$item_renderer_size|default": [ 16, 16 ],
                "layer": 1,
                "controls": [
                  {
                    "specific_trade_icon_renderer@trade2.specific_trade_icon_renderer": {}
                  },
                  {
                    "glass_pane_icon@trade2.glass_pane_icon": {}
                  },
                  {
                    "stack_count_label@trade2.stack_count_label": {
                      "layer": 5,
                      "text": "#trade_item_count",
                      "anchor_from": "bottom_right",
                      "anchor_to": "bottom_right",
                      "offset": [ 1, 1 ],
                      "bindings": [
                        {
                          "binding_type": "collection_details"
                        },
                        {
                          "binding_name": "#trade_item_count"
                        },
                        {
                          "binding_name": "(not #trade_price_different)",
                          "binding_name_override": "#visible"
                        }
                      ]
                    }
                  },
                  {
                    "changed_item_count_label@trade2.changed_item_count_label": {
                      "anchor_from": "bottom_middle",
                      "anchor_to": "bottom_middle",
                      "offset": [ 4, 1 ],
                      "bindings": [
                        {
                          "binding_type": "collection_details"
                        },
                        {
                          "binding_name": "#trade_item_count"
                        },
                        {
                          "binding_name": "#trade_price_different",
                          "binding_name_override": "#visible"
                        }
                      ]
                    }
                  },
                  {
                    "hover_button@trade2.hover_button": {
                      "layer": 6
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}