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

string covering other string #27279

Closed
nsklaus opened this issue Dec 23, 2018 · 4 comments
Closed

string covering other string #27279

nsklaus opened this issue Dec 23, 2018 · 4 comments
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc.

Comments

@nsklaus
Copy link
Contributor

nsklaus commented Dec 23, 2018

Describe the bug
in sidebar info box, long strings being displayed about an object or a npc are covering the two string at the bottom of info box:

  • "press 'e' to view extended description"
  • "press 'V' to list items and monsters"
    please see attached screenshot

To Reproduce
Steps to reproduce the behavior:

  1. look at object or npc. if the string is too long, it will cover the two string at the bottom.

Expected behavior
if the object or npc description is too long, there should be a slider.

Screenshots
mangled_string

Versions and configuration(please complete the following information):

  • OS: kubuntu 18.10, kernel 4.20rc7
  • Game Version: Cataclysm DDA version 0.C-35451-ge0588e5098-dirty
  • Graphics version: Tiles
  • Mods loaded: default
@mlangsdorf mlangsdorf added <Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. labels Dec 23, 2018
@MarcusAseth
Copy link
Contributor

MarcusAseth commented Jan 16, 2019

I tried and did some digging on this.
I am not sure if the one you're talking about is the "Look Around" tab in the side pannel you open by pressing "x", but by watching your image I can tell it the the same logic, the same resoult on the Look Around tab if you resize the game window to the minimum allowed size.

So inside game::look_around() there is a call to game::pre_print_all_tile_info() which in turn calls game::print_all_tile_info() .
As the name suggests, this function is responsible for printing all that information you see inside the box on the side panel.
The image below shows some of what it does:
immagine

As you can see there is a lot of calls to functions that do "print" stuff, each one with the logic to print the relevant informations on screen. At first (before actually seeying what that function was doing) I had thought it would have been relatively straightforward to just compare the size of how many line we want to print in total and the numbers of lines available for printing (based on the current window size), and then just print the correct lines based on which line we are at in the scrolling phase, controlled with "pageUp" and "pageDown" keys.
But since this are all dosjointed functions printing their own thing and possibly using a variable ammount of lines without even telling me, and without the option to modify them since they're probably used all over the place as they are, then I think the only option is to make a matching set of function that it only executes the logic to produce the correct vector of strings, and then modify the existing ones to be implemented in term of the function that produce the vector of strings plus a loop that print them all.
Basically separating the string creation from the printing operation.
That way I could use the set of function that only produces the string to buil a vector that tells me the size of the final output, and thus being able to print only what fits on the screen, and at the proper "current line" during the scrolling phase.

Does this sounds like a reasonable solution?

@nsklaus nsklaus closed this as completed Mar 2, 2019
@kevingranade kevingranade reopened this Mar 2, 2019
@esotericist
Copy link
Contributor

For what it's worth, I am reasonably confident my changes to Look Around in #29478 will have greatly mitigated this as an actual problem (due to the increase in size of the text box), even if it isn't a proper 'fix'.

@Night-Pryanik
Copy link
Contributor

The press 'e' to view extended description and press 'V' to list items and monsters lines ain't shown in the Look Around mode anymore. Also the height of the the Look Around window is much larger now, much more info fits there without overlapping. So for the most part this issue is resolved. But adding scrollbar will definitely be the ultimate solution.

@BrettDong
Copy link
Member

Fixed in #46526:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants