-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcustom_progress_bar.json
More file actions
91 lines (88 loc) · 3.42 KB
/
Copy pathcustom_progress_bar.json
File metadata and controls
91 lines (88 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
"namespace": "hud",
"hud_title_text/title_frame/title": {
"modifications": [
{
"array_name": "bindings",
"operation":"insert_back",
"value": [
{
"binding_type": "view",
"source_property_name": "((#text - 'hp:') = #text)",
"target_property_name": "#visible"
}
]
}
]
},
"custom_progress_bar": {
"$update_string": "hp:",
"type": "image",
"texture": "textures/ui/experiencebarempty", // image background that will show when bar is not filled
"size": [70, 6],
"offset": [0, 20],
"controls": [
{
"progress": { // the image that'll fill the empty bar
"type": "image",
"size": ["100%", "100%"],
"layer": 1,
"$one": 1,
"$max_health": 20.0,
"clip_direction": "left",
"clip_pixelperfect": false,
"texture": "textures/ui/experiencebarfull",
"bindings": [
{
"binding_type": "view",
"source_control_name": "data_control",
"source_property_name": "((#preserved_text - $update_string) * $one)",
"target_property_name": "#health"
},
{
"binding_type": "view",
"source_property_name": "(($max_health - #health) / $max_health)",
"target_property_name": "#clip_ratio"
}
],
"controls": [
{
"data_control": {
"type": "panel",
"size": [0, 0],
"bindings": [
{
"binding_name": "#hud_title_text_string"
},
{
"binding_name": "#hud_title_text_string",
"binding_name_override": "#preserved_text",
"binding_condition": "visibility_changed"
},
{
"binding_type": "view",
"source_property_name": "(not (#hud_title_text_string = #preserved_text) and not ((#hud_title_text_string - $update_string) = #hud_title_text_string))",
"target_property_name": "#visible"
}
]
}
}
]
}
}
]
},
"root_panel": {
"modifications": [
{
"array_name": "controls",
"operation": "insert_back",
"value": [
{
"custom_progress_bar@hud.custom_progress_bar": {}
}
]
}
]
}
}