|
6 | 6 |
|
7 | 7 | local obs = obslua
|
8 | 8 | local ffi = require("ffi")
|
9 |
| -local VERSION = "1.0" |
| 9 | +local VERSION = "1.0.2" |
10 | 10 | local CROP_FILTER_NAME = "obs-zoom-to-mouse-crop"
|
11 | 11 |
|
12 | 12 | local socket_available, socket = pcall(require, "ljsocket")
|
@@ -1158,7 +1158,8 @@ function log_current_settings()
|
1158 | 1158 | use_socket = use_socket,
|
1159 | 1159 | socket_port = socket_port,
|
1160 | 1160 | socket_poll = socket_poll,
|
1161 |
| - debug_logs = debug_logs |
| 1161 | + debug_logs = debug_logs, |
| 1162 | + version = VERSION |
1162 | 1163 | }
|
1163 | 1164 |
|
1164 | 1165 | log("OBS Version: " .. string.format("%.1f", major) .. "." .. minor)
|
@@ -1195,7 +1196,7 @@ function on_print_help()
|
1195 | 1196 |
|
1196 | 1197 | if socket_available then
|
1197 | 1198 | help = help ..
|
1198 |
| - "Enable remote mouse listener: True to start a UDP socket server that will listen for mouse position messages from a remote client\n" .. |
| 1199 | + "Enable remote mouse listener: True to start a UDP socket server that will listen for mouse position messages from a remote client, see: https://github.com/BlankSourceCode/obs-zoom-to-mouse-remote\n" .. |
1199 | 1200 | "Port: The port number to use for the socket server\n" ..
|
1200 | 1201 | "Poll Delay: The time between updating the mouse position (in milliseconds)\n"
|
1201 | 1202 | end
|
@@ -1323,6 +1324,11 @@ end
|
1323 | 1324 | function script_load(settings)
|
1324 | 1325 | sceneitem_info_orig = nil
|
1325 | 1326 |
|
| 1327 | + -- Workaround for detecting if OBS is already loaded and we were reloaded using "Reload Scripts" |
| 1328 | + local current_scene = obs.obs_frontend_get_current_scene() |
| 1329 | + is_obs_loaded = current_scene ~= nil -- Current scene is nil on first OBS load |
| 1330 | + obs.obs_source_release(current_scene) |
| 1331 | + |
1326 | 1332 | -- Add our hotkey
|
1327 | 1333 | hotkey_zoom_id = obs.obs_hotkey_register_frontend("toggle_zoom_hotkey", "Toggle zoom to mouse",
|
1328 | 1334 | on_toggle_zoom)
|
|
0 commit comments