cg2121 / obs-advanced-timer

GNU General Public License v2.0
188 stars 33 forks source link

Formats with %s and %m not implemented. #13

Closed pmudry closed 3 years ago

pmudry commented 3 years ago

The format displayed when %m and %s are not implemented. Here is a working implementation :

if string.match(text, "%%m") then
    local minutes = math.floor(ms / 60000) % 60
    minutes = string.format("%d", minutes)
    text = string.gsub(text, "%%m", minutes)
end

if string.match(text, "%%s") then
    local seconds = math.floor(ms / 1000) % 60
    seconds = string.format("%d", seconds)
    text = string.gsub(text, "%%s", seconds)
end
joeparis commented 3 years ago

Thanks, @pmudry , for posting this fix!

cg2121 commented 3 years ago

Fixed with https://github.com/cg2121/obs-advanced-timer/commit/fc4bf02ee7270d9681e127103b3183262f32932d