-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
More vehicle part descriptions #24462
More vehicle part descriptions #24462
Conversation
Feedback from reddit and discourse is that the vehicle descriptions are useful, but could use some more details on interactions. Add the default keystrokes to use controls, the interactions between seats and seatbelts, and the commands to use most of the crafting rigs and engineering tools to the descriptions.
vehicle part descriptions might be useful in places other than the install menu, so move the code that formats the description into its own function.
astyle in the right order for once.
Display vehicle part descriptions in the overview, so players don't have to install a part to see what it does. Instead, players can see the descriptions of installed parts. Incidentally, rename print_part_desc() to print_part_list() to minimize confusion with the new print_vparts_desc().
Minor issues (can be addressed in later PRs):
|
I can add a commit to fix the minor issues. I though fold_and_print would handle the scrolling automatically, but if it doesn't, I can copy the logic from print_parts_list. |
Right, I agree there is a problem. I was just explaining why I didn't code it better - because I thought I had. Ah, well. |
Now that vehicle part descriptions take up space in the w_msg window, that window needs to be able to scroll. Remove the > and < keys from the keybinds for the vehicle fuel list by creating two new keybinds. Astyle vehicle_interact:do_main_loop() in the process.
That was fun. The descriptions list should be truncated to the window size now, with a message indicating the scroll keys. Hitting TAB, BACKTAB, <, and >, should all do reasonably sensible things and the vehicle |
change vpart_info::format_description to count the number of lines printed and return that value. change vehicle:print_vparts_desc to count the number of lines it is printing versus the window size, and to add scroll messages if the there are more lines of description than available space. Add an offset, so the descriptions don't always start printing at the frame part. adjust veh_interact::do_main_loop to add the keybinds for scrolling through the descriptions. incidentally, in veh_interact::move_cursor, correctly pass the size of w_msg so descriptions get line wrapped to the width of the window and not the height.
2c35e35
to
96fff3d
Compare
Okay, this commit has grown to ~950 lines. I can split off the data/json/vehicle_parts changes if people would like, but the src changes are fairly tightly coupled. |
@@ -28,7 +28,7 @@ | |||
"broken_color": "light_blue", | |||
"difficulty": 2, | |||
"durability": 100, | |||
"description": "An extendable cantilever crane. Can be used to jack up another vehicle to change the other vehicle's wheels, or lift a heavy component like an engine from another vehicle.", | |||
"description": "An extendable cantilever crane. If it is in your line of sight and within two tiles of another vehicle, you will automatically use if when you want jack up the other vehicle to change the its wheels, or lift a heavy component like an engine that you are installing in or removing from the other vehicle.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many spaces here and in two next changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Fixed with the 6th commit.
@@ -11,7 +11,7 @@ | |||
"broken_color": "light_blue", | |||
"difficulty": 5, | |||
"durability": 200, | |||
"description": "A rigid steel boom crane. Can be used to jack up another vehicle to change the other vehicle's wheels, or lift a heavy component like an engine from another vehicle.", | |||
"description": "A rigid steel boom crane. If it is in your line of sight and within two tiles of another vehicle, you will automatically use if when you want jack up the other vehicle to change the its wheels, or lift a heavy component like an engine that you are installing in or removing from the other vehicle.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos:
you will automatically use if when you want jack up the other vehicle to change the its
should probably be:
you will automatically use it when you want to jack up other vehicle to change its
@@ -28,7 +28,7 @@ | |||
"broken_color": "light_blue", | |||
"difficulty": 2, | |||
"durability": 100, | |||
"description": "An extendable cantilever crane. Can be used to jack up another vehicle to change the other vehicle's wheels, or lift a heavy component like an engine from another vehicle.", | |||
"description": "An extendable cantilever crane. If it is in your line of sight and within two tiles of another vehicle, you will automatically use if when you want jack up the other vehicle to change the its wheels, or lift a heavy component like an engine that you are installing in or removing from the other vehicle.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar typos here.
@@ -46,7 +46,7 @@ | |||
"broken_color": "light_blue", | |||
"difficulty": 2, | |||
"durability": 100, | |||
"description": "A small pallet lifter. Can be used to jack up another vehicle to change the other vehicle's wheels, or lift a heavy component like an engine from another vehicle.", | |||
"description": "A small pallet lifter. If it is in your line of sight and within two tiles of another vehicle, you will automatically use if when you want jack up the other vehicle to change the its wheels, or lift a heavy component like an engine that you are installing in or removing from the other vehicle.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar typos here.
@@ -65,7 +65,7 @@ | |||
"difficulty": 2, | |||
"damage_modifier": 200, | |||
"durability": 300, | |||
"description": "A pair of forklift arms. Can be used to jack up another vehicle to change the other vehicle's wheels, or lift a heavy component like an engine from another vehicle.", | |||
"description": "A pair of forklift arms. If it is in your line of sight and within two tiles of another vehicle, you will automatically use if when you want jack up the other vehicle to change the its wheels, or lift a heavy component like an engine that you are installing in or removing from the other vehicle.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar typos here.
Scrolling vehicle part description window with Also
No need to split yet. |
…ssible limit the maximum amount of scroll based on the size of the w_msg, prevent accumulation of scroll passed the maximum or minimum amount, and always display the vehicle part descriptions if the w_msg isn't being used to display something else.
Fixed the scroll-off issue. It's approximate, but seemed adequate in my testing. Fixed the typos in the JSON - thanks for the review. |
The bug is still on, but only for tiles with little vehicle parts (when all descriptions go to first page). Here is first page - it does not contain But I can still press And if I go to tile with multiple parts (which descriptions do not fit on one page): I can only proceed to some ultimate page with description of last part: |
More fun! |
limit scrolling such that you can't scroll if all the descriptions fit it the window, and you can't scroll down past the point that the remaining descriptions fit in the window, and you can't scroll up past the first description. Method hopefully documented adequately in the function, because I may need to reuse it in the future.
0b17be7
to
f1abdff
Compare
Looks good now! |
Expand some vehicle part descriptions based on feedback from reddit and discourse.
Refactor the code that prints the vehicle part description so it can be used it more places than just the install menu.
Print the descriptions for all vparts on the current tile in the general vehicle interaction display, using the window panel that was otherwise blank