Jump to content

Pin Recipes Mod


ocbMaurice

Recommended Posts

A rather small A20 Harmony mod to pin recipes on the UI.


https://www.nexusmods.com/7daystodie/mods/1850
https://github.com/OCB7D2D/OcbPinRecipes

 

image.thumb.png.5830bc0de257bc3d852fc4bad7b0534b.png

 

image.png.615d7bcade79592d336533032d80a16d.png

 

There is also an alternative and slightly bigger UI (thx @tdrhart:
https://github.com/OCB7D2D/OcbPinRecipesUiTdrHart
Also available as optional download on Nexus.

 

image.png.6a811fc1ddbe8a041c9436ed586d32af.png

 

Pinned recipes are queued until user removes them via "x" icon.
Basic functionality is there, more features might be added.
Has a good chance to be incompatible with other HUD mods!

 

Grab ingredients QOL feature

 

With version 0.6.0 I've added another Quality of Life feature.
Loot containers (e.g. your own storage chests) and vehicle
containers get an additional button next to the "sort container"
button. When you press this "grab ingredient" button, it will try
to load as many items from the container as the pinned recipes
require. For even more convenience, this action is also available
by pressing `G` while the container is open. This key-binding
can be adjusted (or removed) in the XML config if required.

 

image.png.24d5b7fb5da6f5abc9f293f98198d358.png

 

Currently the same button is also shown as a hand above the
pinned recipes. This is mostly to make users aware of this
feature and might be removed in the future. It may also be
helpful if your UI overwrites the item stack controller.

 

Increment Recipe Count (via scroll wheel)

Instead of clicking the plus/minus icons to inc-/decrement
the amount to craft, you can also use your mouse scroll wheel
when hovering over the pinned recipe. Note that this works best
when hovering over the recipe name, as some elements seem
to consume the scroll event (just find the spot where it works).

Pin Recipe Ingredients (via double click)

If one of your pinned recipes needs an ingredient you need to
craft first, you can double click on the ingredient icon/number
and the first valid recipe will be added to your pinned list.
 

All the best and good zombie hunting!

Edited by ocbMaurice (see edit history)
Link to comment
Share on other sites

Much appreciated!

 

I tested the Pin Recipes Mod along with Khaine's food and water mod as well as the 60 backpack inventory slot mod which both append XUi and these limited changes had no negative impact on the Pin Recipes Mod.

 

Pinning the Tutorial list and checking for compatibility with 2 very popular Quality of Life mods.

20220104204322_1.thumb.jpg.01642102771b86d0913560f0428b45c8.jpg

 

Moving to the next pin list in preparation for interactions.

20220104204624_1.thumb.jpg.31022ca5259fd0dfae23ef4c5a01c7fa.jpg

 

And an after thought for the first Horde Night. It is also a nice touch to see the count down on required resources as with the molotov gas requirements.

20220104204758_1.thumb.jpg.d42ac325e6cd0c98098090658e7b5cfd.jpg

 

Link to comment
Share on other sites

Pushed an updated version 0.2.0:

  • Persist pinned recipes over sessions
  • Hide pinned recipes when game pauses
  • Fixed improper recipe name displayed
  • Improved UI look and feel a little
  • Also allow to pin locked recipes
  • Add tooltip for each ingredient
  • Add static global manager class
  • Recreated ULM pin icon from scratch

 

Link to comment
Share on other sites

Do you think it would be a good idea (if it's possible at all) that once you collect all the ingredients, there would be a craft button directly on the pinned recipe panel that you can click to craft that item? I guess it would be hard to implement, since it would have to respect game rules and only allow you to craft the said item if you're currently using that area in game, that is backpack or workstation depending on what is required by the recipe. I mean sure, once you open the workbench or other workstation that recipe is tied to, you may as well click the craft button there, so in that regard there would be no difference, but it would make crafting faster in those situations when the recipe doesn't require workstation. Just an idea.

Link to comment
Share on other sites

I've been thinking about a few advanced features, but most have some certain cons.

 

Auto clear pinned recipes when the pinned item appears in the backpack or toolbelt

 

This may not be so simple, since you may want to craft multiple items?

Not sure though if that logic really makes sense (too many false positives?)

 

Auto craft recipes that can be crafted in the backpack

 

As soon as we have all the recipes, crafting starts automatically.

Also not sure since you may want to craft it in a workbench instead?

 

One solution to most edge-cases could be to add more UI elements.
E.g. a checkbox so let the user decide if he wants a certain action to happen.

Link to comment
Share on other sites

5 hours ago, HYper said:

how do i unpin? ....

X in the top-right corner of the pinned recipe panel.

4 minutes ago, ocbMaurice said:

I've been thinking about a few advanced features, but most have some certain cons.

 

Auto clear pinned recipes when the pinned item appears in the backpack or toolbelt

 

This may not be so simple, since you may want to craft multiple items?

Not sure though if that logic really makes sense (too many false positives?)

 

Auto craft recipes that can be crafted in the backpack

 

As soon as we have all the recipes, crafting starts automatically.

Also not sure since you may want to craft it in a workbench instead?

 

One solution to most edge-cases could be to add more UI elements.
E.g. a checkbox so let the user decide if he wants a certain action to happen.

 

These ideas are really nice actually, but probably beyond the scope of the purpose of what people expect from a simple "Pinned recipe" mod. Perhaps you could create a new mod that would be based on Pinned recipes idea, but take that concept several steps further and create some sort of automated task manager where you could manage crafting in your workstations as well as backpack at once - from a single user interface. In that case all these features would make perfect sense. :)

Link to comment
Share on other sites

I've added one feature I believe makes sense, but I needed to copy a bit
more code than expected, so not 100% sure if it works in all cases.

I added another icon beside the "X", which will only be shown if the item
can be built on the currently open station. The recipe pins now also account
for the build multiplier. Maybe some people care to try it out and give feedback!?

https://github.com/OCB7D2D/OcbPinRecipes/archive/develop.zip

Edited by ocbMaurice (see edit history)
Link to comment
Share on other sites

7 hours ago, ocbMaurice said:

I've been thinking about a few advanced features, but most have some certain cons.

 

Auto clear pinned recipes when the pinned item appears in the backpack or toolbelt

 

This may not be so simple, since you may want to craft multiple items?

Not sure though if that logic really makes sense (too many false positives?)

 

Auto craft recipes that can be crafted in the backpack

 

As soon as we have all the recipes, crafting starts automatically.

Also not sure since you may want to craft it in a workbench instead?

 

One solution to most edge-cases could be to add more UI elements.
E.g. a checkbox so let the user decide if he wants a certain action to happen.

What if the pinned box had an indicator to show you had enough of needed materials to make an item. For example, in photo above arramus has the pipe pistol, pipe shotgun, pipe machine gun and pipe rifle pinned. They mostly take same items so if you had enough to make them all it would indicate that somehow and you would decide which one you wanted to make. Once made you could remove it from your pinned list. After that if you still have enough to make the other 3 it would still say so. Then you just repeat. Make the next one you would want and remove it from your list. Then when it happens you don't have enough to make the rest. the indicators would disappear.

Link to comment
Share on other sites

1 hour ago, ocbMaurice said:

I've added one feature I believe makes sense, but I needed to copy a bit
more code than expected, so not 100% sure if it works in all cases.

I added another icon beside the "X", which will only be shown if the item
can be built on the currently open station. The recipe pins now also account
for the build multiplier. Maybe some people care to try it out and give feedback!?

https://github.com/OCB7D2D/OcbPinRecipes/archive/develop.zip

 

Sure, I will give it a test.

Link to comment
Share on other sites

2 hours ago, ocbMaurice said:

I've added one feature I believe makes sense, but I needed to copy a bit
more code than expected, so not 100% sure if it works in all cases.

I added another icon beside the "X", which will only be shown if the item
can be built on the currently open station. The recipe pins now also account
for the build multiplier. Maybe some people care to try it out and give feedback!?

https://github.com/OCB7D2D/OcbPinRecipes/archive/develop.zip

 

This works, although the quick craft button also un-pins the recipe just like the X button. Is that intentional?

Edited by mr.devolver (see edit history)
Link to comment
Share on other sites

Yes, that is intentional. You can pin also the amount of items you want to create in that version.
Once you open a workstation/campfire/backpack it will show what recipe can be crafted there.
If you click the green icon, the recipe and amount will be queued in the currently open station.
I figured that once you've done that you're done with the pinned recipe...

Link to comment
Share on other sites

Another update (version 0.3.0):

  • Amount of items is now also pinned
  • Added craft & clear recipe button
  • Added increment/decrement buttons
  • Only show action buttons when station is open
  • Refactored data persisting to work on server
  • Old pinned recipes will be lost on upgrade

Tip: Set your UI foreground opacity in video settings to 95%.

Otherwise all foreground items are forced to be fully opaque.

 

image.png.fdc7e222da6c4045d152475a1e7dcabd.png

Edited by ocbMaurice (see edit history)
Link to comment
Share on other sites

1 minute ago, ocbMaurice said:

Glad it worked, optimized it a bit more to get rid of the last lag.
https://github.com/OCB7D2D/OcbPinRecipes/archive/develop.zip
Didn't test it fully yet, need to see if I over optimized some stuff.

Just when I updated to the one from your last link, you posted another LOL. Can't complain though, I can't say no to more FPS! :D Soon you'll optimize it to the point that devs will start copying your code and not the other way around lol

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...