Captain-Chaos / WorldPainter

WorldPainter is an interactive graphical map generator for the indie game Minecraft.
http://www.worldpainter.net/
GNU General Public License v3.0
355 stars 58 forks source link

AbstractPlugin should deliver WorldPainterView for construction operations #418

Open IR0NSIGHT opened 3 weeks ago

IR0NSIGHT commented 3 weeks ago

Basically all existing operations (inheriting from abstractoperation) require a WorldPainterView for their constructor. WorldPainterView is hidden inside App, which is a. private field, b. not part of public api

Therefore its impossible for plugins right now to inherit and instantiate operations that are more specialized than AbstractBrushOperation

But i would really like to use RadiusOperation for my plugin.

Right now: public List AbstractPlugins.getOperations() delivers operations.

I suggest instead: public List getOperations(WorldPainterView view)

to allow plugins to use the full range of preexisting operations. AbstractPlugins.getOperations() can be kept or deprecated.

alternatively a App.getView or dimension.getWorldView getter would also do.

IR0NSIGHT commented 3 weeks ago

addition: on first glance it seems impossible to get a clean solution for reverse engineering a radius operation too. App will call setRadius on RadiusOperations. There is no preexisting hook for keyboard/mouseevents as far as i can tell too

so no way to catch a mousewheel event without extra steps.

Captain-Chaos commented 2 weeks ago

I thought I already addressed this in the snapshot version I delivered, but it's been a while so maybe not, or this is something new. I'll take a look.

IR0NSIGHT commented 1 week ago

Yes there was a similar problem: FilteredOperation