CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.69k stars 4.19k forks source link

Dialogues on curses are messed up #73030

Open NetSysFire opened 7 months ago

NetSysFire commented 7 months ago

Describe the bug

image

image

Attach save file

n/a

Steps to reproduce

  1. Launch any game in curses.
  2. Make any dialogue appear. E.g by quitting.

Expected behavior

It looks correct. I am confirming this because someone else on IRC can also reproduce.

Screenshots

No response

Versions and configuration

Additional context

No response

katemonster33 commented 7 months ago

what exactly is the issue here? "looks incorrect"?

NetSysFire commented 7 months ago

image

image

For reference, both popups in 0.G.

kevingranade commented 7 months ago

Your issue is, "it is not drawing a border"?

katemonster33 commented 7 months ago

I had a think on this, we definitely could do better with the spacing around each window. The issue is that ImGui has several variables for things like the number of pixels to leave before and after a window's border before the content can draw. ImTui sets all of these to 0 to save space. In a bigger window like the keybindings UI i think it makes sense, but maybe in the popup it's too tiny.

I think there's two ways we could deal with this that wouldn't be too bad.

In the popup code, we could add ImGui::Text fields before and after the popup's content. This would add an extra pixel of size above and below the text. BUT this would have to be done with preprocessor directives so it only happens on ImTui which is sort of gross.

The other fix would be to play with the item spacing variables set in imtui_impl_text.cpp and set them to values that make more sense for us. It just means that windows like the keybindings UI will always have a pixel on all sides of the content reserved for the grey blank space 'border'. Maybe this is ok. I guess it's for others to decide :)

Edit: I forgot one. We could set a special ImTui-specific variable to always draw ASCII borders around windows. This would bring back the lines around the windows. I find the current look more aesthetically pleasing personally, but I also don't play the curses build so I'm happy with what everyone else wants

katemonster33 commented 7 months ago

Also worth mentioning. I'm very busy fixing more important issues. If anyone else could look into this it would be a huge help

IdleSol commented 7 months ago

Your issue is, "it is not drawing a border"?

And where's the question mark gone?

katemonster33 commented 7 months ago

And where's the question mark gone?

I see it now. This sort of stuff needs to be put in the issue description.

katemonster33 commented 7 months ago

repeating my findings here.

so ImTui has an option for drawing ASCII borders around windows, which i turned on with some test code. unfortunately, though, this does not leave extra space around a window for the border, so it just tramples the contents of your window with the border characters. and it's not smart enough to draw the border above the window (when there's no titlebar).

We will need to revisit the ImTui examples and figure out what's going on here, either this never worked, or something broke in the ImTui code somewhere along the way as I back-ported its patches to the latest ImGui

NetSysFire commented 3 months ago

Update: popups are completely blank now. Probably for quite some time already. The gray splotch is the "do you want to quit?" menu.

image