local AClib = {}
local showlog = false -- Debug log message toggle
local showprint = false -- Debug game print toggle
function AClib.debuglog(msg)
if showlog then log(msg) end
return showlog
end
function AClib.debugprint(msg)
if showprint and game then game.print(msg) end
return showprint
end
function AClib.create_flying_text_linked(surface, position, player)
surface.create_entity{ name = "flying-text", position = position, text = {"description.Schall-AC-flying-text-linked"} }
end
function AClib.create_flying_text_multiple_link_id(surface, position, player)
local player_index = player and player.index
surface.create_entity{ name = "flying-text", position = position, text = {"description.Schall-AC-flying-text-multiple-link-id"}, render_player_index = player_index }
end
function AClib.create_flying_text_link_id(surface, position, link_id, player)
local player_index = player and player.index
local texttype = player.mod_settings["Schall-AC-link-id-flying-text"].value
if texttype == "NONE" then return end
local text
if texttype == "hex" then
text = string.format("%X", link_id)
elseif texttype == "hex-zero-padding" then
text = string.format("%08X", link_id)
elseif texttype == "oct" then
text = string.format("%o", link_id)
else
text = tostring(link_id)
end
local color = {r=1, g=1, b=1}
local denom = 2^11 -- Rough Cubic root of 2^32, the max value of link ID. Not using Quad root as there are only RGB parameters
local x = link_id / denom
x, color.b = math.modf(x)
x = x / denom
x, color.g = math.modf(x)
x = x / denom
x, color.r = math.modf(x)
color.r = color.r * 2 -- Compensate for the last "bit" of R value, to make the text brighter
position.y = position.y - 1
-- Remove old flying text, so not cluttering the screen
for _, v in pairs(surface.find_entities_filtered{ name = "Schall-AC-flying-text-static", position = position, radius = 0.5 }) do
v.destroy()
end
surface.create_entity{ name = "Schall-AC-flying-text-static", position = position, color = color, text = text, render_player_index = player_index }
end
return AClib
icon이랑 small_icon이 지금 sprite 타입으로 되어있으니깐
https://lua-api.factorio.com/latest/prototypes/ShortcutPrototype.html#examples
이거대로
icon
= "__SchallAutolinkedChest__/graphics/icons/link-chests-x32.png",
icon_size = 32
small_icon = "__SchallAutolinkedChest__/graphics/icons/link-chests-x24.png",
small_icon_size = 24
이렇게 바꾸면됨
뭐가 바뀌었는지 잘 모르겠으면
https://lua-api.factorio.com/1.1.110/prototypes/ShortcutPrototype.html
구버전
문서랑 한번 비교해봐
답변 감사합니다 ㄳㄳ
https://gall.dcinside.com/mgallery/board/view/?id=factorio&no=70919&page=1
No
loader found for "flying-text". "flying-text" is not a valid prototype type.
란 오류가 뜨는데 어떻게 해야 할까요?