feat: publish the marketGroups as datafile (#20)

This commit is contained in:
Patric Stout
2023-11-26 21:29:01 +01:00
committed by GitHub
parent 2f87ec486f
commit 7197a649b7
2 changed files with 31 additions and 1 deletions

View File

@@ -86,7 +86,6 @@ def convert_group_ids(path):
groupIDs = yaml.load(fp, Loader=yaml.CSafeLoader)
pb2 = esf_pb2.GroupIDs()
ships = []
for id, entry in groupIDs.items():
pb2.entries[id].name = entry["name"]["en"]
@@ -99,6 +98,26 @@ def convert_group_ids(path):
return ships
def convert_market_groups(path):
print("Converting marketGroups ...")
with open(f"{path}/marketGroups.yaml") as fp:
marketGroupIDs = yaml.load(fp, Loader=yaml.CSafeLoader)
pb2 = esf_pb2.MarketGroups()
for id, entry in marketGroupIDs.items():
pb2.entries[id].name = entry["nameID"]["en"]
if "parentGroupID" in entry:
pb2.entries[id].parentGroupID = entry["parentGroupID"]
with open("dist/sde/marketGroups.pb2", "wb") as fp:
fp.write(pb2.SerializeToString())
return ships
def convert_dogma_attributes(path):
print("Converting dogmaAttributes ...")
@@ -288,6 +307,7 @@ def convert_dogma_effects(path):
convert_group_ids(path)
convert_market_groups(path)
ships = convert_type_ids(path)
convert_type_dogma(path, ships)
convert_dogma_attributes(path)

View File

@@ -48,6 +48,16 @@ message GroupIDs {
map<int32, GroupID> entries = 1;
}
message MarketGroups {
message MarketGroup {
required string name = 1;
optional int32 parentGroupID = 2;
}
map<int32, MarketGroup> entries = 1;
}
message DogmaAttributes {
message DogmaAttribute {
required string name = 1;