While it is possible for me to add support for other mods, it is possible to do it other way around too, and it is just as simple. It comes in 2-3 parts, adding code that is run in data/prototype phase and a locale name for each compressed item. You can look for examples in this mod's code (mods.lua), and you have available code from functions.lua. The 3rd part is either using compressed graphics from this mod or make new one to yours. You can recolor from white version of icon using R,G,B in range 0..1.
Here is an example data.lua, if i were to make quarries compressable (comments are extra):
-- function SimpleCompress_AddTintedItem(_name, _order, _icon, _tint)
-- Valid _icon values are all "graphics\compressed-__icon__.png" files
-- _order is largely irrelevant, use item name to sort items alphabetically.
if simpleCompress then
-- Where do we want the compressed item(s) to show?
-- Same place as quarry itself maybe
simpleCompress.currentSubgroup = data.raw.item["quarry"].subgroup
-- Or in the intermediates? simpleCompress.currentSubgroup = "intermediate-product"
--if simpleCompress.ores then
-- If you had ores, put them here... Unlock with OreTech
--end
if simpleCompress.plates then
-- Lets show these quarries as squeezed red plates...
SimpleCompress_AddTintedItem("quarry", "quarry", "plate", {r=1, g=0, b=0})
SimpleCompress_UnlockPlateTechAndRecipe("quarry") -- Unlock with same item name
end
end
And related locale\en\locale.cfg:
[item-name]
compressed-quarry=Compressed quarries
Now you could also make new image in "graphics\" folder for the compressed item, call it "compressed-quarry.png", and use "quarry" instead of "plate" in the TintedItem function.
And last but not least this mod needs to be added as optional dependency in the info.json.
"dependencies": [ "base >= 0.17", "? SimpleCompress >= 0.17.4"],
functions.lua contents for addon modding:
function SimpleCompress_AddTintedItem(_name, _order, _icon, _tint)
_name can be anything, spaces are not recommended in any name or icon parameters.
_order is about where it shows up in crafting UI compared to other recipes and sorted alphabetically. Use your modname shortened for example.
_icon will use "/graphics/compressed-" .. _icon .. ".png" textures that come with SimpleCompress.
_tint is a color like {r=0.62, g=0.8, b=1}.
function SimpleCompress_AddCustomItem(_name, _order, _icon, _iconsize)
_icon is intended for using full filename path here for texture.
_iconsize size of icon.
function SimpleCompress_AddCustomIcons(_name, _order, _icons)
_icons in this function is a table. A table can have values like "icon", "icon_size" and "tint", wrapped in { } and separated by commas.
function SimpleCompress_AddRecipe(_name, _ingredient)
_name still should use same name as the icon.
_ingredient is internal name of the original unstacked item.
function SimpleCompress_AddSmeltingRecipe(_name, _result)
_result is internal name of the item made by smelting. Amount assumes 1:1 smelting ratio affected by the ratio multiplier in mod settings.
If you want to customize this more, see recipe.lua at "-- Compressed ores" section where compressed-stone smelting is dealt with by altering data.raw. However i don't recommend making smelting recipes for advanced alloys such as bob's mods. You can just uncompress the items first and deal with it normally.
function SimpleCompress_UnlockOreTech(_name)
function SimpleCompress_UnlockOreSmeltingTech(_name)
function SimpleCompress_UnlockPlateTech(_name)
function SimpleCompress_UnlockPlateSmeltingTech(_name)
_name using same name as with icons and recipes for these.
function SimpleCompress_AddProductivity(_recipe)
_recipe using full name such as "smelt-compressed-" .. _name. Primarily smelting recipes uses productivity, compressing and uncompressing in assembler should not as that would lead to infinite item generation. Call this function after the smelting recipe is made.