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
Show a "What's Here" box in sidebar when mouse hovers over a tile #3883
Conversation
- Moved input_event back to input.h - Removed mouse_kyb_* functions - Places that use mouse now use input_context class - input_context can now handle mouse events properly TODO: Add relevant keybindings to keybindings.txt
… attacks to work).
…reen. Only left click mouse action should move the targeting cursor.
…s getch() as a timer. It's either this or implement a high resolution timer for the animations.
👍 |
Thanks a bunch! |
If it doesn't hide any part of the screen then you should make it so it's active all the time, without the "look around" toggle. |
It does. The "that stuff is here" area is used for showing nearby monsters. |
@Abalieno, excuse me for the side question, but what the tileset is it? |
@Abalieno Game must run at minimum size which I think is 80x25 or something. |
Yes, I'm simply saying to add this "always on" feature as an option that ONLY activates as long there's enough room. The game will run at minimum size, but let's also use the space if we know the window is big enough and it's all being wasted. P.S. |
Yes, that's what currently happens. It only activates if the viewport is tall enough to accommodate it. I chose to go with the area below the status because most people will have plenty of free space and that lets me grow the box to show more than one item on the tile (unlike the default Look Around box that only shows one item). However, what I should do is make it so that if there is not enough room, it just prints the default Look Around box in the place where it normally is.... then even those on small screens get the benefit. And I might have misunderstood the question, but it is "active" all the time, without a toggle. It activates when you hover over a visible tile and goes away if you move the mouse off or press a key, refreshing whatever it covered. |
"Box goes away if a key is pressed, or if the mouse is moved off the terrain window." I thought that since it turns off when you press a key, then it wouldn't be active at all times. Why should it turn off when you input a command? |
Well from an implementation point of view this is easier, to make sure the box goes away before any other window is rendered on top. There's currently no "window manager" system, so if something gets drawn that partially obscures this box, then when that goes away part of this box will be missing. This way is easier to do than trying to handle every such case. Also, once a key is pressed I don't think the box is necessary any more. You must already know what's on the tile. And if the input is a movement key, the map will scroll and the mouse will be pointing at a different tile. So it might get a bit distracting when you're running to have that box flipping through information really fast. Further, I have a future enhancement I want to add which would be an optional box that shows in the same place, called "What's near me". That would be on whenever the mouse hover isn't showing, giving you a compact version of the "V" screen, telling you what items are around in a 10 tile radius from you. That would be more useful to have "always on" than the info about a single tile. |
…ver view, then use the area normally used by the Look Around box.
Commit, please? |
This incorporates the input refactor PR #3766.
This is SDL only.
Shows an enhanced "Look Around" box below the status area, when the mouse hovers over a visible tile. Box goes away if a key is pressed, or if the mouse is moved off the terrain window. Only active if mouse cursor is not hidden. Works in both standard and narrow status views.
Since the there's plenty of room below the status area in the side bar, this box can grow to show all the items visible on a tile (within reason), unlike the default "Look Around" which only shows you one item.