Closed Septaris closed 7 years ago
I just add the BlockConfig module to the pull request.
The BlockConfig module read the config files and provide an acces to block config just by importing the class. It replaces large parts of hard coded data in blueprintutils.py and allows to be always up to date with the latest starmade IDs/version.
The config reading is done during SMBEdit import (in the init.py file) using the path given in definitions.py
---- Exemple ----
from SMBEdit import BlockConfig
block_id = 1 # it works also with '1' print(BlockConfig[block_id])
{'can_activate': False, 'icon': '3', 'door': 'false', 'name': 'Ship Core', 'tier': None, 'label': 'CORE_ID', 'texture_id': '272, 272, 272, 272, 272, 272', 'slabe': 1.0, 'color': 'grey', 'shape': 'cube', 'max_HP': 250, 'block_id': '1'}
Thanks a lot! I will look at it as soon as I find out how to merge it with a local branch without messing with the github branches.
You are welcome. If you need some help to reformat other branches (or for something else), just tell me. (You know you can use tags instead of branch for versions ?)
Nope, never noticed the 'tag' thing. I will read up on it. If that works I could reduce branches to master and develop, nice!
Unless an other feature distract me, the next important thing will be unit tests. Have been neglecting those far to long. Do you know of a way to use them properly with branches? I would like to have like a unit test branch with all tests in there, but I do not want those test files in the release branches.
Hi p-hofmann, This commit reformat the code using the pep 8 standard. This could make it easier to collaborate on the project. I hope it will help.