Skip to content

Commit

Permalink
Fix that append_tier_labels functions didn't set icon_size/mipmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
kirazy committed Nov 9, 2020
1 parent cec722e commit 250790b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 1.0.8
Date: 2020.11.09
Bugfixes:
- Fixed that functions `append_tier_labels` and `append_tier_labels_to_vanilla_items` did not specify `icon_size` and `icon_mipmaps`
---------------------------------------------------------------------------------------------------
Version: 1.0.7
Date: 2020.11.08
Changes:
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reskins-library",
"version": "1.0.7",
"version": "1.0.8",
"factorio_version": "1.0",
"title": "Artisanal Reskins: Library",
"author": "Kirazy",
Expand Down
20 changes: 15 additions & 5 deletions prototypes/functions/icon-handling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -485,25 +485,28 @@ function reskins.lib.append_tier_labels_to_vanilla_icon(name, tier, inputs)

-- Prevent cross-contamination
local inputs = util.copy(inputs)
local type = inputs.type or "item"

-- Handle required parameters
reskins.lib.parse_inputs(inputs)

-- Fetch the icon; vanilla icons are strictly an icon definition
inputs.icon = {
{
icon = data.raw["item"][name].icon
icon = data.raw[type][name].icon,
icon_size = data.raw[type][name].icon_size,
icon_mipmaps = data.raw[type][name].icon_mipmaps,
}
}

reskins.lib.append_tier_labels(tier, inputs)

inputs.icon_picture = {
{
filename = data.raw["item"][name].icon,
size = 64,
filename = data.raw[type][name].icon,
size = data.raw[type][name].icon_size,
scale = 0.25,
mipmaps = 4
mipmaps = data.raw[type][name].icon_mipmaps,
}
}

Expand All @@ -529,9 +532,16 @@ function reskins.lib.append_tier_labels(tier, inputs)

-- Append the tier labels
local icon_style = settings.startup["reskins-lib-icon-tier-labeling-style"].value
table.insert(inputs.icon, {icon = reskins.lib.directory.."/graphics/icons/tiers/"..icon_style.."/"..tier..".png"})
table.insert(inputs.icon, {
icon = reskins.lib.directory.."/graphics/icons/tiers/"..icon_style.."/"..tier..".png",
icon_size = 64,
icon_mipmaps = 4,
}
)
table.insert(inputs.icon, {
icon = reskins.lib.directory.."/graphics/icons/tiers/"..icon_style.."/"..tier..".png",
icon_size = 64,
icon_mipmaps = 4,
tint = reskins.lib.adjust_alpha(reskins.lib.tint_index["tier-"..tier], 0.75)
})
end
Expand Down

0 comments on commit 250790b

Please sign in to comment.