The-Source-Eternal / Unwritten3D

Create games
http://the-source-eternal.github.io/Unwritten3D/
5 stars 1 forks source link

Edited cube turned black #40

Open knod opened 10 years ago

knod commented 10 years ago

After I create a bunch of components on one item, it turns black unless hovered over, in which case it turns red as it should. It never changes back to it's original color.

knod commented 10 years ago

Clicking on the cube allows it to go back to its original color

knod commented 10 years ago

Actually, this time the color didn't change back. I've not identified the difference between these two occasions.

kumavis commented 10 years ago

This happens when the mouseExit is called before mouseEnter is ever called. Based on my understanding of the code, this can't happen (?).

kumavis commented 10 years ago

(not saying i don't believe your bug)

knod commented 10 years ago

I don't need your belief! I trust in myself!

When you say "This happens" are you referring to the cube turning black (which it very much does) or to the cube turning back to the original color (which I'm not as sure of as I haven't gotten it to repeat)?

Did I mention the block doesn't turn black till I remove the mouse from it? I said "unless hovered over", but I'm not sure that was clear. After I close the inspector, the block remains red until I move my mouse off and is then black. It will turn back to red again, but not back to the original blue.

If a mouseexit before a mouseenter is the problem it may be because something happens randomly when I'm clicking on inspector stuff that registers a mouseexit and on exiting the editor mouseenter is registered? Maybe I wouldn't have to make a lot of components if it's a random chance thing, but that's how I discovered it.

kumavis commented 10 years ago

The box will turn black if the mouseExit event is called before mouseEnter event is ever called. Based on my understanding of the code, this can't happen because the mouseExit event can only be called on an object that has been saved as the currentHover, which happens before the mouseEnter event. Strange though! see if you can pinpoint it. Hmm though... you might be right about selecting something in the editor and closing it and looking away...

knod commented 10 years ago

I did pinpoint it, it's as I described. Oh, perhaps you mean to ask if it's a randomness thing? That may take a lot of testing, I'll see if I have time.

kumavis commented 10 years ago

Oh, I bet you duplicated a hover component while you were hovered over the object. does that sound right?

knod commented 10 years ago

Yeah, I definitely did that. I think you're probably psychic.

knod commented 10 years ago

First the turning black thing:

Repeated 3 times: Actions: Hover over object -> press 'q' -> components -> dublicate hover twice -> inspector -> return mouse to hover over object (that part doesn't seem to matter) -> press 'q' -> move mouse away.

Result: Object is very dark when not hovered over. If hovered over, it is red. Other objects do turn red when hovered over.

Repeated 2 times: Then: Deleting one hover component makes the object always red and no other objects turn red when hovered over.

Repeated 2 times: Then: Deleting any more or all hover components doesn't change anything more, the object stays red and no other objects turn red (even, if I recall correctly, when they are given another hover component).


Next, I think this relates to the same issue.

Repeated 3 times: Actions: Hover over object -> press 'q' -> components -> dublicate hover -> inspector -> return mouse to hover over object (I believe) -> press 'q' (that part doesn't seem to matter) -> move mouse away and then back onto object -> press 'q' -> hover -> components -> dublicate hover -> inspector -> return mouse to hover over object (I believe) -> press 'q'.

Repeated 3 times: Actions: Hover over object -> components -> delete previously added hover (that did not cause block to turn red) -> inspector -> return mouse to hover over object (I believe) (that part doesn't seem to matter) -> press 'q'.

Result: Object stays red and no other object will turn red on hover.


Addendum: It doesn't seem to matter whether or not my mouse is hovering over the object when I exit editing mode. It also doesn't seem to matter whether I'm in the inspector or in the component editor when I exit editing mode.

kumavis commented 10 years ago

Oh, I bet you duplicated a hover component while you were hovered over the object.

Yeah, I definitely did that. I think you're probably psychic.

Sorry I should have added that, thanks to your confirmation, I understand the problem now. I'll be more clear next time. Thanks for the thorough follow up!