Skip to content

Commit

Permalink
Merge pull request #44683 from wapcaplet/w-sidebar-json
Browse files Browse the repository at this point in the history
Add data-driven moddable sidebar widgets
  • Loading branch information
ZhilkinSerg authored Aug 11, 2021
2 parents 7fec2ef + c12e188 commit 998d767
Show file tree
Hide file tree
Showing 11 changed files with 1,854 additions and 1 deletion.
457 changes: 457 additions & 0 deletions data/json/ui/sidebar.json

Large diffs are not rendered by default.

179 changes: 179 additions & 0 deletions data/mods/TEST_DATA/widgets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
[
{
"id": "test_bucket_graph",
"type": "widget",
"style": "graph",
"label": "BUCKET",
"width": 4,
"symbols": "0123",
"fill": "bucket"
},
{
"id": "test_pool_graph",
"type": "widget",
"style": "graph",
"label": "POOL",
"width": 4,
"symbols": "0123",
"fill": "pool",
"var_max": 240
},
{
"id": "test_number_widget",
"type": "widget",
"label": "NUM",
"style": "number"
},
{
"id": "test_color_number_widget",
"type": "widget",
"label": "COLORNUM",
"style": "number",
"//": "var_min to var_max maps exactly 1:1 with color index",
"var_min": 0,
"var_max": 2,
"colors": [ "c_red", "c_yellow", "c_green" ]
},
{
"id": "test_color_graph_widget",
"type": "widget",
"label": "COLORGRAPH",
"style": "graph",
"width": 5,
"symbols": "-=#",
"var_min": 0,
"var_max": 10,
"colors": [ "c_red", "c_yellow", "c_light_green", "c_green" ]
},
{
"id": "test_color_graph_10k_widget",
"type": "widget",
"label": "COLORGRAPH",
"style": "graph",
"width": 10,
"symbols": "-=#",
"fill": "pool",
"var_min": 0,
"var_max": 10000,
"colors": [ "c_red", "c_light_red", "c_yellow", "c_light_green", "c_green" ]
},
{
"id": "test_focus_num",
"type": "widget",
"label": "FOCUS",
"var": "focus",
"style": "number"
},
{
"id": "test_mana_num",
"type": "widget",
"label": "MANA",
"var": "mana",
"style": "number"
},
{
"id": "test_speed_num",
"type": "widget",
"label": "SPEED",
"var": "speed",
"style": "number"
},
{
"id": "test_stamina_num",
"type": "widget",
"label": "STAMINA",
"var": "stamina",
"style": "number"
},
{
"id": "test_stamina_graph",
"type": "widget",
"label": "STAMINA",
"var": "stamina",
"style": "graph",
"fill": "pool",
"width": 10,
"symbols": "-=#",
"var_max": 10000
},
{
"id": "test_sound_num",
"type": "widget",
"label": "SOUND",
"var": "sound",
"style": "number"
},
{
"id": "test_move_num",
"type": "widget",
"label": "MOVE",
"var": "move",
"style": "number"
},
{
"id": "test_str_num",
"type": "widget",
"label": "STR",
"var": "stat_str",
"style": "number"
},
{
"id": "test_dex_num",
"type": "widget",
"label": "DEX",
"var": "stat_dex",
"style": "number"
},
{
"id": "test_int_num",
"type": "widget",
"label": "INT",
"var": "stat_int",
"style": "number"
},
{
"id": "test_per_num",
"type": "widget",
"label": "PER",
"var": "stat_per",
"style": "number"
},
{
"id": "test_hp_head_graph",
"type": "widget",
"label": "HEAD",
"var": "bp_hp",
"bodypart": "head",
"style": "graph",
"width": 5,
"symbols": ",\\|",
"fill": "bucket"
},
{
"id": "test_hp_head_num",
"type": "widget",
"label": "HEAD",
"var": "bp_hp",
"bodypart": "head",
"style": "number"
},
{
"id": "test_stat_panel",
"type": "widget",
"style": "layout",
"widgets": [ "test_str_num", "test_dex_num", "test_int_num", "test_per_num" ]
},
{
"id": "test_phrase_widget",
"type": "widget",
"label": "PHRASE",
"style": "phrase",
"strings": [ "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten" ]
},
{
"id": "test_layout_list",
"type": "widget",
"style": "layout",
"widgets": [ "test_phrase_widget", "test_pool_graph", "test_number_widget" ]
}
]
Loading

0 comments on commit 998d767

Please sign in to comment.