@@ -70,6 +98,16 @@ const thisGame = getGameInfo(props.game);
{{ profile.username }}
+
+
+ {{
+ AkanameSettings.find((item) => item.id === profile.akaname)?.label
+ }}
+
+
{{ dashCode(profile.extid) }}
diff --git a/src/views/Game/EditView.vue b/src/views/Game/EditView.vue
index 5282217..05e274c 100644
--- a/src/views/Game/EditView.vue
+++ b/src/views/Game/EditView.vue
@@ -13,6 +13,7 @@ import FormCheckRadio from "@/components/FormCheckRadio.vue";
import FormControl from "@/components/FormControl.vue";
import EmblemCardBox from "@/components/Cards/EmblemCardBox.vue";
import QproCardBox from "@/components/Cards/QproCardBox.vue";
+import AkanameCardBox from "@/components/Cards/AkanameCardBox.vue";
import PillTag from "@/components/PillTag.vue";
import { APIGetProfile, APIUpdateProfile } from "@/stores/api/profile";
@@ -275,6 +276,11 @@ async function updateProfile() {
:profile="myProfile"
:version="versionForm.currentVersion"
/>
+
diff --git a/tools/akaname_parser.py b/tools/akaname_parser.py
new file mode 100644
index 0000000..b057cca
--- /dev/null
+++ b/tools/akaname_parser.py
@@ -0,0 +1,52 @@
+import sys
+import os
+import re
+import json
+import xml.etree.ElementTree as ET
+
+args = sys.argv
+if len(args) != 2:
+ print(' \nWrites a resulting JSON file to the same path.')
+ sys.exit()
+
+inFilePath = args[1]
+if not os.path.exists(inFilePath):
+ print(f'The path {inFilePath} does not exist!')
+ sys.exit()
+
+if not inFilePath.endswith('.xml'):
+ print('You must supply an XML file.')
+ sys.exit()
+
+def parseXML(xmlFile: str) -> list[dict]:
+ root = ET.fromstring(xmlFile)
+ parts = []
+ for part in root.findall('part'):
+ partId = part.attrib.get('id', None)
+ if not partId:
+ continue
+
+ wordFormat = part.find('word')
+ if wordFormat.text == None:
+ continue
+
+ parsedData = {}
+ if wordFormat.text.startswith('['):
+ pattern = re.findall(r"\[([a-z]+):([^\]]+)\]", wordFormat.text)
+ parsedData = {key: value.split(',') if ',' in value else value for key, value in pattern}
+ contentMatch = re.search(r"\[c:[^\]]+\](.*?)\[/c\]", wordFormat.text)
+ parsedData['label'] = contentMatch.group(1) if contentMatch else ""
+ else:
+ parsedData['label'] = wordFormat.text
+ parsedData['id'] = int(partId)
+ parts.append(parsedData)
+ return parts
+
+akanameData = []
+with open(inFilePath, 'r', encoding='shift-jis') as inFile:
+ akanameData = parseXML(inFile.read())
+
+with open(inFilePath.replace('.xml', '.json'), 'w', encoding='utf-8') as outFile:
+ outFile.write(json.dumps(akanameData, indent=4))
+
+print(f'Converted {len(akanameData)} akaname parts\nyippie!')
\ No newline at end of file