Recipe: show_products_on_tooltip

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Recipe: show_products_on_tooltip

Post by Mooncat »

Request: a Boolean property in recipe prototype to enforce display of products on tooltip, even if there is only one product.

Currently, recipe products are shown on tooltip only if the recipe has more than one products. For recipes that have only one product, it is not shown, mainly because their recipe icons can already describe the products, as discussed here with klonan: viewtopic.php?f=66&t=33732

By setting main_product to empty string, we can enforce display of products. But it is a hack and it brings another issue: it requires recipe name, icon, subgroup and order to be set explicitly because the recipe can no longer determine based on its product.
So, by adding another Boolean specialized for enforcing display of products, the problem will be solved. And we can even make a mod to let people choose whether products for ALL recipes should always be shown on tooltip. :P

Edit: uploaded the mod so you can see the result: https://mods.factorio.com/mods/Mooncat/ ... e-products :D

Edit 2: simplified the title
Last edited by Mooncat on Tue Oct 11, 2016 6:10 am, edited 1 time in total.
hoho
Filter Inserter
Filter Inserter
Posts: 681
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: Property to enforce showing recipe products on tooltip

Post by hoho »

Mooncat wrote:Request: a Boolean property in recipe prototype to enforce display of products on tooltip, even if there is only one product.
I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.

Also, I'd like if products also had not just picture but also the name of whatever the recipe gives similarly to how we see names and icons of ingredients. With some mods, the icons between different things are relatively similar (Angel's petrochem) and it's not exactly easy to distinguish them.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Property to enforce showing recipe products on tooltip

Post by aubergine18 »

Rather than having names shown next to icons, it would be better if there was just a well formed tooltip on hover.

That way the icons can be shown as a quick reference while taking up little screen space, and if I want more information I just hover the icon to see more elaborate details about it.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Property to enforce showing recipe products on tooltip

Post by Mooncat »

hoho wrote:I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.
I have suggested that for the base game: viewtopic.php?f=66&t=33732
I agree with Klonan. product icons on tooltip is only needed for mod players, because the vanilla recipes can already show their products on icons clearly.

aubergine18 wrote:Rather than having names shown next to icons, it would be better if there was just a well formed tooltip on hover.
That way the icons can be shown as a quick reference while taking up little screen space, and if I want more information I just hover the icon to see more elaborate details about it.
Tooltip on tooltip. hm....
Maybe something like the code hinting tooltip in Eclipse: when it shows up, you can press the hotkey (F2) to focus it, so it won't close when your cursor leaves its area, and hence you can open another tooltip on it. :)
But I think this will be beyond our power and will require the devs to implement it.
hoho
Filter Inserter
Filter Inserter
Posts: 681
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: Property to enforce showing recipe products on tooltip

Post by hoho »

Mooncat wrote:
hoho wrote:I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.
I have suggested that for the base game: viewtopic.php?f=66&t=33732
I agree with Klonan. product icons on tooltip is only needed for mod players, because the vanilla recipes can already show their products on icons clearly.
"Problem" is, I wanted both icons and names of the products be visible in the tooltip. Having it behave consistently would also be nice.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Property to enforce showing recipe products on tooltip

Post by Mooncat »

hoho wrote:
Mooncat wrote:
hoho wrote:I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.
I have suggested that for the base game: viewtopic.php?f=66&t=33732
I agree with Klonan. product icons on tooltip is only needed for mod players, because the vanilla recipes can already show their products on icons clearly.
"Problem" is, I wanted both icons and names of the products be visible in the tooltip. Having it behave consistently would also be nice.
For recipes that have only one product, it would be ok. But for those that have multiple products, I wonder this will make the tooltip being too large, as each product will occupy a new line. :?
hoho
Filter Inserter
Filter Inserter
Posts: 681
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: Property to enforce showing recipe products on tooltip

Post by hoho »

Mooncat wrote:But for those that have multiple products, I wonder this will make the tooltip being too large, as each product will occupy a new line. :?
Most result items I've seen so far has been 4 in some mod. Having that many new lines is not too large in my opinion.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Recipe: show_products_on_tooltip

Post by aubergine18 »

One solution would be to have 2 column tooltip, with recipe etc shown on left side, and results etc shown on right side. Name and description could be shown above columns. Layout would be something like:

. . . . . . . . . name + description
recipeImageresults
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Recipe: show_products_on_tooltip

Post by Mooncat »

Don't forget the total raw. It can really take up space.
totalRaw.png
totalRaw.png (340.93 KiB) Viewed 7794 times
and it is causing lag. :?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14359
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Recipe: show_products_on_tooltip

Post by Rseding91 »

Mooncat wrote:Don't forget the total raw. It can really take up space.
...
and it is causing lag. :?
Could you upload that mod set somewhere? I'd be interested in seeing what might cause that to be "slow".

Also don't forget you're in cheat mode which makes "total raw" show far more than normal due to it thinking the player can craft any recipe so it degrades each item to the base materials.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Recipe: show_products_on_tooltip

Post by Mooncat »

Rseding91 wrote:
Mooncat wrote:Don't forget the total raw. It can really take up space.
...
and it is causing lag. :?
Could you upload that mod set somewhere? I'd be interested in seeing what might cause that to be "slow".

Also don't forget you're in cheat mode which makes "total raw" show far more than normal due to it thinking the player can craft any recipe so it degrades each item to the base materials.
Sure. I will upload it when I get home. I think Yuoki Industries, Angel's mods and Bob's mods are the main cause for that because they bring many new raw materials.

Good catch for cheat mode. I even didn't realize I had turned on it, because it is already part of the daily routine for me. (still updating Creative Mode) :lol:
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Recipe: show_products_on_tooltip

Post by Mooncat »

Here you are: https://drive.google.com/open?id=0B9Y5P ... 1lZSm9BVzg

But it lags only when cheat mode is on. :?

1) Start a game
2) game.player.force.research_all_technologies()
3) game.player.cheat_mode = true
4) open the crafting menu -> Combat
5) hover a MK6 equipments. e.g. Vehicle Fusion Reactor MK6. FPS is dropped slightly.
6) leave the equipment. It hangs for awhile.

Need bug report? :)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14359
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Recipe: show_products_on_tooltip

Post by Rseding91 »

Mooncat wrote:Here you are: https://drive.google.com/open?id=0B9Y5P ... 1lZSm9BVzg

But it lags only when cheat mode is on. :?

1) Start a game
2) game.player.force.research_all_technologies()
3) game.player.cheat_mode = true
4) open the crafting menu -> Combat
5) hover a MK6 equipments. e.g. Vehicle Fusion Reactor MK6. FPS is dropped slightly.
6) leave the equipment. It hangs for awhile.

Need bug report? :)
Nah, there's no bug. Cheat mode makes the recipe system "can craft count" work far harder than normal since it has to decompose every item to base materials instead of the normal furnace/machine recipes.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Recipe: show_products_on_tooltip

Post by Mooncat »

Rseding91 wrote:
Mooncat wrote:Here you are: https://drive.google.com/open?id=0B9Y5P ... 1lZSm9BVzg

But it lags only when cheat mode is on. :?

1) Start a game
2) game.player.force.research_all_technologies()
3) game.player.cheat_mode = true
4) open the crafting menu -> Combat
5) hover a MK6 equipments. e.g. Vehicle Fusion Reactor MK6. FPS is dropped slightly.
6) leave the equipment. It hangs for awhile.

Need bug report? :)
Nah, there's no bug. Cheat mode makes the recipe system "can craft count" work far harder than normal since it has to decompose every item to base materials instead of the normal furnace/machine recipes.
But it feels a little bit weird that the lag occurs not when I hover the recipe, but when I leave it. :? Like it is struggling on recycling the resources used for displaying the tooltip.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14359
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Recipe: show_products_on_tooltip

Post by Rseding91 »

Mooncat wrote:But it feels a little bit weird that the lag occurs not when I hover the recipe, but when I leave it. :? Like it is struggling on recycling the resources used for displaying the tooltip.
Well I like optimizing things so I looked into it anyway. It was a 2 part thing: when you hover you don't move the mouse so it updates the tooltip once every tick (60 times per second). When you move the mouse every time the mouse moves it triggers a refresh of the tooltip to move it and so "moving off" actually causes it to do more work than just hovering as you pass over other recipes.

I also cached the decomposed recipe results in the tooltip so it knows if it needs to find the full decomposed recipe results and skips doing that most of the time.

So, for 0.14.14 it will be much quicker (instant in my testing).
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Recipe: show_products_on_tooltip

Post by Mooncat »

Rseding91 wrote:
Mooncat wrote:But it feels a little bit weird that the lag occurs not when I hover the recipe, but when I leave it. :? Like it is struggling on recycling the resources used for displaying the tooltip.
Well I like optimizing things so I looked into it anyway. It was a 2 part thing: when you hover you don't move the mouse so it updates the tooltip once every tick (60 times per second). When you move the mouse every time the mouse moves it triggers a refresh of the tooltip to move it and so "moving off" actually causes it to do more work than just hovering as you pass over other recipes.

I also cached the decomposed recipe results in the tooltip so it knows if it needs to find the full decomposed recipe results and skips doing that most of the time.

So, for 0.14.14 it will be much quicker (instant in my testing).
Not quite understand about the "moving off" part, but it is good that you fixed the lag. Helpful for testing things in cheat mode. Thanks. :D
Post Reply

Return to “Implemented mod requests”