Feature/add top clipping - #3887
Conversation
|
Sounds like a nice feature. Could you add a video of this in action? |
|
|
Understandable. Would you like me to take over to implement the window, then? |
|
Yes |
862e0f9 to
5ee0e9a
Compare
|
I've rebased the PR on top of current master. Will work on adding a GUI/window soon. |
5ee0e9a to
0174125
Compare
|
Added a basic UI with a scrollbar that allows setting the max height. Aiming to add a label with human-readable units next.
|
0174125 to
13a6f6a
Compare
|
One thing I was also looking at was mouse position to tile as my understanding is mouse interaction is done by rendering the scene then seeing if the mouse is on a rendered pixel. In a cut away view that's harder to pull off |
fd18f83 to
cdf465a
Compare
90521ed to
614cbc2
Compare
f9418ea to
2449fa9
Compare
| ShortcutManager::add(Shortcut::viewClippingIncrement, StringIds::shortcut_max_clip_height_increment, maxClipIncrement, "maxClipIncrement", ""); | ||
| ShortcutManager::add(Shortcut::viewClippingDecrement, StringIds::shortcut_max_clip_height_decrement, maxClipDecrement, "maxClipDecrement", ""); |
There was a problem hiding this comment.
Not sure if we should keep these. My preference would be to stick the window.
| static constexpr int16_t kDefaultMaxClipHeight = World::kMaxTileHeightSmallZ * World::kSmallZStep; | ||
| static int16_t maxClipHeight = kDefaultMaxClipHeight; |
There was a problem hiding this comment.
Even if we only use this for the main window, for now, I think we should move this into the viewport struct.
| void init() | ||
| { | ||
| _viewports.clear(); | ||
| Ui::resetMaxClipHeight(); |
There was a problem hiding this comment.
Should maybe do this when the 'view clipping' window is closed as well.




Added shortcut that increments and decrements the clip height. Anything above the max clip height is not rendered and ignored for collision detection.
Additional features in this vein could include clip height presets and also ghost placement at the clip height itself.