dynamic assets rebuilt for queen update
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Helper script used to generate
|
||||
# - frontend/src/assets/item_category_map.json
|
||||
# - frontend/src/assets/localization.json
|
||||
# - backend/assets/item_ids.txt
|
||||
# Args: path to directory containing files generated by ao-id-extractor
|
||||
# Usage python scripts/generate_assets.sh ${EXTRACTED}
|
||||
|
||||
|
||||
declare game_data_dir="$1"
|
||||
|
||||
if [[ -z $game_data_dir ]]; then
|
||||
echo "First argument should point to game data dir generated by ao-id-extractor"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
declare items_file="$(find $game_data_dir -type f -name items.xml)"
|
||||
declare localization_file="$(find $game_data_dir -type f -name localization.xml)"
|
||||
|
||||
if [[ -z $items_file ]]; then
|
||||
echo "$game_data_dir does not contains items.xml file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $localization_file ]]; then
|
||||
echo "$localization_file does not contains localization.xml file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Generating frontend/src/assets/item_category_map.json..."
|
||||
python scripts/item_category_map.py $items_file | python -m json.tool > frontend/src/assets/item_category_map.json
|
||||
|
||||
echo "Generating frontend/src/assets/localization.json..."
|
||||
python scripts/localization.py $localization_file | python -m json.tool > frontend/src/assets/localization.json
|
||||
|
||||
echo "Generating backend/assets/item_ids.txt..."
|
||||
python scripts/item_id.py $items_file > backend/assets/item_ids.txt
|
||||
@@ -1,3 +1,7 @@
|
||||
# Helper script used to generate frontend/src/assets/item_category_map.json
|
||||
# Args: items.xml generated by ao-id-extractor
|
||||
# Usage python scripts/item_category_map.py items.xml > frontend/src/assets/item_category_map.json
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
@@ -14,6 +18,9 @@ tree = ET.parse(file)
|
||||
root = tree.getroot()
|
||||
|
||||
for child in root:
|
||||
if not 'uniquename' in child.attrib:
|
||||
continue
|
||||
|
||||
add_item(nd, child.attrib['uniquename'], child.attrib)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# Helper script used to generate backend/assets/item_ids.txt
|
||||
# Args: items.xml generated by ao-id-extractor
|
||||
# Usage python scripts/item_id.py items.xml > backend/assets/item_ids.txt
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
@@ -18,6 +22,9 @@ tree = ET.parse(file)
|
||||
root = tree.getroot()
|
||||
|
||||
for child in root:
|
||||
if not 'uniquename' in child.attrib:
|
||||
continue
|
||||
|
||||
add_item(nd, child.attrib['uniquename'])
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# Helper script used to generate frontend/src/assets/localization.json
|
||||
# Args: localization.xml generated by ao-id-extractor
|
||||
# Usage python scripts/localization.py localization.xml > frontend/src/assets/localization.json
|
||||
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
|
||||
Reference in New Issue
Block a user