..

server_form.json

1{
2    "namespace": "server_form",
3    "$schema": "https://kalmemarq.github.io/Bugrock-JSON-UI-Schemas/ui.schema.json",
4
5    "long_form": {
6        "type": "panel",
7        "size": ["100%", "100%"],
8        "controls": [
9            {
10                "default_long_form@common_dialogs.main_panel_no_buttons": {
11                    "$title_panel": "common_dialogs.standard_title_label",
12                    "$title_size": ["100% - 14px", 10],
13                    "size": [225, 200],
14                    "$text_name": "#title_text",
15                    "$title_text_binding_type": "none",
16                    "$child_control": "server_form.long_form_panel",
17                    "layer": 2,
18                    "bindings": [
19                        {
20                            "binding_name": "#title_text"
21                        },
22                        {
23                            "binding_type": "view",
24                            "source_property_name": "((#title_text - 'Custom Form') = #title_text)",
25                            "target_property_name": "#visible"
26                        }
27                    ]
28                }
29            },
30            {
31                "cutsom_long_form": {
32                    "type": "panel",
33                    "size": [322.5, 190],
34                    "layer": 2,
35                    "controls": [
36                        {
37                            "indent_panel": {
38                                "type": "panel",
39                                "size": ["100% - 16px", "100%"],
40                                "controls": [
41                                    {
42                                        "my_form_label@server_form.my_form_label": {}
43                                    },
44                                    {
45                                        "my_close_button@server_form.my_close_button": {
46                                            "offset": [8, -8],
47                                            "layer": 64
48                                        }
49                                    },
50                                    {
51                                        "my_form_background@server_form.my_form_background": {}
52                                    },
53
54                                    {
55                                        "content_stack": {
56                                            "type": "stack_panel",
57                                            "size": ["100%", "100%"],
58                                            "orientation": "vertical",
59                                            "controls": [
60                                                {
61                                                    "padding": {
62                                                        "type": "panel",
63                                                        "size": ["100%", 8]
64                                                    }
65                                                },
66                                                {
67                                                    "my_form_body@server_form.my_form_body": {}
68                                                },
69                                                {
70                                                    "button_panel@server_form.my_super_custom_panel_main": {}
71                                                }
72                                            ]
73                                        }
74                                    }
75                                ]
76                            }
77                        }
78                    ],
79                    "bindings": [
80                        {
81                            "binding_name": "#title_text"
82                        },
83                        {
84                            "binding_type": "view",
85                            "source_property_name": "(#title_text = 'Custom Form')",
86                            "target_property_name": "#visible"
87                        }
88                    ]
89                }
90            }
91        ]
92    },
93
94    "my_close_button": {
95        "type": "button",
96        "default_control": "default",
97        "hover_control": "hover",
98        "$default_texture|default": "textures/custom_ui/close_button",
99        "$hover_texture|default": "textures/custom_ui/close_button_hover",
100        "$alpha|default": 1,
101        "$size|default": [16, 16],
102        "anchor_from": "top_right",
103        "anchor_to": "top_right",
104        "size": [14, 14],
105        "sound_name": "random.click",
106        "controls": [
107            {
108                "bg@server_form.my_form_background": {
109                    "alpha": 1
110                }
111            },
112            {
113                "default": {
114                    "type": "image",
115                    "size": "$size",
116                    "texture": "$default_texture",
117                    "alpha": "$alpha"
118                }
119            },
120            {
121                "hover": {
122                    "type": "image",
123                    "size": "$size",
124                    "texture": "$hover_texture",
125                    "alpha": "$alpha"
126                }
127            }
128        ],
129        "button_mappings": [
130            {
131                "from_button_id": "button.menu_select",
132                "to_button_id": "button.menu_exit",
133                "mapping_type": "pressed"
134            },
135            {
136                "from_button_id": "button.menu_ok",
137                "to_button_id": "button.menu_exit",
138                "mapping_type": "focused"
139            }
140        ]
141    },
142
143    "my_form_body": {
144        "type": "panel",
145        "anchor_from": "top_middle",
146        "size": ["100%", 28],
147        "layer": 8,
148        "controls": [
149            {
150                "form_body_text": {
151                    "type": "label",
152                    "text": "#form_text",
153                    "layer": 8,
154                    "bindings": [
155                        {
156                            "binding_name": "#form_text"
157                        }
158                    ]
159                }
160            },
161            {
162                "my_form_background@server_form.my_form_background": {
163                    "size": ["100% - 22px", "100%"]
164                }
165            }
166        ]
167    },
168
169    "my_form_label": {
170        "type": "label",
171        "font_type": "MinecraftTen",
172        "font_size": "large",
173        "anchor_from": "top_left",
174        "anchor_to": "top_left",
175        "text": "#title_text",
176        "layer": 8,
177        "offset": [9, -16],
178        "bindings": [
179            {
180                "binding_name": "#title_text"
181            }
182        ]
183    },
184
185    "my_form_background": {
186        "type": "image",
187        "size": ["100% + 5px", "100% + 5px"],
188        "texture": "textures/custom_ui/custom_bg",
189        "alpha": 0.9
190    },
191
192    "my_super_custom_panel_main": {
193        "type": "stack_panel",
194        "size": ["100%", "100%"],
195        "orientation": "horizontal",
196        "anchor_from": "center",
197        "anchor_to": "center",
198        "collection_name": "form_buttons",
199
200        "controls": [
201            {
202                "offset_button@server_form.custom_button": {
203                    "$icon_size": [69, 69],
204                    "$button_size": [133, 133],
205                    "$padding": [153, 153],
206                    "collection_index": 0
207                }
208            },
209            {
210                "right_side_stack": {
211                    "type": "stack_panel",
212                    "size": ["100%", "100%"],
213                    "orientation": "vertical",
214                    "anchor_from": "center",
215                    "anchor_to": "center",
216                    "collection_name": "form_buttons",
217                    "controls": [
218                        {
219                            "offset_button@server_form.custom_button": {
220                                "$button_size": [138, 55],
221                                "$padding": [148, 76.5],
222                                "collection_index": 1
223                            }
224                        },
225                        {
226                            "bottom_right_stack": {
227                                "type": "stack_panel",
228                                "size": ["100%", "100%"],
229                                "orientation": "horizontal",
230                                "anchor_from": "center",
231                                "anchor_to": "center",
232                                "collection_name": "form_buttons",
233                                "controls": [
234                                    {
235                                        "offset_button@server_form.custom_button": {
236                                            "$button_size": [64, 64],
237                                            "$padding": [74, 69],
238                                            "collection_index": 2
239                                        }
240                                    },
241                                    {
242                                        "offset_button@server_form.custom_button": {
243                                            "$button_size": [64, 64],
244                                            "$padding": [74, 69],
245                                            "collection_index": 3
246                                        }
247                                    }
248                                ]
249                            }
250                        }
251                    ]
252                }
253            }
254        ]
255    },
256
257    "custom_button": {
258        "$padding|default": [80, 80],
259        "$button_size|default": [64, 64],
260        "$icon_size|default": [32, 32],
261
262        "$default_button_texture": "textures/custom_ui/custom_bg",
263        "$hover_button_texture": "textures/custom_ui/custom_bg_hover",
264        "$pressed_button_texture": "textures/custom_ui/custom_bg_hover",
265
266        "type": "panel",
267        "size": "$padding",
268        "controls": [
269            {
270                "main_ui": {
271                    "type": "panel",
272                    "size": "$button_size",
273                    "controls": [
274                        {
275                            "panel_name": {
276                                "type": "panel",
277                                "size": "$button_size",
278                                "bindings": [
279                                    {
280                                        "binding_type": "view",
281                                        "source_control_name": "image",
282                                        "resolve_sibling_scope": true,
283                                        "source_property_name": "(not (#texture = ''))",
284                                        "target_property_name": "#visible"
285                                    }
286                                ],
287
288                                "controls": [
289                                    {
290                                        "image": {
291                                            "type": "image",
292                                            "layer": 200,
293                                            "size": "$icon_size",
294                                            "offset": [0, -5],
295                                            "bindings": [
296                                                {
297                                                    "binding_name": "#form_button_texture",
298                                                    "binding_name_override": "#texture",
299                                                    "binding_type": "collection",
300                                                    "binding_collection_name": "form_buttons"
301                                                },
302                                                {
303                                                    "binding_name": "#form_button_texture_file_system",
304                                                    "binding_name_override": "#texture_file_system",
305                                                    "binding_type": "collection",
306                                                    "binding_collection_name": "form_buttons"
307                                                },
308                                                {
309                                                    "binding_type": "view",
310                                                    "source_property_name": "(not ((#texture = '') or (#texture = 'loading')))",
311                                                    "target_property_name": "#visible"
312                                                }
313                                            ]
314                                        }
315                                    },
316                                    {
317                                        "text": {
318                                            "type": "label",
319                                            "text": "#form_button_text",
320                                            "layer": 32,
321                                            "color": [1, 1, 1],
322                                            "offset": [0, -8],
323                                            "anchor_from": "bottom_middle",
324                                            "bindings": [
325                                                {
326                                                    "binding_name": "#form_button_text",
327                                                    "binding_type": "collection",
328                                                    "binding_collection_name": "form_buttons"
329                                                }
330                                            ]
331                                        }
332                                    }
333                                ]
334                            }
335                        },
336                        {
337                            "form_button@common_buttons.light_text_button": {
338                                "$pressed_button_name": "button.form_button_click",
339                                "anchor_from": "top_left",
340                                "anchor_to": "top_left",
341                                "size": "$button_size",
342                                "$button_text": "#null",
343                                "$button_text_binding_type": "collection",
344                                "$button_text_grid_collection_name": "form_buttons",
345                                "$button_text_max_size": ["100%", 20],
346                                "bindings": [
347                                    {
348                                        "binding_type": "collection_details",
349                                        "binding_collection_name": "form_buttons"
350                                    }
351                                ]
352                            }
353                        }
354                    ]
355                }
356            }
357        ]
358    }
359}
360

Not Affiliated With Mojang Or Microsoft