icewolfz / jiMUD

MUD client for ShadowMUD.com using electron
http://www.shadowmud.com
7 stars 0 forks source link

Code editor: area/virtual editor non rectangle selection #291

Open icewolfz opened 2 weeks ago

icewolfz commented 2 weeks ago

Allow different selection shapes for more odd ball selection of rooms

this is limited buy the canvas tool and how i can detect if a room is in the shape, in theory should be able to do circle and paths to match stuff but not sure how hard with out more testing

icewolfz commented 1 week ago

This will probably not happen, i have been testing oval selection and its not very good due to rooms being square and it ends up selecting nearly the same as square selection if not worse, i have tried a few different ways to test room in circle to try and limit, but it still is never 100% right as its a pain and a lot of complex math just to see if a rectangle intersects an oval, there is experimental code in place that can be enabled on a per editor base using dev tools:

  1. make sure the active tab is the area designer you want it enabled on
  2. type in manager.active.editor.SelectionRegionType = 1

type 0 is standard rectiangle and 1 is Ellipse, 2 is polygon but nothing has been enabled for that and will default back to rectangle, the selection draws nicely the main issue is how to detect which rooms it selects as even if just a little piece is in the circle it gets selected so acts more like a rectangle selection in those cases

So for now this idea is going to not happen as it is not worth the effect, while a cool idea on most maps unless super large weird shapes can be map by selection rooms 1 at a time quicker then weird selection layouts