ID:273980
 
Heyo,
I'm looking to make a Drag n Drop system where players can D&D objs from one grid to another.
There are LOTS of grids I don't want them to be draggable to (but still need to be a drop zone); but the ones I do want them to be draggable to are even more numerous.

So, to prevent players being able to drag an obj to a grid they should not, I currently have this:

obj/typeofobj
MouseDrop()
if(!(src_control in SkillDropList)) return
else //proceed with drag and drop

var/SkillDropList=list("a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid","a grid")
//Over 100 different grids


How would I go about making it so that I can designate 100 or more grids in a line or 2 of code?

Maybe something like
if(winget(~grid has certain css style, such as blue fonts - which is fine because there will be no text~)) profit

That just seems silly though
Counldn't you just use findtext and add something like "_NO_DROP" to the id of grids you want dropping forbidden? IE "grida_NO_DROP","gridb_NOD_DROP",etc.
In response to Jmurph (#1)
That could be a solution. It's kinda like mine - but definitely better.

It seems more of a work-around than an actual solution though. Not saying it isnt a good solution, just posing the question: Do we need to request a skin control grouping system or some such?

Whereby in the settings for each control you can type a GROUP name. Then in things like mousedrop(), add a paramater like over_skingroup and src_skingroup

if(src_overskingroup=="Group01") return world<<"NOPE!"
if(src_overskingroup=="inventory") return world<<"YES!"