mirror of https://github.com/mpv-player/mpv
lua: remove "lua/" prefix from script names
This affects the return value of mp.script_name, the "client name" (what's returned by mpv_client_name()) and all associated features, as well as the mpv terminal output module prefix when scripts print something. As discussed in #748.
This commit is contained in:
parent
eb9d203946
commit
beaa7c7153
|
@ -203,7 +203,7 @@ The ``mp`` module is preloaded, although it can be loaded manually with
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
y script_message_to lua/fooscript something
|
y script_message_to fooscript something
|
||||||
|
|
||||||
``mp.add_forced_key_binding(...)``
|
``mp.add_forced_key_binding(...)``
|
||||||
This works almost the same as ``mp.add_key_binding``, but registers the
|
This works almost the same as ``mp.add_key_binding``, but registers the
|
||||||
|
@ -305,13 +305,13 @@ The ``mp`` module is preloaded, although it can be loaded manually with
|
||||||
|
|
||||||
``mp.get_script_name()``
|
``mp.get_script_name()``
|
||||||
Return the name of the current script. The name is usually made of the
|
Return the name of the current script. The name is usually made of the
|
||||||
filename of the script, with directory and file extension removed, and
|
filename of the script, with directory and file extension removed. If
|
||||||
prefixed with ``lua/``. If there are several script which would have the
|
there are several script which would have the same name, it's made unique
|
||||||
same name, it's made unique by appending a number.
|
by appending a number.
|
||||||
|
|
||||||
.. admonition:: Example
|
.. admonition:: Example
|
||||||
|
|
||||||
The script ``/path/to/fooscript.lua`` becomes ``lua/fooscript``.
|
The script ``/path/to/fooscript.lua`` becomes ``fooscript``.
|
||||||
|
|
||||||
``mp.osd_message(text [,duration])``
|
``mp.osd_message(text [,duration])``
|
||||||
Show an OSD message on the screen. ``duration`` is in seconds, and is
|
Show an OSD message on the screen. ``duration`` is in seconds, and is
|
||||||
|
|
|
@ -158,7 +158,7 @@ static char *script_name_from_filename(void *talloc_ctx, const char *fname)
|
||||||
!(c >= '0' && c <= '9'))
|
!(c >= '0' && c <= '9'))
|
||||||
name[n] = '_';
|
name[n] = '_';
|
||||||
}
|
}
|
||||||
return talloc_asprintf(talloc_ctx, "lua/%s", name);
|
return talloc_asprintf(talloc_ctx, "%s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int load_file(struct script_ctx *ctx, const char *fname)
|
static int load_file(struct script_ctx *ctx, const char *fname)
|
||||||
|
|
Loading…
Reference in New Issue