-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cable rework part 2: Extension cords and more (#66871)
* Make "Plug in / Unplug" the default link_up menu text * Make link_up use default ammo_scale of 0 * cable json cleanup; Remove JUMPSTART from plug cables; change cable materials * Add clear_pockets_if, a flexible function for deleting pocket contents * Simplify links by making devices handle links themselves; split up link iuse functions; add move_cost parameter; rename charge_rate to wattage * Add ability to extend cables with other cables * Improve link display in inventory, showing current/max length and number of extensions; adjust sorting of linked items * Reopen cable menu for convenience if reeling up an already unspooled cable * Fix vehicle cables breaking off the turn AFTER they pass the threshold * Drop snapped off vehicle cables at the previous tile position * Change find_vehicle() into a public map function, use for better link vehicle pointer initialization * Fix link creation connecting to the wrong point * Immediately process cables on creation if they're linked * Remove tow cable section of shed_loose_parts - Tow cables aren't loose parts, so this never gets called * Remove UNMOUNT_ON_MOVE from cables, since it's misleading. Don't change functionality * Let shed_loose_parts selectively exclude cables * Format vehicle cable linking / tow cable linking to match each other * Split link_length funcs between current and max * Make efficiency a float to more easily handle extensions * Adjust link_up item info * Add BATTERY flag for battery vehicle parts * Astyle * Revert "wattage" back to "charge_rate", as I scrapped my plans for that change * Remove the separate link_up function - the use for it was scrapped * Remove AUTO_DELETE_CABLE, replace with NO_DROP * Show a cable's linked vehicle in the interaction menu * Add a vehicle part inspect action to disconnect cables attached to it. Replace appliance's UNPLUG action with this * Improve cable stretch message for circular distances * Only return items with the CABLE_SPOOL flag with cables(), temporary measure for 0.G * Documentation * Reopen menu on manually detaching cable, as well * Minor fixes * Improve messaging of CBM/UPS/solar backpack links * Lint JSON * Update newly added cables * Clang tidying * Set cable traits and cable part mounts immediately to avoid inaccuracies * Fix linked repair tools * Fix invoke_item_activity losing the method after cancel_activity * Remove debug code * Apply suggestions from code review Co-authored-by: Jianxiang Wang (王健翔) <[email protected]> * More readable booleans Co-authored-by: andrei <[email protected]> * Update src/item.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Make cable extensions contribute volume and weight * Minor fixes * Use const for minimum link efficiency * Revamp how max_length is handled so its recalculated less often * Rework link_extend_cable's weight/volume check to be more readable and functional * Rework link length sorting, moving it to sort_compare * Make AIM sort like inventory_ui does, including using link_sort_key * Let debug cables extend debug cables * Make getting/removing remote parts two separate functions * Change find_vehicle back into a static vehicle function * Change properties_to_item into a vehicle function, part_to_item, as it now requires functions only accessible from vehicle * Make it more clear you pick up cables you disconnect * Rework shed_loose_parts to fix vehicle connections, particularly out-of-bubble ones * Cleanup * Make invalidate_towing give the cable directly to the player if they can stash it * Fix disconnecting tow cables and jumper cables * Unused variable * Make assign_t_state work with appliances * Fix jumper cable -> appliance links * Reword link_to_veh_app & link_tow_cable variables for clarity, as "target" is already used for part targets * Fix connection messages * Reword lambda for cable setting & checking * Cancel link_up if the target point is too far for the cable * Fix error when trying to link a cable immediately after loading or saving * Rename `heavy-duty cable` to `heavy-duty jumper cable` --------- Co-authored-by: Jianxiang Wang (王健翔) <[email protected]> Co-authored-by: andrei <[email protected]> Co-authored-by: Maleclypse <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b4c5469
commit e6f7407
Showing
50 changed files
with
1,547 additions
and
1,340 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.