ID:154785
 
I have a separate window popup for inventory. I'm trying to drag from that window to the main window's map. I seem to be having issues due to the popup window being the current focus or perhaps there's something else I'm not thinking of?

Any suggestions or quick snippets that can demonstrate this would be greatly appreciated. =D
Make sure you're using the full ID if you're checking the src_control/over_control arguments. You also need to make sure the maps are drop zones, I think.
In response to Kaiochao
Dang, I knew it was simple. Thanks a ton!
The map is a dropzone. It appears the issue is in the fact that the window that pops up is the focus and not the main window. Here's what I have:




        MouseDrop(over_object=src,src_location,over_location, src_control,over_control,params)

if(!src in contents) return

else

if(src_control == "game_pieces.pieces_grid")

if(over_location == "main.map_pane.map1")

for(var/turf/T in world)

if(over_control == T && !T.density)

world << output(src, T)

else

return

else return
In response to Yusuke13
Yusuke13 wrote:
The map is a dropzone. It appears the issue is in the fact that the window that pops up is the focus and not the main window. Here's what I have:




>
> MouseDrop(over_object=src,src_location,over_location, src_control,over_control,params)
>
> if(!src in contents) return
>
> else
>
> if(src_control == "game_pieces.pieces_grid")
>
> if(over_location == "main.map_pane.map1")
>
> for(var/turf/T in world)
>
> if(over_control == T && !T.density)
>
> world << output(src, T)
>
> else
>
> return
>
> else return
>
>


Debug all of the parameters, but IIRC, over_location will be the turf you're dropping on, over_control should be the control your dropping on, or main.map_pane.map1.
In response to Kalzar
Thanks for the help, but it still isn't working. :(
In response to Yusuke13
I noticed this in the proc's parameters.
over_object=src


Are you intending to drop the object upon itself?

Also are you using the client MouseDrop procedure or the atom MouseDrop procedure. You appear to be using the atom procedure. If so here is an additional issue (it's still an issue if you're using the client one, but I don't think the client one would compile because of attempted access to client.contents

if(!src in contents) return

Since it's an atom procedure all calls to src refer to the atom itself as the source. So this proc reads "if the object is not within itself return" (implicit call to src.contents). Usually this would always be true and thus terminate execution. It should read
if(!src in usr.contents) return

Mouse procs are one of the few usr-safe procs.
In response to BrickSquadron
That helped a lot! Thanks to everyone that replied!