When running the console in the terminal, style log lines with the same escape sequences as msg.c. mp.input can also specify terminal escape sequences, e.g. a script to select a playlist entry can invert the color of the selection. Also add a missing newline to help's error message.
Showing the changes to player/javascript (1 of 4 files). Show all
Unified · Split
| @@ -675,9 +675,12 @@ mp.input = { · 674 unmodified lines | |||
| 675 | terminate: function () { | 675 | terminate: function () { |
| 676 | mp.commandv("script-message-to", "console", "disable"); | 676 | mp.commandv("script-message-to", "console", "disable"); |
| 677 | }, | 677 | }, |
| 678 | log: function (message, style) { | 678 | log: function (message, style, terminal_style) { |
| 679 | mp.commandv("script-message-to", "console", "log", | 679 | mp.commandv("script-message-to", "console", "log", JSON.stringify({ |
| 680 | JSON.stringify({ text: message, style: style })); | 680 | text: message, |
| 681 | style: style, | ||
| 682 | terminal_style: terminal_style, | ||
| 683 | })); | ||
| 681 | }, | 684 | }, |
| 682 | log_error: function (message) { | 685 | log_error: function (message) { |
| 683 | mp.commandv("script-message-to", "console", "log", | 686 | mp.commandv("script-message-to", "console", "log", |