feat: add an action for toggling on/off UPS charging for mundane electronics #4775
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.
Purpose of change
This adds the ability to toggle whether a UPS-compatible item will charge from a UPS or not via a use action, to finally fix the issue of items only implied to be compatible with UPS because it's a portable power bank you could plug it into uncontrollably draining your power as soon as you pick them up.
Fixes #3900
Closes #1605
Describe the solution
C++ changes:
TOGGLE_UPS_CHARGING
toItem_factory::init
.iuse::toggle_ups_charging
which, similar toiuse::toggle_heats_food
, toggles whether an item will have theUSE_UPS
flag or not.JSON changes:
TOGGLE_UPS_CHARGING
action.TOGGLE_UPS_CHARGING
in their use actions instead of starting with theUSE_UPS
flag, replaced withRECHARGE
where absent, and updated item descriptions accordingly: professional camera, control laptop, e-ink tablet PC, laptop computers, mp3 players, handheld game system, smartphones, electric jackhammer, and game watch.Documentation changes:
TOGGLE_HEATS_FOOD
andTOGGLE_UPS_CHARGING
use actions in json_flags.md.Describe alternatives you've considered
Testing
Additional context
Checklist