The only thing I would caution is that Lua is not good with Unicode characters when using a function that depends on "position" in a string. Multi-byte Unicode characters will throw it off. Staying with the 256 ASCII / Extended ASCII characters will work fine with this approach.eclectic-tech wrote: ↑October 21st, 2018, 2:37 pm Have you looked at Mordasius's Lua example? It may provide a simple reusable solution.
It is currently April 28th, 2024, 2:31 am
A poll for everyone
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: A poll for everyone
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: A poll for everyone
This looks promising... would you mind explaining what is going on here:eclectic-tech wrote: ↑October 21st, 2018, 2:37 pm Have you looked at Mordasius's Lua example? It may provide a simple reusable solution.
Code: Select all
for n, s in ipairs(StreamsByViewer) do
SKIN:Bang('!SetOption','MeterStream'..n..'','Text',string.format("%-8s %-20s %5d %-6s %-10s",s.stream.Type,s.stream.Owner, s.stream.Viewers,center(s.stream.Races,7),center(s.stream.Rating,10)))
end
Code: Select all
"%-8s %-20s %5d %-6s %-10s"
but didn't understand much...
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: A poll for everyone
Oh wait, so the Celsius degree symbol wont work?jsmorley wrote: ↑October 21st, 2018, 2:41 pm The only thing I would caution is that Lua is not good with Unicode characters when using a function that depends on "position" in a string. Multi-byte Unicode characters will throw it off. Staying with the 256 ASCII / Extended ASCII characters will work fine with this approach.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: A poll for everyone
º or ° should be ok, they are ASCII 176 / 248 and are single byte characters.
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: A poll for everyone
Right... my bad