AsherGlick / ResourceCalculator

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

Features/42 litematica material list import plugin #44

Closed mmodrow closed 3 years ago

mmodrow commented 3 years ago

This implements #42 by adding a plugin publishing routine to the build.py, that looks for a plugins-directory in each calculator's directory within resource_lists. This will be copied in full to the output directory.

For the time being I do not implement minification, as I don't expect the plugins to be large chunks of code, but rather to be small snippets.

The implemented plugin for the minecraft calculator allows to either load a material list as a file or copy its content to a textarea and generate a link to the calculator with all the items from the list picked with the respective amounts. The material lists are expected to be in the format of the material lists, created by the Minecraft Mod litematica.

mmodrow commented 3 years ago

image Styling is done. build.py improvements are still open.

mmodrow commented 3 years ago

I tried to integrate your suggested changes to the build.py, @AsherGlick, but I cannot test the time-comparison and the command line flags, as I am running on windows within docker and don't build on the local cli.

Also I styled the plugin-site.

FYI: I did not try to prevent listing the plugins directory, as going up only fires up the calculator, diving into the individual plugin's directory opens its index.html and I don't see a downside to users being able to see the installed plugins, especially as it is a hidden option, for now.

AsherGlick commented 3 years ago

Great I will have time to check it out this weekend!