Project Zomboid

Project Zomboid

Fix Crafting Context Menu Stutter
19 Comments
Inn  [author] 30 Mar @ 4:08am 
@dede - this thead might be useful in terms of managing mod load order.
Inn  [author] 30 Mar @ 3:59am 
@dede love u - I haven't looked at essential crafting, but to test whether this one works with anything, just make sure it's loaded last, as some mods might overwrite the same function and render this one useless otherwise.

@JOBL1N - I haven't tested it in build 42, I've only messed around a little in unstable so far with no mods at all. If you find that it works there as well, or not at all, that'd be good to know. Personally I was waiting for build 42 to mature a bit before looking at modding for it, considering the amount of changes from 41, and the amount still coming out with each patch.
Duckshi 30 Mar @ 12:09am 
does this work with build .42?
dede loves u 29 Nov, 2024 @ 6:51pm 
i have...essential crafting + common sense + essential crafting and common sense compatibility patch + authentic z ... okay, so: ripping clothes. there's always a small freeze. i downloaded this... it says it replaces the authentic z stutter fix... i haven't tried just the other one. but i still get these stutters ;;;;; when i rip clothes it says it'll be doing so from essential crafting. is it possible for this to also fix any stutter issues with that mod..? am i stupid? eee
Inn  [author] 15 Aug, 2024 @ 9:47am 
@Vrk_L and Jold, thanks, I'm glad to hear it's just what you needed, too. :cozybethesda:

@boxchat, it's doable, this method just leaves space for modders to add as many different materials or tools as they want to *any* recipes, because the problem is a general one, just brought to light by adding tons of extra rippable clothing first.

This is all to say, I won't be creating a more targeted fix personally, but I certainly have no objections to you using this mod as a jumping-off point for one of your own if you find it useful as such.

@Tnaz.v I'm not going through those mods for you, as I certainly can't tell you which one is best, because that's a subjective question that depends on what you're trying to accomplish.

I *can* say that this mod replaces the function ISRecipeTooltip.layoutContents and will either cause or have issues with any other mod that does the same, which probably includes mods that serve the same function as this one.
El Grasón 12 Aug, 2024 @ 8:37pm 
One of the best mods of all time, I was wondering why did my context menu made a lot of lag untill I installed this mod alongside Fix Laggy Crafting Menu.

The best mods that should be vanilla!!
Lord Accokstorm 6 Aug, 2024 @ 4:15pm 
I've tried multiple mods like this and this is most likely the best
boxchat 18 Mar, 2024 @ 3:53pm 
This is a smart approach to the issue. I wonder if there is a way to make this behavior apply only for the "rip sheets" option(or "craft sheets"), since that is the one that causes issues 99% of the time.
Inn  [author] 11 Jul, 2023 @ 1:39pm 
Thanks for the support, tinytea!

You hit on my reasoning exactly, if I'm clicking "craft now" I want to know what i'm using "now".

This also makes it easier to add in more recipes for other stuff without them also acquiring the stutter we've seen from high-quantity clothing mods, "Craft Spear" is actually a good potential example, considering all the sharp items you can craft them with in Vanilla already, I can imagine an "I Love Sharp Objects" style of mod raising that number significantly. :D
G-t01l3t. 11 Jul, 2023 @ 1:32pm 
I think I see why you went at the problem this way.

The key difference of your mod from these other fix-'Rip Clothing'/ 'Craft Sheet Ropes'-mods is the "only show materials that the player has available" function.

^This is actually sensible thinking about it because the Crafting UI exists if one requires knowing all possible crafting materials in the recipe.

[Correct me if i'm wrong but since this affects the hover tooltip for all recipes(?), and your mod "does change the vanilla behavior by not showing all the potential recipe materials you don't have", so one probable case where users might experience a "loss of vanilla information" is in the "Crafted Spear" recipe tooltip.
i.e. In vanilla, the "sharpening/ whittling" ingredients (chipped stone, hunting knife etc) would all be listed regardless of availability to you. A newer player or someone unfamiliar with the recipe might benefit from the knowledge of what other tools they could have used.
Cont...
G-t01l3t. 11 Jul, 2023 @ 1:32pm 
...Cont.
i.e. "Hey! I didn't know I could use a Stone Knife to craft a spear".]

This is a non-issue for the 'Rip Clothing' & 'Sheet Ropes' recipes as they are simpler and have less nuance regarding additional helpful information (info re:other tools you can use in X recipe)].

Bearing :fpup:all this:fpup: in mind, the Crafting UI is still available for that knowledge so your solution does actually seem very sensible and enticing because of it's beautiful simplicity.

Thank you for your explanations & information.

:spiffo: MInnd Blown :sta2yes::sj_omg:
kERHUS 11 Jul, 2023 @ 10:36am 
thanks, take my point :P
Inn  [author] 11 Jul, 2023 @ 10:17am 
For those who want to see the code changes, I've uploaded the mod to github [github.com].

My only changes are adding a conditional block around the insert statement, and commenting out the table sort, lines 129-139 altogether, everything else is simply copied over from the vanilla code.
Inn  [author] 11 Jul, 2023 @ 9:46am 
Hey Kerhus, it's a better solution for my sensibilities, but I suspect the one tinytea mentioned is about as close as you can get without removing the list of unavailable recipe items completely.

Limiting the overall list like they have(chunking, basically) feels like a premature optimization for the fix I've implemented, as standing on all 400+ types of clothing would still not require stuffing them all in a temporary table and then sorting them again on top of that, not that I've stood on such a pile yet to test.

I do think this is an overall better solution than the "AutheticZ Stutter Fix", and I say that with full credit to AuthenticZ Lite for highlighting the flaw in the vanilla code by adding a ton of clothing. :D
kERHUS 11 Jul, 2023 @ 8:38am 
it's mean your mod has better solution?
Inn  [author] 11 Jul, 2023 @ 7:31am 
Hey tinytea, the one I looked at was the AuthenticZ Stutter Fix, it looks like the one you linked is probably much more like my solution, but it's neither performant nor sensible ( from my perspective ) to tell the player "you don't have the other 500 potential items" when the crafting action is only available when you actually have items to use, so this one does change the vanilla behavior by not showing all the potential recipe materials you don't have - it *will* behave similarly with enough different items on the ground, saying "...and X more", as I've completely removed the need for the sort operation that was really bogging this algorithm down in the first place.
kERHUS 11 Jul, 2023 @ 5:58am 
there's already been a mod like this, hasn't there?
G-t01l3t. 10 Jul, 2023 @ 4:39pm 
Hey Inn, :spiffo:

Where you aware of this iteration/ attempt to fix the 'Rip Clothing'/ 'Craft Sheet Ropes' lag?

'FixTooltipLag'(2915430406)

I just wanted to let you know about ^ this one just in case you were not aware of it and if it might help/ inform your fix.