mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-08 13:07:33 +08:00
Bugfix: to_map_input_name case issue (#4433)
After bugfixes #4423 logic in the function changed and on the line where CAMPAIGN_ is removed the name is actually in lower case. Moved upper case manupulation in order to ensure correct case. Upper was not removed considering the function should turn d3 into D3. Before this bugfix incrementing to the next stage was unusable (eg. 12-2 would be incremented to a strange "n2") Co-authored-by: LmeSzinc <lmeszincsales@gmail.com>
This commit is contained in:
parent
eb836d1b4f
commit
27b92c9b58
@ -52,13 +52,14 @@ def to_map_input_name(name: str) -> str:
|
||||
campaign_7_2 -> 7-2
|
||||
d3 -> D3
|
||||
"""
|
||||
name = str(name).upper()
|
||||
# Remove whitespaces
|
||||
name = re.sub('[ \t\n]', '', name).lower()
|
||||
# B-1 -> B1
|
||||
res = re.match(r'([a-zA-Z])+[- ]+(\d+)', name)
|
||||
if res:
|
||||
name = f'{res.group(1)}{res.group(2)}'
|
||||
# Change back to upper case for campaign removal
|
||||
name = str(name).upper()
|
||||
# campaign_7_2 -> 7-2
|
||||
name = name.replace('CAMPAIGN_', '').replace('_', '-')
|
||||
return name
|
||||
|
Loading…
Reference in New Issue
Block a user