![]() |
File Dragging, Yay!
This is a scripting question I know but it is a new feature in v5 that I want to know about and I figure the only people with the answers are more likely to look here then the other place.
control.acceptdropfiles = true; Drag a file control.onDropFiles(mousexpos, mouseypos, files) { stuff(); } Yes, yes, yes. BUT! How do you load the lines of that file? I can see how you could use this with clientrc to upload something but loadlines (vars, string, etc.) is limited to only 3 folders (that being scriptfiles, updatepackages and tiledefs). Do I really have to upload the file, then loadlines it serverside and send that clientside all the while being connected via sendtext (clientrc) just so I can look at a file on my computer with Graal? I don't think clientrc should be required for this... I can see the security issues here but maybe you can have something like: control.loaddropfilelines = true; And when it's true: control.onDropFiles(mousexpos, mouseypos, files, lines) { stuff(); } Lines would just be blank when the above is false. (People who want to load vars or other things can just loadvarsfromarray and such) |
Now that you are back Stefan, can you look at this?
|
Right now it can only be used for file uploading (client-rc) and for knowing what filename has been dropped on the Graal window. That can be useful for scripted editors or similar. Scripts currently don't have access to it because of possible security problems (someone might trick the player to drop an important file on the Graal window and then stealing that file). May be reading could be enabled for certain file types though (gani, txt etc.) once the file has been dropped on the Graal window.
|
| All times are GMT +2. The time now is 03:46 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.