0.7.2: Bugfix: icon_size field not being detected in some cases

This commit is contained in:
Peter 2019-04-15 08:14:47 +08:00
parent 971eae654f
commit a0d780eb90
3 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.7.2
Date: 2019-04-15
Bugfixes:
- Fixed error in dynamically generated shortcuts not finding icon_size in some cases
---------------------------------------------------------------------------------------------------
Version: 0.7.1
Date: 2019-04-14

View File

@ -241,11 +241,21 @@ if settings.startup["autogen"].value == true then
end
if create == true then
local icon
local icon_size = tool.icon_size
local icon_size
if tool.icon then
icon = tool.icon
else
elseif tool.icons then
icon = tool.icons[1].icon
else
icon = "__core__/graphics/shoot.png"
end
if tool.icons and tool.icons[1].icon_size then
icon_size = tool.icons[1].icon_size
elseif tool.icon_size then
icon_size = tool.icon_size
else
icon_size = 32
end
local shortcut = {
type = "shortcut",

View File

@ -1,6 +1,6 @@
{
"name": "Shortcuts",
"version": "0.7.1",
"version": "0.7.2",
"factorio_version": "0.17",
"title": "Shortcuts",
"author": "npc_strider(morley376)",