{
  "namespace": "server_form",
  "long_form@common_dialogs.main_panel_no_buttons": {
    "size": [260, 210]
  },

  "custom_form@common_dialogs.main_panel_no_buttons": {
    "size": [260, 210]
  },

  "third_party_server_screen@common.base_screen_custom": {
    "$screen_content": "server_form.ng_main_screen_content",
    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      }
    ]
  },

  "ng_main_screen_content": {
    "type": "panel",
    "size": ["100%", "100%"],
    "controls": [
      {
        "server_form_factory": {
          "type": "factory",
          "control_ids": {
            "long_form": "@server_form.ng_long_form",
            "custom_form": "@server_form.custom_form"
          }
        }
      }
    ]
  },

  "ng_long_form": {
    "type": "panel",
    "$flag_pokemon": "§p§o§k§e",
    "$flag_pokedex": "§d§e§k§x",
    "$flag_pokedex_details": "§d§e§d§e§t§k",
    "$flag_battle": "§b§a§t§l§e",
    "$flag_chestGui": "§c§h§e§s§t",
    "$flag_searchUi": "§s§e§a§r§c",
    "$flag_rotom_phone_first": "§1§r",
    "$flag_rotom_phone_second": "§2§r",
    "$flag_rotom_phone_third": "§3§r",
    "size": ["100%", "100%"],

    "controls": [
      {
        "long_form@long_form": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(((#title_text - $flag_pokemon - $flag_pokedex - $flag_pokedex_details - $flag_battle - $flag_chestGui - $flag_searchUi - $flag_rotom_phone_first - $flag_rotom_phone_second - $flag_rotom_phone_third ) = #title_text) )",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(((#title_text - $flag_pokemon - $flag_pokedex - $flag_pokedex_details - $flag_battle - $flag_chestGui - $flag_searchUi - $flag_rotom_phone_first - $flag_rotom_phone_second - $flag_rotom_phone_third ) = #title_text) )",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "pokemon_battle@battle.main": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_battle) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_battle) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "pokemon@pokemon.main_panel": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_pokemon) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_pokemon) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "pokedex@pokedex.main_grid": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_pokedex) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_pokedex) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "pokedex_details@pokedex.pokemon_details": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_pokedex_details) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_pokedex_details) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "chest_ui@chest_ui.chest_panel": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_chestGui) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_chestGui) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "search_ui@search_server_form.long_form": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_searchUi) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_searchUi) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "rotom_phone_first@rotom_phone_first.blackbarbar_first": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_rotom_phone_first) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_rotom_phone_first) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "rotom_phone_second@rotom_phone_second.blackbarbar_second": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_rotom_phone_second) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_rotom_phone_first) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      },
      {
        "rotom_phone_third@rotom_phone_third.blackbarbar_third": {
          "enabled": false,
          "visible": false,
          "bindings": [
            {
              "binding_type": "global",
              "binding_condition": "none",
              "binding_name": "#title_text",
              "binding_name_override": "#title_text"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_rotom_phone_third) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#visible"
            },
            {
              "source_property_name": "(not ((#title_text - $flag_rotom_phone_first) = #title_text))",
              "binding_type": "view",
              "target_property_name": "#enabled"
            }
          ]
        }
      }
    ]
  },

  "dynamic_button": {
    "type": "stack_panel",
    "size": ["100%", 32],
    "orientation": "horizontal",
    "controls": [
      {
        "panel_name": {
          "type": "panel",
          "size": [34, "100%c"],
          "bindings": [
            {
              "binding_type": "view",
              "source_control_name": "image",
              "resolve_sibling_scope": true,
              "source_property_name": "(not (#texture = ''))",
              "target_property_name": "#visible"
            }
          ],

          "controls": [
            {
              "image": {
                "type": "image",
                "layer": 2,
                "size": [32, 32],
                "offset": [-2, 0],
                "bindings": [
                  {
                    "binding_name": "#form_button_texture",
                    "binding_name_override": "#texture",
                    "binding_type": "collection",
                    "binding_collection_name": "form_buttons"
                  },
                  {
                    "binding_name": "#form_button_texture_file_system",
                    "binding_name_override": "#texture_file_system",
                    "binding_type": "collection",
                    "binding_collection_name": "form_buttons"
                  },
                  {
                    "binding_type": "view",
                    "source_property_name": "(not ((#texture = '') or (#texture = 'loading')))",
                    "target_property_name": "#visible"
                  }
                ]
              }
            },
            {
              "progress@progress.progress_loading_bars": {
                "size": [30, 4],
                "offset": [-2, 16],
                "bindings": [
                  {
                    "binding_type": "view",
                    "source_control_name": "image",
                    "resolve_sibling_scope": true,
                    "source_property_name": "(#texture = 'loading')",
                    "target_property_name": "#visible"
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "form_button@common_buttons.light_text_button": {
          "$pressed_button_name": "button.form_button_click",
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "size": ["fill", 32],
          "$button_text": "#form_button_text",
          "$button_text_binding_type": "collection",
          "$button_text_grid_collection_name": "form_buttons",
          "$button_text_max_size": ["100%", 20],
          "bindings": [
            {
              "binding_type": "collection_details",
              "binding_collection_name": "form_buttons"
            },
            {
              "binding_type": "collection",
              "binding_collection_name": "form_buttons",
              "binding_condition": "none",
              "binding_name": "#form_button_text",
              "binding_name_override": "#form_button_text"
            },
            {
              "binding_type": "view",
              "source_property_name": "(not((%.1s * #form_button_text) = ' '))",
              "target_property_name": "#enabled"
            }
          ]
        }
      }
    ]
  }
}
