From f4cd610162fc2d6d2cf9aa90ee62d7df1606b98a Mon Sep 17 00:00:00 2001 From: Brevven Date: Fri, 21 Mar 2025 22:28:40 -0700 Subject: [PATCH] sound and CE2 --- changelog.txt | 7 ++++++ compatibility/crafting-efficiency.lua | 35 --------------------------- data-updates.lua | 1 - data-util.lua | 23 +++++++++++++----- info.json | 2 +- lead-ore.lua | 7 ++++-- lead-recipe.lua | 7 ++++++ 7 files changed, 37 insertions(+), 45 deletions(-) delete mode 100644 compatibility/crafting-efficiency.lua diff --git a/changelog.txt b/changelog.txt index ae65107..db14262 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.22 +Date: 2025-03-22 + Changes: + - Set custom inventory sounds for some items + Fixes: + - Loads with Crafting Efficiency +--------------------------------------------------------------------------------------------------- Version: 2.0.21 Date: 2025-03-10 Fixes: diff --git a/compatibility/crafting-efficiency.lua b/compatibility/crafting-efficiency.lua deleted file mode 100644 index db49c7d..0000000 --- a/compatibility/crafting-efficiency.lua +++ /dev/null @@ -1,35 +0,0 @@ -local util = require("data-util"); - -if mods["crafting-efficiency-2"] then - - local eff_data = { - } - - for i, recipe in pairs(util.me.recipes) do - -- add remaining recipes with direct items to find the icons - if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe]) - and not eff_data[recipe] then - local research_level = 1 - if not data.raw.recipe[recipe].enabled then - for tech, tbl in pairs(data.raw.technology) do - for _, effect in pairs(tbl.effects or {}) do - if effect.type == "unlock-recipe" and effect.recipe == recipe then - research_level = math.min(#tbl.unit.ingredients, 6) - end - end - end - end - eff_data[recipe] = { - max = 15, - icon = util.get_item_or_fluid_icon(recipe), - crafting = { efficiency = 10 }, - research = { level = research_level }, - } - end - end - for recipe, d in pairs(eff_data) do - log("Adding "..recipe.." crafting efficiency") - d.name = recipe:gsub("^%l", string.upper).." efficiency" - CE_Add_Recipe(d, recipe) - end -end diff --git a/data-updates.lua b/data-updates.lua index fb5b698..a5f0501 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -6,7 +6,6 @@ require("map-gen-preset-updates") require("strange-matter") require("compatibility/248k") require("compatibility/sciencecosttweakerm") -require("compatibility/crafting-efficiency") local util = require("data-util") util.redo_recycling() diff --git a/data-util.lua b/data-util.lua index f117088..1cff5c3 100644 --- a/data-util.lua +++ b/data-util.lua @@ -12,6 +12,22 @@ util.get_setting = util.me.get_setting util.titanium_plate = "" util.titanium_processing = "" +local foo = [[ +local item_sounds = require('__base__.prototypes.item_sounds') + + inventory_move_sound = item_sounds.wire_inventory_move, + pick_sound = item_sounds.wire_inventory_pickup, + drop_sound = item_sounds.wire_inventory_move, + + inventory_move_sound = item_sounds.metal_small_inventory_move, + pick_sound = item_sounds.metal_small_inventory_pickup, + drop_sound = item_sounds.metal_small_inventory_move, + + inventory_move_sound = item_sounds.resource_inventory_move, + pick_sound = item_sounds.resource_inventory_pickup, + drop_sound = item_sounds.resource_inventory_move, +]] + util.A = {{"automation-science-pack", 1}} util.AL = {{"automation-science-pack", 1}, {"logistic-science-pack", 1}} util.ALC = {{"automation-science-pack", 1}, {"logistic-science-pack", 1}, {"chemical-science-pack", 1}} @@ -1695,11 +1711,6 @@ function util.remove_prior_unlocks(tech, recipe) end function remove_prior_unlocks(tech, recipe, processed) --- log("depth "..depth) --- if depth > 10000 then --- log("Infinite recursion detected, backing out.") --- return --- end if processed[tech] then print("Already processed ".. tech .. " returning") return @@ -1712,7 +1723,7 @@ function remove_prior_unlocks(tech, recipe, processed) if technology.prerequisites then for i, prerequisite in pairs(technology.prerequisites) do if string.sub(prerequisite, 1, 3) ~= 'ei_' then - log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :| + -- log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :| remove_prior_unlocks(prerequisite, recipe, processed) end end diff --git a/info.json b/info.json index c3f3b20..8ea8e6f 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzlead", - "version": "2.0.21", + "version": "2.0.22", "factorio_version": "2.0", "title": "Lead", "author": "Brevven", diff --git a/lead-ore.lua b/lead-ore.lua index 7168faa..4868082 100644 --- a/lead-ore.lua +++ b/lead-ore.lua @@ -1,6 +1,6 @@ -local resource_autoplace = require('resource-autoplace'); - +local resource_autoplace = require('resource-autoplace') local util = require("__bzlead__.data-util"); +local item_sounds = require('__base__.prototypes.item_sounds') data.raw.planet.nauvis.map_gen_settings.autoplace_controls["lead-ore"] = {} data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["lead-ore"] = {} @@ -81,6 +81,9 @@ data:extend({ order = "t-c-a", stack_size = util.get_stack_size(50), weight = 4.5*kg, + inventory_move_sound = item_sounds.wire_inventory_move, + pick_sound = item_sounds.wire_inventory_pickup, + drop_sound = item_sounds.wire_inventory_move, }, }) diff --git a/lead-recipe.lua b/lead-recipe.lua index 08c41c6..87347f6 100644 --- a/lead-recipe.lua +++ b/lead-recipe.lua @@ -1,6 +1,7 @@ -- Lead smelting local util = require("__bzlead__.data-util"); +local item_sounds = require('__base__.prototypes.item_sounds') if (not mods["pyrawores"] and not mods["bobplates"] and not mods["angelssmelting"] and not mods["IndustrialRevolution"]) then data:extend({ @@ -64,6 +65,9 @@ data:extend({ order = "b[lead-plate]", stack_size = util.get_stack_size(100), weight = 2*kg, + inventory_move_sound = item_sounds.metal_small_inventory_move, + pick_sound = item_sounds.metal_small_inventory_pickup, + drop_sound = item_sounds.metal_small_inventory_move, }, -- mods["TheBigFurnace"] and { -- type = "recipe", @@ -108,6 +112,9 @@ data:extend({ icon_size = 128, order = "a[basic-intermediates]-e[expansion-bolt]", weight = 2*kg, + inventory_move_sound = item_sounds.metal_small_inventory_move, + pick_sound = item_sounds.metal_small_inventory_pickup, + drop_sound = item_sounds.metal_small_inventory_move, }, { type = "recipe",