mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-06-03 05:59:51 +08:00
优化:天赋
的数字类型判断
This commit is contained in:
parent
2df9eef519
commit
c11d79e672
@ -664,28 +664,30 @@ async def char_wiki(name, mode='char', level=None):
|
|||||||
labels = ''.join(data['attributes']['labels'])
|
labels = ''.join(data['attributes']['labels'])
|
||||||
parameters_label = re.findall(r'{[a-zA-Z0-9]+:[a-zA-Z0-9]+}', labels)
|
parameters_label = re.findall(r'{[a-zA-Z0-9]+:[a-zA-Z0-9]+}', labels)
|
||||||
|
|
||||||
labels = []
|
labels = {}
|
||||||
for i in parameters_label:
|
for i in parameters_label:
|
||||||
i = i.replace('{', '').replace('}', '').split(':')[-1]
|
value_type = i.replace('{', '').replace('}', '').split(':')[-1]
|
||||||
labels.append(i)
|
value_index = i.replace('{', '').replace('}', '').split(':')[0]
|
||||||
|
labels[value_index] = value_type
|
||||||
for i in data['attributes']['parameters']:
|
|
||||||
for index, j in enumerate(data['attributes']['parameters'][i]):
|
for para in data['attributes']['parameters']:
|
||||||
if add_switch:
|
if para in labels:
|
||||||
parameters.append({})
|
label_str = labels[para]
|
||||||
|
for index, j in enumerate(data['attributes']['parameters'][para]):
|
||||||
|
if add_switch:
|
||||||
|
parameters.append({})
|
||||||
|
|
||||||
label_str = labels[int(i.replace('param', '')) - 1]
|
if label_str == 'F1P':
|
||||||
if label_str == 'F1P':
|
parameters[index].update({para: '%.2f%%' % (j * 100)})
|
||||||
parameters[index].update({i: '%.2f%%' % (j * 100)})
|
if label_str == 'F2P':
|
||||||
if label_str == 'F2P':
|
parameters[index].update({para: '%.1f%%' % (j * 100)})
|
||||||
parameters[index].update({i: '%.1f%%' % (j * 100)})
|
elif label_str == 'F1':
|
||||||
elif label_str == 'F1':
|
parameters[index].update({para: '%.1f' % j})
|
||||||
parameters[index].update({i: '%.1f' % j})
|
elif label_str == 'P':
|
||||||
elif label_str == 'P':
|
parameters[index].update({para: str(round(j * 100)) + '%'})
|
||||||
parameters[index].update({i: str(round(j * 100)) + '%'})
|
elif label_str == 'I':
|
||||||
elif label_str == 'I':
|
parameters[index].update({para: '%.2f' % j})
|
||||||
parameters[index].update({i: '%.2f' % j})
|
add_switch = False
|
||||||
add_switch = False
|
|
||||||
|
|
||||||
for k in data['attributes']['labels']:
|
for k in data['attributes']['labels']:
|
||||||
k = re.sub(r':[a-zA-Z0-9]+}', '}', k)
|
k = re.sub(r':[a-zA-Z0-9]+}', '}', k)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user