-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Magiclysm] Extend custom sidebar to include mana, max mana, and mana graph #54314
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wapcaplet
added
Info / User Interface
Game - player communication, menus, etc.
Mods: Magiclysm
Anything to do with the Magiclysm mod
labels
Jan 12, 2022
wapcaplet
commented
Jan 12, 2022
wapcaplet
commented
Jan 12, 2022
wapcaplet
commented
Jan 12, 2022
github-actions
bot
added
the
json-styled
JSON lint passed, label assigned by github actions
label
Jan 12, 2022
This allows "extend" from generic_factory to work out of the box.
wapcaplet
force-pushed
the
w-magic-widget
branch
from
January 12, 2022 13:42
531e863
to
629f889
Compare
github-actions
bot
added
the
astyled
astyled PR, label is assigned by github actions
label
Jan 12, 2022
wapcaplet
added
[C++]
Changes (can be) made in C++. Previously named `Code`
[JSON]
Changes (can be) made in JSON
labels
Jan 12, 2022
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jan 12, 2022
Defines widgets and sidebar layouts to add these sidebar sections when Magiclysm is enabled: - Current/Max Mana: Showing current and maximum mana numbers - Mana Graph: Showing a 25-character graph of current mana - Mana Pool: Same graph, but using the "pool" fill style All widgets include color-coding, going from light blue to yellow, light red, and red as mana diminishes.
wapcaplet
force-pushed
the
w-magic-widget
branch
from
January 12, 2022 22:23
629f889
to
3e74ff9
Compare
Neat you reinvented sparklines. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
[C++]
Changes (can be) made in C++. Previously named `Code`
Info / User Interface
Game - player communication, menus, etc.
[JSON]
Changes (can be) made in JSON
json-styled
JSON lint passed, label assigned by github actions
Mods: Magiclysm
Anything to do with the Magiclysm mod
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Mods "[Magiclysm] Extend custom sidebar to include mana, max mana, and mana graph"
Purpose of change
Enable the custom sidebar to display mana level, but only when Magiclysm mod is enabled.
Fix #54297
Describe the solution
widget::load
to read an "extends" object's nested "widgets"max_mana
widget variable (since max mana is indeed variable)data/mods/Magiclysm/ui/sidebar.json
with mana widgets, layouts, and sidebar extensionsDescribe alternatives you've considered
TheDone, thanks @anothersimulacrum for digging up the deets.generic_factory
seems like it natively supports the use of "extends" and "delete", but I couldn't get it to work without adding an explicit "extends" handler insidewidget::load
. I expect there's a cleaner and more generalized way to do this, and would be thrilled if anyone can tell me how.Testing
Additional context
Positioned mana sections of custom sidebar at the top for easier screenshotting:
How the new widget sections appear in the sidebar:
The graph is the first one to use the "pool" method of symbol filling - notice how the full bar depletes from
#
to=
, then down to-
and finally.
:Nearly out of mana:
Recharged some mana, then cast synaptic stimulation - maximum mana increased:
A few examples with both "Mana Graph" and "Mana Pool":