We now have at least 3 scripting APIs which are trivial wrappers around properties: mp.get_mouse_pos, utils.getcwd, utils.getpid. After some discussion on IRC it was decided that it's easier for us to maintain them as trivial wrappers than to deprecate them and inflict pain on users and script authors, so currently no plan to deprecate.
Showing the changes to player/javascript/defaults.js (1 of 4 files). Show all
Unified · Split
| @@ -663,6 +663,7 @@ mp.get_script_file = function() { return mp.script_file }; · 662 unmodified lines | ||
| 663 | 663 | mp.get_script_directory = function() { return mp.script_path }; |
| 664 | 664 | mp.get_time = function() { return mp.get_time_ms() / 1000 }; |
| 665 | 665 | mp.utils.getcwd = function() { return mp.get_property("working-directory") }; |
| 666 | +mp.utils.getpid = function() { return mp.get_property_number("pid") } | |
| 666 | 667 | mp.get_mouse_pos = function() { return mp.get_property_native("mouse-pos") }; |
| 667 | 668 | mp.dispatch_event = dispatch_event; |
| 668 | 669 | mp.process_timers = process_timers; |