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

Show a "What's Here" box in sidebar when mouse hovers over a tile #3883

Merged
merged 36 commits into from Nov 10, 2013

Conversation

Falconne
Copy link
Contributor

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.

Falconne and others added 19 commits October 20, 2013 12:42
- 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
…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.
@Petethegoat
Copy link
Contributor

👍

@CIB
Copy link
Contributor

CIB commented Oct 27, 2013

Thanks a bunch!

@Abalieno
Copy link
Contributor

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.

@CIB
Copy link
Contributor

CIB commented Oct 27, 2013

It does. The "that stuff is here" area is used for showing nearby monsters.

@Abalieno
Copy link
Contributor

If it's under the text area on the right then there's PLENTY of unused space.

catatile10b

Maybe add a check for screen size and only enable it if big enough?

@illi-kun
Copy link
Contributor

@Abalieno, excuse me for the side question, but what the tileset is it?

@CIB
Copy link
Contributor

CIB commented Oct 27, 2013

@Abalieno Game must run at minimum size which I think is 80x25 or something.

@Abalieno
Copy link
Contributor

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.
The tileset is my experiment. I made a post on the forums since people keep asking.
http://smf.cataclysmdda.com/index.php?topic=3901.0

@Falconne
Copy link
Contributor Author

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.

@Abalieno
Copy link
Contributor

"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?

@Falconne
Copy link
Contributor Author

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.

@Abalieno
Copy link
Contributor

Commit, please?

@kevingranade kevingranade merged commit 88d0939 into CleverRaven:master Nov 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants