AsherGlick / ResourceCalculator

A Video Game Resource Calculator
https://resourcecalculator.com
GNU General Public License v3.0
56 stars 30 forks source link

Hide [Extra] nodes with a checkbox #111

Open unofficial-fish opened 5 months ago

unofficial-fish commented 5 months ago

Gaze upon this image: Abitlovecraftian I inverted the colors in post, pay that no mind Yes, those are create mod crafts that I quickly and badly added to the minecraft recipe list

In this case, I do not particularly care about extra resources. I'd prefer that those nodes were not there, to make this mess a little easier to comprehend. It would be helpful to have a checkbox that does not show [Extra] nodes, only [Final] nodes.

unofficial-fish commented 5 months ago

To my complete surprise, me randomly messing with code I do not understand worked out great. for (let key in output_requirements) { if (output_requirements[key] > 0) { var tracker_key = key+"extra"; //hehehe /* resource_tracker[tracker_key] = new ResourceEdge( key, "[Extra] " + key, output_requirements[key], ); */ // Store the number of extra values for hover text on the chart generation_totals["[Extra] " + key] = output_requirements[key]; } } I commented out these lines, preventing the [Extra] nodes from being generated. (This is probably a terrible way to accomplish this.) *the code is horribly formatted here and I don't know why, here's a screenshot commented