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

Mods can add categories to the help menu #78126

Merged
merged 9 commits into from
Nov 26, 2024

Conversation

Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Nov 25, 2024

Summary

Mods "Mods can add categories to the help menu"

Purpose of change

Having in game explanations of the basics of mods peeps are playing with would be really nice

Describe the solution

Mods can place "type": "help" objects anywhere to add new categories to the help menu when the mod is loaded, see new doc and the existing ones in /data/core/help.json (or /data/help/texts.json prior to this PR's merge) for syntax.

Moves the current help menu data to /data/core where it gets loaded normally rather than having unique handling with a hardcoded path
The category keybinds for the help menu are now autogenerated a-z then A-Z so that mods don't need to somehow pick unique ones
Order is per source so each mod can do an order from 0-X rather than somehow picking unique order numbers
Adds a new doc for adding to the help menu

Doesn't add any initial uses, Standing Storm has stuff for MoM somewhat ready to go though

Describe alternatives you've considered

After this I'll probably give imguifying the help menu a shot and maybe add tabs or separators per mod if I'm feeling spicy or at least make it handle more categories total than it can currently and put the category name at the top when you have one open.
Ideally it would use the same keybind tag parsing as parse_tags but I'll look at doing that in a later PR too where I try to wrangle some of the other random tags we parse separately. I might add parse_tags support itself if running it with a dummy Character on the main menu actually works period.

Testing

Tested the main menu help still worked on opening the game and after exiting to menu
Tested binds, mouse and highlighting worked as expected
Tested that multiple mods can add categories at the same time and that exiting to menu and loading saves with other mods etc works as expected
image

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Mods Issues related to mods or modding astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Nov 25, 2024
@Procyonae Procyonae marked this pull request as ready for review November 25, 2024 01:53
doc/HELP_MENU.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the Code: Tests Measurement, self-control, statistics, balancing. label Nov 25, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 25, 2024
@Night-Pryanik Night-Pryanik merged commit 46fa402 into CleverRaven:master Nov 26, 2024
20 of 27 checks passed
@Procyonae Procyonae mentioned this pull request Nov 27, 2024
andrewhr added a commit to andrewhr/Cataclysm-DDA that referenced this pull request Nov 28, 2024
After CleverRaven#78126 merge, there is no data/doc folder anymore, as help.json
become "a thing" so to speak.

This causes errors on macOS build, as part of dmg assembly we do need to
copy all folders, and mv (at least on macOS) is strict in relation to
the missing path.

The fix is essentially remove all mentions to old data/doc from
Makefile..
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` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants