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
Merged

Conversation

reed501
Copy link
Contributor

@reed501 reed501 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 4 commits April 7, 2019 02:05
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 CleverRaven#29256
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 CleverRaven#29186
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 CleverRaven#29192
@kevingranade
Copy link
Member

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

@ifreund ifreund added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. labels Apr 7, 2019
@kevingranade kevingranade merged commit f070115 into CleverRaven:master Apr 8, 2019
@Chryseus
Copy link

Chryseus commented Apr 8, 2019

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

@reed501 reed501 deleted the ascii_offset_fixes branch September 8, 2019 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc.
Projects
None yet
4 participants