Fix background Unity input and shop boundaries; record login failure
This commit is contained in:
@@ -11,7 +11,7 @@ LABELS = {
|
||||
'result':'结果', 'options':'选项', 'choices':'选项', 'veryhigh':'极高',
|
||||
'high':'高', 'shop':'商店', 'specialshop':'特殊商店', 'refresh':'刷新',
|
||||
'enhancegifts':'强化饰品', 'enhancee.g.ogifts':'强化饰品', 'purchase':'购买',
|
||||
'buy':'购买', 'purchased':'已购买', 'currentownedskills':'当前持有技能',
|
||||
'buy':'购买', 'purchased':'已购买', 'currentownedskills':'当前持有技能', 'skillsowned':'当前持有技能',
|
||||
'thunderbranch':'雷枝', '雷击木':'雷枝', 'talismanbundle':'成捆的符咒',
|
||||
'standard-dutybattery':'标准负载电池', 'standarddutybattery':'标准负载电池',
|
||||
'thrill':'快感', 'selecte.g.ogifts':'选择E.G.O饰品',
|
||||
@@ -35,12 +35,25 @@ def normalize(state):
|
||||
if state.get('_lc_labels_normalized'):
|
||||
return state
|
||||
rate_items = []
|
||||
for item in state.get('items') or []:
|
||||
source_items = state.get('items') or []
|
||||
for item in source_items:
|
||||
raw = item['text']
|
||||
compact = re.sub(r'\s+', '', raw).lower().lstrip('×x')
|
||||
compact = compact.replace('e.g.0', 'e.g.o')
|
||||
text = LABELS.get(compact, raw)
|
||||
if compact == 'enhance' and any(re.sub(r'\s+', '', other['text']).lower() == 'gifts'
|
||||
and abs(other['x'] - item['x']) < 80 and 0 < other['y'] - item['y'] < 70
|
||||
for other in source_items):
|
||||
text = '强化饰品'
|
||||
if text == raw:
|
||||
if compact.startswith('aservererrorhasoccurred'):
|
||||
text = '服务器发生错误'
|
||||
elif re.fullmatch(r'retry(?:\d+|[>→»]+)?', compact):
|
||||
text = '重试'
|
||||
elif re.match(r'gain[0-9~〜+\-]+cost', compact):
|
||||
text = '经费 ' + raw
|
||||
elif re.match(r'e\.?g\.?o\.?resource', compact):
|
||||
text = '资源 ' + raw
|
||||
match = re.search(r'select(?:the)?(?:floor)?(\d+)(?:st|nd|rd|th)?floorthemepack', compact)
|
||||
if not match:
|
||||
match = re.search(r'selectfloorthemepack(?:for)?floor(\d+)', compact)
|
||||
@@ -64,8 +77,11 @@ def normalize(state):
|
||||
text = '选择一位罪人'
|
||||
elif re.match(r'who(?:will|should)', compact):
|
||||
text = '应该让谁 ' + raw
|
||||
elif compact.startswith('skillreplacement') or compact.startswith('replaceskill'):
|
||||
elif (compact.startswith('skillreplacement') or compact.startswith('replaceskill')
|
||||
or re.match(r'(?:replace|change).*skil', compact)):
|
||||
text = '技能替换 ' + raw
|
||||
elif 'spend' in compact and 'replac' in compact and 'skil' in compact:
|
||||
text = '是否消耗 技能替换 ' + raw
|
||||
# English OCR sometimes merges several adjacent probability labels.
|
||||
# Keep each explicit Very High span as a separate observed candidate.
|
||||
if item.get('y', 0) > state.get('screen', {}).get('h', 1080) * .8 and 'veryhigh' in compact:
|
||||
|
||||
Reference in New Issue
Block a user