Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Expand and enhance moddable sidebar #47620

Closed
wants to merge 19 commits into from

Conversation

wapcaplet
Copy link
Contributor

Summary

Feature "Expand and enhance moddable sidebar"

Purpose of change

This PR will be aimed toward converting and implementing most (if not all) of the remaining sidebar elements as data-driven widgets.

Describe the solution

To do

Describe alternatives you've considered

Making it up as I go along

Testing

In progress

Additional context

Depends on #44683 and is a continuation of it

@wapcaplet wapcaplet marked this pull request as draft February 20, 2021 03:54
@ZhilkinSerg ZhilkinSerg added Info / User Interface Game - player communication, menus, etc. 0.F Feature Freeze <Enhancement / Feature> New features, or enhancements on existing labels Feb 20, 2021
widget_var for linking avatar attributes to widgets:
- focus, move, pain, speed, stamina, stats, HP per bodypart and more

widget class to render avatar variables in UI with labels and layout:
- uses generic_factory to load JSON from widget types
- JSON: id, label, style, var, colors, symbols, width, fill, etc.
- show() to render widget value from avatar instance
- layout() to arrange widgets and do max width padding/alignment
- get_var_value() to return avatar's current "var" value
- color_value_string() to render value with colors
- supporting: value_color(), value_string(), graph(), num()
Build on the data-driven sidebar `widget` class, defining a collection
of numeric and graph display elements, including familiar as well as new
informational displays:

- HP bar graphs for each body part, in familiar `|||||` form
- Classic and extended (10-character) stamina graph
- Numeric indicators for sound, focus, pain, moves, str, dex, int, per
- Encumbrance bar graphs for each body part
- Warmth numbers for each body part
- Hunger, thirst, and pain phrases
Add a "Data Drive Sidebar Demo" section that can be toggled on for each
sidebar layout (classic/labels and narrow/compact), loading from the
"root_layout" widget.
widget_var for linking avatar attributes to widgets:
- focus, move, pain, speed, stamina, stats, HP per bodypart and more

widget class to render avatar variables in UI with labels and layout:
- uses generic_factory to load JSON from widget types
- JSON: id, label, style, var, colors, symbols, width, fill, etc.
- show() to render widget value from avatar instance
- layout() to arrange widgets and do max width padding/alignment
- get_var_value() to return avatar's current "var" value
- color_value_string() to render value with colors
- supporting: value_color(), value_string(), graph(), num()

src/widget.cpp Use get_focus
pain, hunger, thirst, and fatigue descriptions now available to modular
widgets
Gives cleaner-looking results, especially when value is empty
@wapcaplet
Copy link
Contributor Author

Closing. This branch has grown to include a bunch of random stuff (and my local one has even more). I am in the process of rebasing and will submit some smaller, cleaner PRs to follow up.

@wapcaplet wapcaplet closed this Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants