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

Medical Menu Implementation #54763

Merged
merged 13 commits into from
Apr 18, 2022
Merged

Conversation

redrosedialtone
Copy link
Contributor

@redrosedialtone redrosedialtone commented Jan 25, 2022

Summary

Interface "Adds Medical Menu"

Purpose of change

Implements the initial steps for a new Medical Menu, acting (for now) as a more detailed extension of the Player Info ('@') Menu.

Hoping to open up pathways for further content development to do with the medical system, granting a larger (and expandable) interface to represent things that may be confining within the Player Info menu.

Singularly this PR will not add much to the game other than a nicer display of already represented content, and is made to preliminary to further content.

Describe the solution

Opens a new menu under the 'N' hotkey, or via the interaction menu. Functions effectively the same as the @ Menu but in a slightly easier to read format.

image

Describe alternatives you've considered

The Player Info Menu serves better as a light-weight menu, making a more dedicated interface necessary for when further details are needed.

Testing

I only tested different status modifiers to make sure that everything can be displayed neatly and within the bounds of the screen without appearing congested.

Additional context

To make this more expandable, I've tried to use JSON data wherever possible however there is still a couple descriptions that I've had to hard type. A likely follow up would be to change those to also use JSON.

Implements the initial steps for the Medical Menu, changes including;
~keybindings.json - Adds 'View Medical' hotkey under 'N'
~action.cpp / ~action.h / ~avatar.h / handle_action.cpp / game.cpp - Adds the corresponding action to 'View Medical'
+medical_ui.cpp - Menu implementation
~display.h / display.cpp - Exposes bodypart_status_colors
src/medical_ui.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Jan 25, 2022
@nexusmrsep
Copy link
Contributor

Perhaps it can be extension/branch of @ menu in keybinding also? I mean: one tap @ opens the existing character / player info menu, second tap within @ opens up medical menu. This might potentially save some keys and keep important info in one branch of menus.

@redrosedialtone
Copy link
Contributor Author

Perhaps it can be extension/branch of @ menu in keybinding also? I mean: one tap @ opens the existing character / player info menu, second tap within @ opens up medical menu. This might potentially save some keys and keep important info in one branch of menus.

I was actually planning on this, just keeping the starting implementation to having as minimal an impact on any other parts of the game as possible. Don't want to meddle too much with a codebase I'm unfamiliar with for a first commit lol.

Removal of a couple variables left behind from previous implementation, correct character casting.
@Venera3
Copy link
Member

Venera3 commented Jan 25, 2022

Can you include the limb scores (especially those that are HP-scaled) in the right-side readout for the relevant limb? It would help emphasise the point that not only the last hp is important.

@PatrikLundell
Copy link
Contributor

Have you tested it with weird anatomies (such as e.g. mutated characters with extra limbs)?

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 25, 2022
@Maleclypse Maleclypse added Controls / Input Keyboard, mouse, keybindings, input UI, etc. [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON labels Jan 25, 2022
@Maleclypse
Copy link
Member

This is pretty cool! :)

-Access from Player Info ('@') Menu
-Info Menu
-Scrolling Text
-Formatting
-Astyle & Clang Tidy
@redrosedialtone
Copy link
Contributor Author

Perhaps it can be extension/branch of @ menu in keybinding also? I mean: one tap @ opens the existing character / player info menu, second tap within @ opens up medical menu. This might potentially save some keys and keep important info in one branch of menus.

Done, don't know why I was trying to limit the scope of the pull request when it's just another key binding.

Can you include the limb scores (especially those that are HP-scaled) in the right-side readout for the relevant limb? It would help emphasise the point that not only the last hp is important.

Done.
image

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 4, 2022
@Maleclypse
Copy link
Member

Merge conflicts cropped up. Hopefully just a rebase.

@redrosedialtone
Copy link
Contributor Author

Merge conflicts cropped up. Hopefully just a rebase.

I was using the widget functions in [#54531] to display the bodypart_status which has now been replaced in [#54693]. Up to this point the codebase has been easy to understand with precedence, but widgets are a little lost to me as they're never directly referenced in the C++ side of things. I honestly can't tell how to access the equivalent to the removed code in #54693 lol.

@dseguin
Copy link
Member

dseguin commented Feb 4, 2022

Sorry about that, didn't realize that was being referenced here. Try display::limb_color, as that's what the hardcoded sidebar panels use.

nc_color display::limb_color( const Character &u, const bodypart_id &bp, bool bleed, bool bite,
bool infect )

src/medical_ui.cpp Outdated Show resolved Hide resolved
src/medical_ui.cpp Outdated Show resolved Hide resolved
src/medical_ui.cpp Outdated Show resolved Hide resolved
src/medical_ui.cpp Outdated Show resolved Hide resolved
Removed temporarily until the widget implementation is less in-progress; Code cleanup.
@Maleclypse
Copy link
Member

@redrosedialtone can you check your account to see if there’s anything you need to verify in order to unflag your account with GitHub so we can run tests on your PR?

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Mar 16, 2022
@Maleclypse
Copy link
Member

@Venera3 Suggestions on how to make this successful with limbs?

# Explain why this change is being made
# |<----      Limit Each Line to a Maximum Of 72 Characters       ---->|

# Provide links or keys to any relevant tickets, articles or other resources
# Example: fixes CleverRaven#1234, closes CleverRaven#2345, resolves CleverRaven#3456, references CleverRaven#4567
# |<-- Using around 50, Maximum 72 Characters -->|

# Explain why this change is being made
# |<----      Limit Each Line to a Maximum Of 72 Characters       ---->|

# Provide links or keys to any relevant tickets, articles or other resources
# Example: fixes CleverRaven#1234, closes CleverRaven#2345, resolves CleverRaven#3456, references CleverRaven#4567
@Night-Pryanik
Copy link
Contributor

Could you please post a screenshot with Near starving, Very thirsty, Dead Tired, and in Unmanageable pain character? I want to see all top-right indicators with largest descriptions simultaneously.

Also I want to tell you not to be stingy on dimensions of your UI. In particular, please consider making width of your menu larger, like that of Bionics, Mutations, or Missions menus.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Mar 20, 2022
@redrosedialtone
Copy link
Contributor Author

Could you please post a screenshot with Near starving, Very thirsty, Dead Tired, and in Unmanageable pain character? I want to see all top-right indicators with largest descriptions simultaneously.

image

Also I want to tell you not to be stingy on dimensions of your UI. In particular, please consider making width of your menu larger, like that of Bionics, Mutations, or Missions menus.

This'll definitely be necessary to include any further information.

# |<-- Using around 50, Maximum 72 Characters -->|

# Explain why this change is being made
# |<----      Limit Each Line to a Maximum Of 72 Characters       ---->|

# Provide links or keys to any relevant tickets, articles or other resources
# Example: fixes CleverRaven#1234, closes CleverRaven#2345, resolves CleverRaven#3456, references CleverRaven#4567
src/medical_ui.cpp Outdated Show resolved Hide resolved
kevingranade and others added 2 commits March 24, 2022 17:43
# |<-- Using around 50, Maximum 72 Characters -->|

# Explain why this change is being made
# |<----      Limit Each Line to a Maximum Of 72 Characters       ---->|

# Provide links or keys to any relevant tickets, articles or other resources
# Example: fixes CleverRaven#1234, closes CleverRaven#2345, resolves CleverRaven#3456, references CleverRaven#4567
@dseguin
Copy link
Member

dseguin commented Apr 18, 2022

Merged & tested locally, looks good to go. Great work!

@dseguin dseguin merged commit cf799ab into CleverRaven:master Apr 18, 2022
@perryprog perryprog mentioned this pull request Apr 29, 2022
13 tasks
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` Controls / Input Keyboard, mouse, keybindings, input UI, etc. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
Development

Successfully merging this pull request may close these issues.

10 participants