Skip to content

Commit 85183d8

Browse files
committed
Add filedropped and directorydropped callbacks
1 parent a102be5 commit 85183d8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Screen.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ function Screen.new()
4545

4646
function self:focus(dfocus) end
4747

48+
function self:directorydropped(path) end
49+
50+
function self:filedropped(file) end
51+
4852
function self:resize(w, h) end
4953

5054
function self:visible(dvisible) end

ScreenManager.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,22 @@ function ScreenManager.resize(w, h)
161161
end
162162
end
163163

164+
---
165+
-- Callback function triggered when a directory is dragged and dropped onto the window.
166+
-- @param file - The full platform-dependent path to the directory.
167+
--
168+
function ScreenManager.directorydropped(path)
169+
ScreenManager.peek():directorydropped(path);
170+
end
171+
172+
---
173+
-- Callback function triggered when a file is dragged and dropped onto the window.
174+
-- @param file - The unopened File object representing the file that was dropped.
175+
--
176+
function ScreenManager.filedropped(file)
177+
ScreenManager.peek():filedropped(file);
178+
end
179+
164180
---
165181
-- Update all screens on the stack whenever the game window gains or
166182
-- loses focus.

0 commit comments

Comments
 (0)