Skip to content

Commit

Permalink
Fix certain colour codes being wrapped incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
LBPHacker committed Jul 4, 2021
1 parent 303b8ad commit c740f13
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tptmp/client/side_button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local config = require("tptmp.client.config")
local manager = require("tptmp.client.manager")
local sdl = require("tptmp.client.sdl")

local jacobsmod = tpt.version.jacob1s_mod
local jacobsmod = tpt.version.jacob1s_mod -- * TODO[imm]: this is not how it should be done

local side_button_i = {}
local side_button_m = { __index = side_button_i }
Expand Down
2 changes: 1 addition & 1 deletion tptmp/client/utf8.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ local function encode_multiple(cp, ...)
return table.concat(collect)
end

if tpt.version.jacob1s_mod then
if tpt.version.jacob1s_mod then -- * TODO[imm]: this is not how it should be done
function code_points(str)
local cps = {}
for pos in str:gmatch("().") do
Expand Down
8 changes: 4 additions & 4 deletions tptmp/client/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ end

local close_button_off_x = -12
local close_button_off_y = 3
if tpt.version.jacob1s_mod then
if tpt.version.jacob1s_mod then -- * TODO[imm]: this is not how it should be done
close_button_off_x = -11
close_button_off_y = 4
end
Expand Down Expand Up @@ -826,9 +826,9 @@ function window_i:subtitle_update_()
if gfx.textSize(self.subtitle_text_) > max_width then
self.subtitle_text_ = self.subtitle_text_:sub(1, util.binary_search_implicit(1, #self.subtitle_text_, function(idx)
local str = self.subtitle_text_:sub(1, idx)
str = str:gsub("\15[\194\195].", "\15"):gsub("\15.", "\15")
str = str:gsub("\15[\194\195].", "\15"):gsub("\15.", "\15")
str = str:gsub("\15[\194\195].", "\15"):gsub("\15.", "\15")
str = str:gsub("\15[\194\195].", "\15"):gsub("\15[^\128-\255]", "\15")
str = str:gsub("\15[\194\195].", "\15"):gsub("\15[^\128-\255]", "\15")
str = str:gsub("\15[\194\195].", "\15"):gsub("\15[^\128-\255]", "\15")
str = str:gsub("\15", "")
return gfx.textSize(str .. "...") > max_width
end) - 1) .. "..."
Expand Down

0 comments on commit c740f13

Please sign in to comment.