Son-Guhun / Titan-Land-Lands-of-Plenty

A WC3 sandbox roleplaying map inspired by those that came before.
MIT License
10 stars 0 forks source link

Work around selection issues when working with effects #192

Open Son-Guhun opened 4 years ago

Son-Guhun commented 4 years ago

Have a list (possibly in left side of the screen) which shows all currently selected objects. When mouse hovers the name of an object, highlight that object in the game world. Clicking on the object will open that object's property menu on the other side of the screen.

Ideally this system would affect only effects, so it might be a better idea to first tackle code-generated pathing maps.

Selection with instant feedback

Requires recalculating selection each frame. Harder to implement, and ideally would be local, since it only needs to happen for the player that is selecting.

And idea for doing this would be to split into two different sets: "already selected" and "in an intersecting block, but not selected". If selection grows, only the second set needs to be iterated over. If selection decreases, only the first set needs to be iterated over. However, if it grows in one dimension and decreases in another, both sets will need to be checked.

Selection with no feedback

Here, selection only happens when the user finalizes the square they intend to select. It's much easier to implement, and should probably be my first implementation.

Just create an arraylist with the selected things and use it to display the names of the decorations in a listbox.