Skip to content

Commit

Permalink
Add untinted_icon_mask flag to inputs in setup_masked_icon
Browse files Browse the repository at this point in the history
  • Loading branch information
kirazy committed Jun 8, 2020
1 parent 66727e4 commit a17ec7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Version: 0.00.2
Date: 2020.06.XX
Changes:
- Renamed from "Core Library" to "Function Library"
- Added means to disable icon mask tinting in setup_masked_icon
---------------------------------------------------------------------------------------------------
Version: 0.00.1
Date: 2020.06.06
Expand Down
10 changes: 8 additions & 2 deletions prototypes/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function reskins.lib.setup_masked_icon(name, tier, inputs)
-- Optional inputs, used when each entity being fed to this function has unique base or mask images
-- icon_base - Prefix for the icon-base.png file
-- icon_mask - Prefix for the icon-mask.png file
-- untinted_icon_mask - Boolean; determine whether to apply a tint

-- Handle compatibility
local folder_path = inputs.group
Expand All @@ -145,6 +146,11 @@ function reskins.lib.setup_masked_icon(name, tier, inputs)
local base = inputs.icon_base or inputs.icon_name
local mask = inputs.icon_mask or inputs.icon_name

-- Handle mask tinting
local icon_tint = inputs.tint
if inputs.untinted_icon_mask then
icon_tint = nil
end

-- Setup standard icon
inputs.icon = {
Expand All @@ -155,7 +161,7 @@ function reskins.lib.setup_masked_icon(name, tier, inputs)
-- Mask
{
icon = inputs.directory.."/graphics/icons/"..folder_path.."/"..inputs.icon_name.."/"..mask.."-icon-mask.png",
tint = inputs.tint
tint = icon_tint
}
}

Expand All @@ -175,7 +181,7 @@ function reskins.lib.setup_masked_icon(name, tier, inputs)
size = inputs.icon_size,
mipmaps = inputs.icon_mipmaps,
scale = 0.25,
tint = inputs.tint
tint = icon_tint
}
}
}
Expand Down

0 comments on commit a17ec7a

Please sign in to comment.