Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauumm committed Oct 24, 2024
1 parent 4b982e5 commit ed47ea1
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 10 deletions.
8 changes: 6 additions & 2 deletions compat/game21/dynamic_quads.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ end
function quads:set_instance_attribute_array(attribute, attr_format, bindinglocation, values)
if self.instance_meshes[attribute] == nil or #values ~= self.instance_meshes[attribute]:getVertexCount() then
-- give some fake draw mode as love 12 does not like nil as draw mode anymore
self.instance_meshes[attribute] =
love.graphics.newMesh({ { name = attribute, format = attr_format, location = bindinglocation } }, values, "strip", "stream")
self.instance_meshes[attribute] = love.graphics.newMesh(
{ { name = attribute, format = attr_format, location = bindinglocation } },
values,
"strip",
"stream"
)
self.mesh:attachAttribute(attribute, self.instance_meshes[attribute], "perinstance")
else
self.instance_meshes[attribute]:setVertices(values)
Expand Down
8 changes: 6 additions & 2 deletions compat/game21/dynamic_tris.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ end
function tris:set_instance_attribute_array(attribute, attr_type, bindinglocation, values)
if self.instance_meshes[attribute] == nil or #values ~= self.instance_meshes[attribute]:getVertexCount() then
-- give some fake draw mode as love 12 does not like nil as draw mode anymore
self.instance_meshes[attribute] =
love.graphics.newMesh({ { name = attribute, format = attr_type, location = bindinglocation } }, values, "strip", "stream")
self.instance_meshes[attribute] = love.graphics.newMesh(
{ { name = attribute, format = attr_type, location = bindinglocation } },
values,
"strip",
"stream"
)
self.mesh:attachAttribute(attribute, self.instance_meshes[attribute], "perinstance")
else
self.instance_meshes[attribute]:setVertices(values)
Expand Down
2 changes: 1 addition & 1 deletion extlibs/json/jsonc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ local function decode_number()
end
end
statusPos = statusPos + #num
return tonumber(num) or math.huge
return tonumber(num) or math.huge
end

local function decode_number_zero()
Expand Down
4 changes: 2 additions & 2 deletions extlibs/sqlite/defs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ local clib = (function()
end
end
-- assuming android (file does not exist but dlopen succeeds anyway)
-- (Keeping this in the linux block in case this isn't an android only thing)
-- (Keeping this in the linux block in case this isn't an android only thing)
return "libsqlite3.so"
end

Expand All @@ -66,7 +66,7 @@ local clib = (function()
return "lib/libsqlite3.dylib"
end

if os == "Windows" then
if os == "Windows" then
return "lib/libsqlite3.dll"
end
end)()
Expand Down
8 changes: 7 additions & 1 deletion server/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ run_server("0.0.0.0", 50505, function(client)
elseif reason == "timeout" then
timeout_count = timeout_count + 1
if timeout_count > 10000000 then
log("Failed sending packet with type '" .. packet_type .. "' to " .. name .. " due to timeout")
log(
"Failed sending packet with type '"
.. packet_type
.. "' to "
.. name
.. " due to timeout"
)
writing = false
end
else
Expand Down
3 changes: 2 additions & 1 deletion ui/overlay/packs/details.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ local level_list = flex:new({}, { direction = "column", align_items = "stretch"
function details.set_pack(pack)
for i = 1, pack.level_count do
local level = pack.levels[i]
local preview = level_preview:new(pack.game_version, pack.id, level.id, { style = { padding = 4 }, has_pack = false })
local preview =
level_preview:new(pack.game_version, pack.id, level.id, { style = { padding = 4 }, has_pack = false })
level_list.elements[i] = quad:new({
child_element = flex:new({
preview,
Expand Down
3 changes: 2 additions & 1 deletion ui/overlay/packs/download_thread.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ local preview_data = {}
---@return table
function download.get_preview_data(game_version, pack)
preview_data[game_version] = preview_data[game_version] or {}
preview_data[game_version][pack] = preview_data[game_version][pack] or api(("get_pack_preview_data/%d/%s"):format(game_version, pack))
preview_data[game_version][pack] = preview_data[game_version][pack]
or api(("get_pack_preview_data/%d/%s"):format(game_version, pack))
return preview_data[game_version][pack]
end

Expand Down

0 comments on commit ed47ea1

Please sign in to comment.