0.7.1: Bugfix: support for selection-tools with 'icons' instead of 'icon'

Also a setting for the color of autogenerated shortcuts
This commit is contained in:
Peter 2019-04-14 23:25:10 +08:00
parent e8c4ceaa24
commit 971eae654f
8 changed files with 36 additions and 9 deletions

3
.gitignore vendored
View File

@ -4,3 +4,6 @@ mod-list.json
*.dat
*.pdn
*.zip
path-remote-control.png
unit-remote-control.png
/old_assets

View File

@ -1,3 +1,11 @@
---------------------------------------------------------------------------------------------------
Version: 0.7.1
Date: 2019-04-14
Features:
- Add setting to change the color (style property) for all dynamically generated shortcuts
Bugfixes:
- Dynamically generated shortcuts now no longer crash on startup if the selection-tool is composed of icons instead of an icon. (Will not make an attempt to composite the icons together - the shortcut will appear visually different from the tool in this case)
---------------------------------------------------------------------------------------------------
Version: 0.7.0
Date: 2019-04-14

View File

@ -240,6 +240,13 @@ if settings.startup["autogen"].value == true then
end
end
if create == true then
local icon
local icon_size = tool.icon_size
if tool.icon then
icon = tool.icon
else
icon = tool.icons[1].icon
end
local shortcut = {
type = "shortcut",
name = name,
@ -247,28 +254,28 @@ if settings.startup["autogen"].value == true then
action = "create-blueprint-item",
localised_name = {"item-name." .. name},
item_to_create = name,
style = "default",
style = settings.startup["autogen-color"].value,
icon =
{
filename = tool.icon,
filename = icon,
priority = "extra-high-no-scale",
size = tool.icon_size,
size = icon_size,
scale = 1,
flags = {"icon"}
},
small_icon =
{
filename = tool.icon,
filename = icon,
priority = "extra-high-no-scale",
size = tool.icon_size,
size = icon_size,
scale = 1,
flags = {"icon"}
},
disabled_small_icon =
{
filename = tool.icon,
filename = icon,
priority = "extra-high-no-scale",
size = tool.icon_size,
size = icon_size,
scale = 1,
flags = {"icon"}
},

View File

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

View File

@ -89,6 +89,15 @@ data:extend({
allowed_values = {"both", "artillery-wagon", "artillery-turret"},
default_value = "both",
order = "a"
},
{
type = "string-setting",
name = "autogen-color",
localised_name = {"", "Auto-", {"gui-new-game.create"}, " ", {"gui-update.mod"}, " shortcuts ", {"gui-train.color"}},
setting_type = "startup",
allowed_values = {"default", "red", "green", "blue"},
default_value = "default",
order = "a"
},
{
type = "bool-setting",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB