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

Ascii offset fixes #29359

Merged
merged 4 commits into from Apr 8, 2019

Conversation

Projects
None yet
4 participants
@reed501
Copy link
Contributor

commented Apr 7, 2019

Summary

SUMMARY: Bugfixes "Fixes offset issues in ascii caused by the sidebar"

Purpose of change

Closes #29256 - Action highlights off center due to sidebar changes
Closes #29186 - Vehicle crosshair off center due to sidebar changes
Fixes #29192 - Weather doesn't appear on the left side of screen due to sidebar changes

Describe the solution

In places that were forgotten in the sidebar update, I added or subtracted g->sidebar_offset where needed to realign parts of the UI.

Describe alternatives you've considered

Another way of going about all this I briefly considered before being terrified of it is to have the mechanisms that draw things to a location on screen have the offset built in, rather than offsetting at the top level.

Additional context

There's still more to be done. In combat for a fraction of a second an animation appears and it is off center, not sure where that is. Also I don't think my solution for weather animation is as robust as it could be. It seems to work for now however. If new issues appear I will try again.

reed501 added some commits Apr 7, 2019

Realigns action highlights in ASCII
After the sidebar update, ASCII versions had lots of highlights off
center. This adds the sidebar offset onto the highlight. They were
shifted off to the right due to the new sidebar changes. Things
affected: open, close, examine, maybe more.

closes #29256
Fixes vehicle crosshair centering in ASCII
With a tileset off the ASCII 'X' vehicle crosshair was off-center due
to the sidebar change. It being shifted to the right, the tripoint to
draw the crosshair had sidebar_offset.x subtracted from it on its x
axis.

closes #29186
Make weather appear on left side of screen in ncurses
In ncurses after the sidebar update weather effects like rain and snow
wouldn't appear on the left part of the screen. iStartX has been
decremented by the sidebar_offset to allow the beginning X index to
include the now further to the left part of the terrain.

Also changed is removing magic number 121 and replacing it with the
values that 121 came from. Replacing it with MAX_VIEW_DISTANCE (60) * 2
+ 1 (aka double the view of one side plus the tile you're standing on).

I'm not 100% confident in this fix of subtracting sidebar_offset, I will
likely come back to this with a better understanding of animations.

fixes #29192
@kevingranade

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/various-off-center-view-bugs-in-ascii/19535/3

@kevingranade kevingranade merged commit f070115 into CleverRaven:master Apr 8, 2019

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
gorgon-ghprb Build finished.
Details
@Chryseus

This comment has been minimized.

Copy link

commented Apr 8, 2019

There is still an offset when adding a new zone that needs to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.