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

Ui fixes #28884

Merged
merged 26 commits into from Mar 29, 2019

Conversation

Projects
None yet
9 participants
@KorGgenT
Copy link
Contributor

commented Mar 21, 2019

Summary

SUMMARY: Features "finish UI panel features and fix some visual problems"

Purpose of change

the feature was incomplete. i wanted to fix the rest of them.
Closes #28813
Fixes #28890
Fixes #29059

Describe the solution

  • Center view based on sidebar
  • fix border on monster list view
  • add option to add spacers between panels
  • log expands to unused space
  • fix Perception display string in classic mode
Show resolved Hide resolved src/game.cpp Outdated
Show resolved Hide resolved src/game.cpp Outdated
Show resolved Hide resolved src/game.cpp
Show resolved Hide resolved src/panels.cpp Outdated

AMurkin and others added some commits Mar 21, 2019

Update src/game.cpp
Co-Authored-By: KorGgenT <curtis.r.merrill@gmail.com>
Update src/game.cpp
Co-Authored-By: KorGgenT <curtis.r.merrill@gmail.com>
Update src/game.cpp
Co-Authored-By: KorGgenT <curtis.r.merrill@gmail.com>

@ZhilkinSerg ZhilkinSerg self-assigned this Mar 21, 2019

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2019

View center is in the center of the screen, not on the player.

image

@I-am-Erk I-am-Erk added the <Bugfix> label Mar 21, 2019

@KorGgenT

This comment has been minimized.

Copy link
Contributor Author

commented Mar 22, 2019

so far i don't know what part of the code draws that cursor. i only hope i can find it soon.

@OzoneH3

This comment has been minimized.

Copy link
Member

commented Mar 22, 2019

Item/Monster Tab problems:

Curses:

  • Item/Monster Tab Trail drawing not working correctly
  • View still not centered.
  • Rain is clearing the @ character symbol.

Auswahl_032

@tinukedaya

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

If you can, please also check the #28890 #28914 #28915 and #28916

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 23, 2019

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

https://discourse.cataclysmdda.org/t/yall-messed-up-the-interface/19310/8

KorGgenT added some commits Mar 24, 2019

@anonym

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2019

@KorGgenT, let me first say I already love the new possibilities with the panel manager! Great work! I was appalled to see the ignorant reactions on reddit etc, so I thought you might want to hear that some of understand where this is going and appreciate your contribution. 👍

So I've tested this branch since I was really looking forward to commit f22d2ee, but noticed that it introduces a regression: whenever I perform and action, the "Look around" square is drawn for a short time around the absolute middle square (i.e. where the character would be without this commit). Looking at the code one wouldn't expect this, but I assume there are more places where the code makes assumptions about the "center" that isn't true any more.

I wonder, is it intentional that the game view (i.e. the tiles) extends "under" the side bar? Perhaps you want to allow players to make minimal panels and thus see more? I was just thinking that if we limited the game view so it stopped where the side bar begins (when it is shown) then those assumptions about the "center" I talked about would become true again and you can stop playing whack-a-mole adding correcting offsets all over the code base like f22d2ee. Of course, I haven't looked into any of this in detail, so I might be completely off.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 24, 2019

IDK if it happens on tiles yet, but on curses the rain animation causes most of the map to shift to one side by a large number of characters.
Mostly before it happens:
weather-ui-shift-before
In an intermediate state:
weather-ui-shift-during
After it hash shifted the whole map:
weather-ui-shift-after

KorGgenT added some commits Mar 25, 2019

rain, rain, go away
fixed rain offset issue, and moved sidebar_offset into a variable in g
@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 26, 2019

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

https://discourse.cataclysmdda.org/t/interface-issues/19394/2

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2019

so far i don't know what part of the code draws that cursor. i only hope i can find it soon.

This code draws this cursor:

} else if( g->u.posx() + g->u.view_offset.x != g->ter_view_x ||
g->u.posy() + g->u.view_offset.y != g->ter_view_y ) {
// check to see if player is located at ter
draw_from_id_string( "cursor", C_NONE, empty_string,
{g->ter_view_x, g->ter_view_y, center.z}, 0, 0, LL_LIT, false );
}

And a bit of info:

X:POS+OFF (66+1 = 67) != TERVIEW (73); DELTA = -6
X:POS+OFF (66+1 = 67) != TERVIEW (73); DELTA = -6
X:POS+OFF (66+10 = 76) != TERVIEW (82); DELTA = -6
X:POS+OFF (66+11 = 77) != TERVIEW (83); DELTA = -6
X:POS+OFF (66+12 = 78) != TERVIEW (84); DELTA = -6
X:POS+OFF (66+12 = 78) != TERVIEW (84); DELTA = -6
X:POS+OFF (66+2 = 68) != TERVIEW (74); DELTA = -6
X:POS+OFF (66+3 = 69) != TERVIEW (75); DELTA = -6
X:POS+OFF (66+4 = 70) != TERVIEW (76); DELTA = -6
X:POS+OFF (66+5 = 71) != TERVIEW (77); DELTA = -6
X:POS+OFF (66+6 = 72) != TERVIEW (78); DELTA = -6
X:POS+OFF (66+7 = 73) != TERVIEW (79); DELTA = -6
X:POS+OFF (66+8 = 74) != TERVIEW (80); DELTA = -6
X:POS+OFF (66+9 = 75) != TERVIEW (81); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-0 = 66) != TERVIEW (72); DELTA = -6
X:POS+OFF (66-1 = 65) != TERVIEW (71); DELTA = -6
X:POS+OFF (66-1 = 65) != TERVIEW (71); DELTA = -6
X:POS+OFF (66-1 = 65) != TERVIEW (71); DELTA = -6
X:POS+OFF (66-10 = 56) != TERVIEW (62); DELTA = -6
X:POS+OFF (66-10 = 56) != TERVIEW (62); DELTA = -6
X:POS+OFF (66-11 = 55) != TERVIEW (61); DELTA = -6
X:POS+OFF (66-11 = 55) != TERVIEW (61); DELTA = -6
X:POS+OFF (66-12 = 54) != TERVIEW (60); DELTA = -6
X:POS+OFF (66-12 = 54) != TERVIEW (60); DELTA = -6
X:POS+OFF (66-13 = 53) != TERVIEW (59); DELTA = -6
X:POS+OFF (66-13 = 53) != TERVIEW (59); DELTA = -6
X:POS+OFF (66-14 = 52) != TERVIEW (58); DELTA = -6
X:POS+OFF (66-14 = 52) != TERVIEW (58); DELTA = -6
X:POS+OFF (66-15 = 51) != TERVIEW (57); DELTA = -6
X:POS+OFF (66-15 = 51) != TERVIEW (57); DELTA = -6
X:POS+OFF (66-16 = 50) != TERVIEW (56); DELTA = -6
X:POS+OFF (66-16 = 50) != TERVIEW (56); DELTA = -6
X:POS+OFF (66-17 = 49) != TERVIEW (55); DELTA = -6
X:POS+OFF (66-17 = 49) != TERVIEW (55); DELTA = -6
X:POS+OFF (66-18 = 48) != TERVIEW (54); DELTA = -6
X:POS+OFF (66-18 = 48) != TERVIEW (54); DELTA = -6
X:POS+OFF (66-19 = 47) != TERVIEW (53); DELTA = -6
X:POS+OFF (66-19 = 47) != TERVIEW (53); DELTA = -6
X:POS+OFF (66-2 = 64) != TERVIEW (70); DELTA = -6
X:POS+OFF (66-2 = 64) != TERVIEW (70); DELTA = -6
X:POS+OFF (66-20 = 46) != TERVIEW (52); DELTA = -6
X:POS+OFF (66-20 = 46) != TERVIEW (52); DELTA = -6
X:POS+OFF (66-21 = 45) != TERVIEW (51); DELTA = -6
X:POS+OFF (66-21 = 45) != TERVIEW (51); DELTA = -6
X:POS+OFF (66-22 = 44) != TERVIEW (50); DELTA = -6
X:POS+OFF (66-22 = 44) != TERVIEW (50); DELTA = -6
X:POS+OFF (66-23 = 43) != TERVIEW (49); DELTA = -6
X:POS+OFF (66-23 = 43) != TERVIEW (49); DELTA = -6
X:POS+OFF (66-24 = 42) != TERVIEW (48); DELTA = -6
X:POS+OFF (66-24 = 42) != TERVIEW (48); DELTA = -6
X:POS+OFF (66-25 = 41) != TERVIEW (47); DELTA = -6
X:POS+OFF (66-25 = 41) != TERVIEW (47); DELTA = -6
X:POS+OFF (66-26 = 40) != TERVIEW (46); DELTA = -6
X:POS+OFF (66-26 = 40) != TERVIEW (46); DELTA = -6
X:POS+OFF (66-27 = 39) != TERVIEW (45); DELTA = -6
X:POS+OFF (66-27 = 39) != TERVIEW (45); DELTA = -6
X:POS+OFF (66-28 = 38) != TERVIEW (44); DELTA = -6
X:POS+OFF (66-28 = 38) != TERVIEW (44); DELTA = -6
X:POS+OFF (66-29 = 37) != TERVIEW (43); DELTA = -6
X:POS+OFF (66-29 = 37) != TERVIEW (43); DELTA = -6
X:POS+OFF (66-3 = 63) != TERVIEW (69); DELTA = -6
X:POS+OFF (66-3 = 63) != TERVIEW (69); DELTA = -6
X:POS+OFF (66-30 = 36) != TERVIEW (42); DELTA = -6
X:POS+OFF (66-4 = 62) != TERVIEW (68); DELTA = -6
X:POS+OFF (66-4 = 62) != TERVIEW (68); DELTA = -6
X:POS+OFF (66-5 = 61) != TERVIEW (67); DELTA = -6
X:POS+OFF (66-5 = 61) != TERVIEW (67); DELTA = -6
X:POS+OFF (66-6 = 60) != TERVIEW (66); DELTA = -6
X:POS+OFF (66-6 = 60) != TERVIEW (66); DELTA = -6
X:POS+OFF (66-7 = 59) != TERVIEW (65); DELTA = -6
X:POS+OFF (66-7 = 59) != TERVIEW (65); DELTA = -6
X:POS+OFF (66-8 = 58) != TERVIEW (64); DELTA = -6
X:POS+OFF (66-8 = 58) != TERVIEW (64); DELTA = -6
X:POS+OFF (66-9 = 57) != TERVIEW (63); DELTA = -6
X:POS+OFF (66-9 = 57) != TERVIEW (63); DELTA = -6

received with this debug code:

    DebugLog( D_INFO, DC_ALL ) << "X:POS+OFF (" << g->u.posx() << ( g->u.view_offset.x > 0 ? "+" : "-" )
                               << abs( g->u.view_offset.x ) << " = "
                               << g->u.posx() + g->u.view_offset.x << ")"
                               << ( g->u.posx() + g->u.view_offset.x != g->ter_view_x ? " != " : " == " )
                               << "TERVIEW (" << g->ter_view_x  << ")"
                               << "; DELTA = " << g->u.posx() + g->u.view_offset.x - g->ter_view_x;

Apparently value of delta (i.e. -6) is a function of sidebar width, tile width and zoom factor (probably window size too), so maybe you just need to include sidebar width in the checks too.

KorGgenT added some commits Mar 26, 2019

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

Cursor now appears on player character when moving or waiting:

image

@OzoneH3

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

  • Player centering in curses works now.

Had to add #if (defined TILES || defined _WIN32 || defined WINDOWS) to

void to_map_font_dimension( int &w, int &h );
void from_map_font_dimension( int &w, int &h );
void to_overmap_font_dimension( int &w, int &h );
void reinitialize_framebuffer();

functions in game.cpp to make it compile.

List items:
The 'X' from draw_trail_to_square is to the right of the item:

Rain dose not artifact anymore but is not raining on the left side by the amount of the offset:

List monsters:
Cursor is off by one when switching to 'x look around' on monster.

@KorGgenT

This comment has been minimized.

Copy link
Contributor Author

commented Mar 27, 2019

  • Player centering in curses works now.

Had to add #if (defined TILES || defined _WIN32 || defined WINDOWS) to

void to_map_font_dimension( int &w, int &h );
void from_map_font_dimension( int &w, int &h );
void to_overmap_font_dimension( int &w, int &h );
void reinitialize_framebuffer();

functions in game.cpp to make it compile.

i was hoping the #if was going to do just that in sdltiles.cpp. you were having issues compiling it? i didn't particularly want to add the #if to every line in game.cpp those functions were defined; do you have any thoughts as to the correct way to get this to work with the header file?

@OzoneH3

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

The issues come from game.cpp.
On the linux terminal version sdltiles dose not get included.
Gorgon has the same problem.

@KorGgenT

This comment has been minimized.

Copy link
Contributor Author

commented Mar 27, 2019

then do i need to rename the header file? if it's not including even if i'm telling it to, no wonder i'm having problems

@OzoneH3

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

You will have to put the prototypes and non tiles functions which return nothing somewhere else, where both console and tiles can find them (not too sure where best through).

KorGgenT added some commits Mar 27, 2019

Revert "Update sdltiles.cpp"
This reverts commit 6bb8212.
@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 28, 2019

Honestly this can wait if it checks out otherwise, but I see bullet trails from NPCs shooting at things being drawn with an offset. Somewhere in animation.cpp perhaps.
Also SCT and hit animations.

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2019

Honestly this can wait if it checks out otherwise, but I see bullet trails from NPCs shooting at things being drawn with an offset. Somewhere in animation.cpp perhaps.
Also SCT and hit animations.

Probably the same issue that was affecting snow/rain animation?

@KorGgenT KorGgenT referenced this pull request Mar 28, 2019

Closed

Map on side? #29059

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

Bullet trails working, SCT messages still offset.
I don't think that's important enough to block this, I'll open an issue if I merge this before it's fixed.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

Is it intentional that in compact view the minimap does not draw a border? It has one, but it looks like it's blanks.

@kevingranade kevingranade merged commit e908b0a into CleverRaven:master Mar 29, 2019

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
gorgon-ghprb Build finished.
Details
@Tharn

This comment has been minimized.

Copy link
Contributor

commented Mar 29, 2019

The issue with the 'view' cursor being drawn when it shouldn't is still there, albeit difficult to reproduce. I made the view cursor appear next to my character by switching windows and coming back to CDDA. I may have clicked on the screen as well.

It drew the cursor 1 tile to the left of my player character.

@ZhilkinSerg ZhilkinSerg removed their assignment Mar 30, 2019

@KorGgenT KorGgenT deleted the KorGgenT:ui branch May 22, 2019

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.