Unlike font and border sizes, the default stats shadow offset is 0 like --osd-shadow-offset, so it can be inherited from it by default to not make users configure it in 2 places. Since 0 and negative numbers are valid offsets, use infinity as the placeholder for unconfigured values.
Unified · Split
| @@ -175,12 +175,12 @@ Configurable Options · 174 unmodified lines | |||
| 175 | Color of the text border. | 175 | Color of the text border. |
| 176 | 176 | ||
| 177 | ``shadow_x_offset`` | 177 | ``shadow_x_offset`` |
| 178 | Default: 0 | 178 | Default: same as ``--osd-shadow-offset`` |
| 179 | 179 | ||
| 180 | The horizontal distance from the text to position the shadow at. | 180 | The horizontal distance from the text to position the shadow at. |
| 181 | 181 | ||
| 182 | ``shadow_y_offset`` | 182 | ``shadow_y_offset`` |
| 183 | Default: 0 | 183 | Default: same as ``--osd-shadow-offset`` |
| 184 | 184 | ||
| 185 | The vertical distance from the text to position the shadow at. | 185 | The vertical distance from the text to position the shadow at. |
| 186 | 186 | ||
| @@ -85,8 +85,6 @@ osd-outline-size=0 · 84 unmodified lines | |||
| 85 | osd-shadow-offset=4 | 85 | osd-shadow-offset=4 |
| 86 | script-opt=console-border_size=0 | 86 | script-opt=console-border_size=0 |
| 87 | script-opt=stats-border_size=0 | 87 | script-opt=stats-border_size=0 |
| 88 | script-opt=stats-shadow_x_offset=4 | ||
| 89 | script-opt=stats-shadow_y_offset=4 | ||
| 90 | 88 | ||
| 91 | [sub-box] | 89 | [sub-box] |
| 92 | sub-border-style=background-box | 90 | sub-border-style=background-box |
| @@ -57,8 +57,8 @@ local o = { · 56 unmodified lines | |||
| 57 | font_color = "", | 57 | font_color = "", |
| 58 | border_size = 1.65, | 58 | border_size = 1.65, |
| 59 | border_color = "", | 59 | border_color = "", |
| 60 | shadow_x_offset = 0.0, | 60 | shadow_x_offset = math.huge, |
| 61 | shadow_y_offset = 0.0, | 61 | shadow_y_offset = math.huge, |
| 62 | shadow_color = "", | 62 | shadow_color = "", |
| 63 | alpha = "11", | 63 | alpha = "11", |
| 64 | vidscale = "auto", | 64 | vidscale = "auto", |
| @@ -184,8 +184,15 @@ local function text_style() · 119 unmodified lines | |||
| 184 | style = style .. "\\4c&H" .. o.shadow_color .. "&\\4a&H" .. o.alpha .. "&" | 184 | style = style .. "\\4c&H" .. o.shadow_color .. "&\\4a&H" .. o.alpha .. "&" |
| 185 | end | 185 | end |
| 186 | 186 | ||
| 187 | return style .. "\\xshad" .. shadow_x_offset .. | 187 | if o.shadow_x_offset < math.huge then |
| 188 | "\\yshad" .. shadow_y_offset .. "}" | 188 | style = style .. "\\xshad" .. shadow_x_offset |
| 189 | end | ||
| 190 | |||
| 191 | if o.shadow_y_offset < math.huge then | ||
| 192 | style = style .. "\\yshad" .. shadow_y_offset | ||
| 193 | end | ||
| 194 | |||
| 195 | return style | ||
| 189 | end | 196 | end |
| 190 | end | 197 | end |
| 191 | 198 | ||