1
0
mirror of https://github.com/pyrollo/display_modpack.git synced 2025-10-15 16:45:35 +02:00

Add luacheck, update translations, replace ABMs, bug fixes (#1)

* luacheck, mt 5 translation, german translation, maintenance

* fix luacheck warnings

* Fix digital clock nodebox and texture

* Fix luacheck usage

* Add comment why fonts are not split into several lines
This commit is contained in:
Niklp
2023-07-24 09:59:26 +02:00
committed by GitHub
parent e0e0305836
commit 1440f35fa6
91 changed files with 415 additions and 1465 deletions

View File

@@ -212,7 +212,7 @@ end
-- @return Texture string
function Font:render(text, texturew, textureh, style)
local style = style or {}
style = style or {}
-- Split text into lines (and limit to style.lines # of lines)
local lines = {}
@@ -243,17 +243,17 @@ function Font:render(text, texturew, textureh, style)
y = y + (self.margintop or 0)
for _, line in pairs(lines) do
for _, l in pairs(lines) do
if style.halign == "left" then
x = 0
elseif style.halign == "right" then
x = texturew - line.width
x = texturew - l.width
else
x = (texturew - line.width) / 2
x = (texturew - l.width) / 2
end
while line.text ~= '' do
codepoint, line.text = self:get_next_char(line.text)
while l.text ~= '' do
codepoint, l.text = self:get_next_char(l.text)
if codepoint == nil then return '' end -- UTF Error
-- Add image only if it is visible (at least partly)