Multi-second? Every time you open the GUI?
Yep, large modpack though.
That is downright unplayable, and I agree needs to be addressed.
Meh, I'm dealing with it, they aren't exactly opened very often (it's not long enough to drop players in MP). ^.^
One issue though is with newly unlocked recipes. I can run an event every time a tech is researched to add the corresponding "-big" recipes to the cache. There are a couple edge cases that are problems though. Suppose a recipe is unlocked through something besides tech research? I think seablock uses this, though my mod can't really work with seablock anyway. Or what if a recipe is unlocked by a script after the tech, similar to what I'd be doing. If my script ran first, it wouldn't be able to see the other newly unlocked recipe and wouldn't include it.
You could still include the check for those, right now the code is:
local function enablebigrecipe(force)
for _, recipe in pairs(force.recipes) do
if string.sub(recipe.name, -4)=="-big"
and inlist(recipe.category, {"big-smelting", "big-recipe", "big-chem", "big-refinery"})
and force.recipes[string.sub(recipe.name,1,-5)]
and force.recipes[string.sub(recipe.name,1,-5)].enabled
and not force.recipes[string.sub(recipe.name,1,-5)].hidden then
recipe.enabled=true
end
end
end
Just replacing it as such (pseudo-fillers):
local function enablebigrecipe(force)
for _, entry in pairs(global.recipe_cache) do
if force.recipes[entry.original_recipe]
and force.recipes[entry.original_recipe].enabled
and not force.recipes[entry.original_recipe].hidden then
force.recipes[entry.big_recipe].enabled=true
end
end
end
And appropriate for the disable. I wouldn't think this would be a big cost considering it's still a restricted iterative set and all access does not require memory allocation so it 'should' still be fast (no string work and no iteration of entire recipe set saves the big costs).
(Assuming the recipe cache is a simple table of 2 named entries, but you could make that even faster by making them indexed by integer lookups, or even faster yet by just encoding them as the key/value directly, like the big recipe name as the key and the small recipe name as the value or vice-versa would be the fastest, adjusting the for loop as necessary to iterate over named table entries efficiently if using that style.)