Path-of-Terraria / PathOfTerraria

GNU General Public License v3.0
1 stars 1 forks source link

Bug - Ability to drag skill tree out of bounds of panel #82

Closed CollinHerber closed 3 months ago

CollinHerber commented 3 months ago

image

Shouldn't be able to drag the inner panel outside of the panel itself and it should have borders like it does on the right and bottom.

GabeHasWon commented 3 months ago

The scissor rectangle on the inner panel is working fine for me, not sure how you got the UI elements to display outside of the bounding box. Should still constrain the inner elements, but that's something to note.

CollinHerber commented 3 months ago

The scissor rectangle on the inner panel is working fine for me, not sure how you got the UI elements to display outside of the bounding box. Should still constrain the inner elements, but that's something to note.

It may be because of 4k? I am able to just simply drag it to outside the panel in the left and top boundries

GabeHasWon commented 3 months ago

I'm replicating dragging it out of bounds, just not it displaying outside of the parent element. Unsure why. 4k might do it, XNA might be weird with that high of a resolution.

GabeHasWon commented 3 months ago

I've got it pretty close to functioning - it will stop dragging elements once your mouse gets out of bounds of the main panel. However, take this screenshot: image If I click and drag left, the actual UI will be dragged way off screen, though it will be clamped at some point. This still means you can easily get UI off screen, it's just harder. I can't wrap my head around how to fix this, so I'll leave it for now.

benj7126 commented 3 months ago

What exactly is the problem that is supposed to be fixed here?

GabeHasWon commented 3 months ago

You are able to drag the skill tree completely off of the panel, rendering it either invisible or visibly broken looking like in Collin's original screenshot. This means it's really easy to lose it offscreen, and you have to restart the game in order to fix this.

benj7126 commented 3 months ago

Cant we just make it auto-center when you open it?

or probably better yet, when it gets bigger bound it so that you cant move it out, red is the screen black is a box created by taking the furthest passives billede

it will stop dragging elements once your mouse gets out of bounds of the main panel

i explicitly made dragging mouse outside of panel a feature (as it was simply "drag if hovering" before) bc it was irritating me

CollinHerber commented 3 months ago

This means it's really easy to lose it offscreen, and you have to restart the game in order to fix this.

This is not true, it does have a limit as to how far you can drag it. You cannot get it to a point where it's fully offscreen, at least not for me.

Cant we just make it auto-center when you open it?

It already does this no?

i explicitly made dragging mouse outside of panel a feature (as it was simply "drag if hovering" before) bc it was irritating me

If we are okay with the being able to be dragged outside the background color that seems okay to me. Just seemed a bit weird.

benj7126 commented 3 months ago

If we are okay with the being able to be dragged outside the background color

i dont get what you mean here...

when it gets dragged out, its supposed to cut off billede

And when the skill tree is big enough, we will end in a situation where the whole tree cant fit within the background color...

CollinHerber commented 3 months ago

i dont get what you mean here... when it gets dragged out, its supposed to cut off

This does not happen on 4k, I will provide a gif when I am home. It doesn't stop at the top or left border

benj7126 commented 3 months ago

shouldn't the priority be fixing that then..?

making it not move outside is just ignoring the core problem, cuz if we end in a situation where the tree doesn't fit in the panel, this wouldn't have fixed anything, no?

CollinHerber commented 3 months ago

making it not move outside is just ignoring the core problem, cuz if we end in a situation where the tree doesn't fit in the panel, this wouldn't have fixed anything, no?

Well even if the tree gets too large to fit in the current bounds you would still be able to drag the tree around to center it where you need to. I'm not suggesting we take the dragging ability away, but rather prevent it from bleeding outside of the bounds of the panel itself

benj7126 commented 3 months ago

prevent it from bleeding outside of the bounds of the panel

if the tree dosent fit in the panel, how can it not bleed outside? (assuming i know what you mean by "bleeding outside")

GabeHasWon commented 3 months ago

I interpreted this as having at least one node of the tree visible on the panel at all times, such that the player can see it and move it. This makes the most sense personally.

benj7126 commented 3 months ago

iml, if thats so, then i naturally agree, as it seems to be what i wrote in the post above

bound it so that you cant move it out

GabeHasWon commented 3 months ago

Yeah, that's probably the best solution. Creating a bounding box for it should be easy enough too. I'll give it a go in a bit.

GabeHasWon commented 3 months ago

I've got it more or less working; you cannot fully drag the UI off screen without it being visible in most cases. Since it's a rectangle bounding box for a non-rectangular tree, some positions may not show any of the UI. That being said, for some reason each PassiveElement's GetDimensions are saying they're of 0 width/height, despite their Width and Height being set appropriately. This means that the bounding box I've made can't be perfectly accurate. And in InnerPanel.Draw, each PassiveElement's GetDimensions always has a position of 0, 0 and the same for size. I'll be un-assigning myself since it seems that I'm missing some fundamental understanding, there's lot here that just doesn't make sense, and I don't want to write code that is inflexible or super specific.

GabeHasWon commented 3 months ago

Unsure of which PR fixed it exactly, but this issue no longer persists.