mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: [JP] Price detection in medal shop (#567)
- Opt: Adjust price_area in medal shop, should contains all price letters and have a little padding now
This commit is contained in:
parent
64f60c9713
commit
723f4929d2
@ -1,4 +1,5 @@
|
||||
from module.base.button import ButtonGrid
|
||||
from module.base.decorator import Config
|
||||
from module.base.decorator import cached_property
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Digit
|
||||
@ -29,13 +30,33 @@ class MedalShop(ShopBase):
|
||||
return shop_grid
|
||||
|
||||
@cached_property
|
||||
@Config.when(SERVER='jp')
|
||||
def shop_medal_items(self):
|
||||
"""
|
||||
Returns:
|
||||
ShopItemGrid:
|
||||
"""
|
||||
# JP has thinner letters, increase threshold to 128
|
||||
price_ocr = Digit([], letter=(255, 223, 57), threshold=128, name='Price_ocr')
|
||||
shop_grid = self.shop_medal_grid
|
||||
shop_medal_items = ShopItemGrid(
|
||||
shop_grid, templates={}, amount_area=(60, 74, 96, 95), price_area=(52, 135, 132, 162))
|
||||
shop_medal_items.load_template_folder('./assets/shop/medal')
|
||||
shop_medal_items.load_cost_template_folder('./assets/shop/cost')
|
||||
shop_medal_items.similarity = 0.88 # Lower the threshold for consistent matches of PR/DRBP
|
||||
shop_medal_items.price_ocr = price_ocr
|
||||
return shop_medal_items
|
||||
|
||||
@cached_property
|
||||
@Config.when(SERVER=None)
|
||||
def shop_medal_items(self):
|
||||
"""
|
||||
Returns:
|
||||
ShopItemGrid:
|
||||
"""
|
||||
shop_grid = self.shop_medal_grid
|
||||
shop_medal_items = ShopItemGrid(shop_grid, templates={}, amount_area=(60, 74, 96, 95))
|
||||
shop_medal_items = ShopItemGrid(
|
||||
shop_grid, templates={}, amount_area=(60, 74, 96, 95), price_area=(52, 134, 132, 162))
|
||||
shop_medal_items.load_template_folder('./assets/shop/medal')
|
||||
shop_medal_items.load_cost_template_folder('./assets/shop/cost')
|
||||
shop_medal_items.similarity = 0.88 # Lower the threshold for consistent matches of PR/DRBP
|
||||
|
||||
Loading…
Reference in New Issue
Block a user