Skip to content

Commit

Permalink
Merge pull request CleverRaven#51438 from wapcaplet/w-widget-window-p…
Browse files Browse the repository at this point in the history
…anel

Make custom sidebar fully moddable, and support user-defined sidebars
  • Loading branch information
kevingranade authored Jan 3, 2022
2 parents acacbb1 + f97b8c9 commit 3ff3369
Show file tree
Hide file tree
Showing 12 changed files with 820 additions and 280 deletions.
135 changes: 106 additions & 29 deletions data/json/ui/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
{
"id": "stamina_graph",
"type": "widget",
"label": "Stam",
"label": "Stamina",
"var": "stamina",
"style": "graph",
"width": 10,
Expand Down Expand Up @@ -425,32 +425,42 @@
"id": "hitpoint_graphs_top_layout",
"type": "widget",
"style": "layout",
"label": "HP Top",
"arrange": "columns",
"widgets": [ "hp_left_arm_graph", "hp_head_graph", "hp_right_arm_graph" ]
},
{
"id": "hitpoint_graphs_bottom_layout",
"type": "widget",
"style": "layout",
"label": "HP Bottom",
"arrange": "columns",
"widgets": [ "hp_left_leg_graph", "hp_torso_graph", "hp_right_leg_graph" ]
},
{
"id": "hitpoints_head_torso",
"id": "hitpoints_all_graphs_layout",
"type": "widget",
"style": "layout",
"label": "Hit Points",
"arrange": "rows",
"widgets": [ "hitpoints_top_layout", "hitpoints_bottom_layout" ]
},
{
"id": "hitpoints_head_torso_layout",
"type": "widget",
"style": "layout",
"arrange": "columns",
"widgets": [ "hp_head_graph", "hp_torso_graph" ]
},
{
"id": "hitpoints_arms",
"id": "hitpoints_arms_layout",
"type": "widget",
"style": "layout",
"arrange": "columns",
"widgets": [ "hp_left_arm_graph", "hp_right_arm_graph" ]
},
{
"id": "hitpoints_legs",
"id": "hitpoints_legs_layout",
"type": "widget",
"style": "layout",
"arrange": "columns",
Expand All @@ -472,6 +482,14 @@
"arrange": "columns",
"widgets": [ "hp_left_leg_num", "hp_torso_num", "hp_right_leg_num" ]
},
{
"id": "hitpoints_all_narrow_graphs_layout",
"type": "widget",
"style": "layout",
"label": "Hit Points",
"arrange": "rows",
"widgets": [ "hitpoints_head_torso_layout", "hitpoints_arms_layout", "hitpoints_legs_layout" ]
},
{
"id": "encumbrance_top_layout",
"type": "widget",
Expand Down Expand Up @@ -504,6 +522,7 @@
"id": "stamina_fatigue_layout",
"type": "widget",
"style": "layout",
"label": "Stamina/Fatigue",
"arrange": "columns",
"widgets": [ "stamina_graph", "fatigue_graph" ]
},
Expand All @@ -521,83 +540,134 @@
"arrange": "columns",
"widgets": [ "wetness_left_leg_num", "wetness_torso_num", "wetness_right_leg_num" ]
},
{
"id": "speed_focus_layout",
"type": "widget",
"style": "layout",
"label": "Speed/Focus",
"arrange": "columns",
"widgets": [ "speed_num", "focus_num" ]
},
{
"id": "weapon_style_layout",
"type": "widget",
"style": "layout",
"label": "Weapon/Style",
"arrange": "rows",
"widgets": [ "wielding_desc", "style_desc" ]
},
{
"id": "needs_desc_layout",
"type": "widget",
"style": "layout",
"label": "Needs",
"arrange": "rows",
"widgets": [ "hunger_desc", "thirst_desc", "fatigue_desc", "pain_desc", "body_temp_desc" ]
},
{
"id": "stamina_speed_layout",
"type": "widget",
"style": "layout",
"label": "Stamina/Speed",
"arrange": "columns",
"widgets": [ "stamina_graph_classic", "speed_num" ]
},
{
"id": "focus_move_layout",
"id": "stamina_activity_weary_layout",
"type": "widget",
"style": "layout",
"label": "Stamina/Weariness",
"arrange": "rows",
"widgets": [ "stamina_graph", "activity_desc", "weariness_desc", "weary_malus_desc" ]
},
{
"id": "mood_focus_layout",
"type": "widget",
"style": "layout",
"label": "Mood/Focus",
"arrange": "columns",
"widgets": [ "focus_num", "move_num" ]
"widgets": [ "mood_desc", "focus_num" ]
},
{
"id": "stamina_fatigue_focus_layout",
"type": "widget",
"style": "layout",
"label": "Stamina/Fatigue/Focus",
"arrange": "columns",
"widgets": [ "stamina_graph_classic", "fatigue_graph", "focus_num" ]
},
{
"id": "speed_move_layout",
"id": "move_speed_layout",
"type": "widget",
"style": "layout",
"label": "Move/Speed",
"arrange": "columns",
"widgets": [ "speed_num", "move_num" ]
"widgets": [ "move_num", "speed_num" ]
},
{
"id": "sound_speed_move_layout",
"id": "safe_sound_layout",
"type": "widget",
"style": "layout",
"label": "Safe/Sound",
"arrange": "columns",
"widgets": [ "sound_num", "speed_num", "move_num" ]
"widgets": [ "safe_mode_desc", "sound_num" ]
},
{
"id": "sound_fatigue_focus_layout",
"type": "widget",
"style": "layout",
"label": "Sound/Fatigue/Focus",
"arrange": "columns",
"widgets": [ "sound_num", "fatigue_graph", "focus_num" ]
},
{
"id": "stamina_speed_move_layout",
"type": "widget",
"style": "layout",
"label": "Stamina/Speed/Move",
"arrange": "columns",
"widgets": [ "stamina_graph_classic", "speed_num", "move_num" ]
},
{
"id": "sound_focus_layout",
"type": "widget",
"style": "layout",
"label": "Sound/Focus",
"arrange": "columns",
"widgets": [ "sound_num", "focus_num" ]
},
{
"id": "stats_layout",
"type": "widget",
"style": "layout",
"label": "Stats",
"arrange": "columns",
"widgets": [ "str_num", "dex_num", "int_num", "per_num" ]
},
{
"id": "str_dex_layout",
"type": "widget",
"style": "layout",
"label": "Str/Dex",
"arrange": "columns",
"widgets": [ "str_num", "dex_num" ]
},
{
"id": "int_per_layout",
"type": "widget",
"style": "layout",
"label": "Int/Per",
"arrange": "columns",
"widgets": [ "int_num", "per_num" ]
},
{
"id": "stats_narrow_layout",
"type": "widget",
"style": "layout",
"label": "Stats",
"arrange": "rows",
"widgets": [ "mood_focus_layout", "move_speed_layout", "str_dex_layout", "int_per_layout" ]
},
{
"id": "activity_desc",
"type": "widget",
Expand All @@ -609,7 +679,7 @@
{
"id": "body_temp_desc",
"type": "widget",
"label": "Body Heat",
"label": "Heat",
"style": "text",
"var": "body_temp_text",
"//": "Uses display::temp_text_color"
Expand Down Expand Up @@ -740,7 +810,7 @@
{
"id": "power_desc",
"type": "widget",
"label": "Power",
"label": "Bionic Power",
"style": "text",
"var": "power_text"
},
Expand All @@ -761,36 +831,43 @@
{
"id": "safe_mode_desc",
"type": "widget",
"label": "Safe Mode",
"label": "Safe",
"style": "text",
"var": "safe_mode_text"
},
{
"id": "root_layout_wide",
"id": "light_moon_wind_temp_layout",
"type": "widget",
"label": "Environment",
"style": "layout",
"arrange": "rows",
"widgets": [
"hitpoint_graphs_top_layout",
"hitpoint_graphs_bottom_layout",
"sound_fatigue_focus_layout",
"stamina_speed_move_layout",
"stats_layout"
]
"widgets": [ "lighting_desc", "moon_phase_desc", "wind_desc", "env_temp_desc" ]
},
{
"id": "root_layout_narrow",
"id": "place_date_time_layout",
"type": "widget",
"label": "Place/Date/Time",
"style": "layout",
"arrange": "rows",
"widgets": [ "place_desc", "date_desc", "time_desc" ]
},
{
"id": "custom_sidebar",
"type": "widget",
"style": "sidebar",
"label": "custom",
"width": 36,
"widgets": [
"hitpoints_head_torso",
"hitpoints_arms",
"hitpoints_legs",
"stamina_speed_layout",
"focus_move_layout",
"str_dex_layout",
"int_per_layout"
"hitpoints_all_narrow_graphs_layout",
"stats_narrow_layout",
"stamina_activity_weary_layout",
"needs_desc_layout",
"safe_sound_layout",
"power_desc",
"rad_badge_desc",
"weapon_style_layout",
"place_date_time_layout",
"light_moon_wind_temp_layout"
]
}
]
22 changes: 22 additions & 0 deletions data/mods/TEST_DATA/widgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,30 @@
"id": "test_stat_panel",
"type": "widget",
"style": "layout",
"arrange": "columns",
"widgets": [ "test_str_num", "test_dex_num", "test_int_num", "test_per_num" ]
},
{
"id": "test_2_column_layout",
"type": "widget",
"style": "layout",
"arrange": "columns",
"widgets": [ "test_move_num", "test_speed_num" ]
},
{
"id": "test_3_column_layout",
"type": "widget",
"style": "layout",
"arrange": "columns",
"widgets": [ "test_move_num", "test_speed_num", "test_focus_num" ]
},
{
"id": "test_4_column_layout",
"type": "widget",
"style": "layout",
"arrange": "columns",
"widgets": [ "test_move_num", "test_speed_num", "test_focus_num", "test_mana_num" ]
},
{
"id": "test_text_widget",
"type": "widget",
Expand Down
Loading

0 comments on commit 3ff3369

Please sign in to comment.