mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: storage hp bar button grid and red color
This commit is contained in:
parent
e9957200e5
commit
e43296ee0e
@ -4,9 +4,6 @@ from module.base.decorator import Config
|
||||
from module.config.utils import to_list
|
||||
from module.logger import logger
|
||||
|
||||
# Color that shows on HP bar.
|
||||
COLOR_HP_GREEN = (156, 235, 57)
|
||||
COLOR_HP_RED = (99, 44, 24)
|
||||
SCOUT_POSITION = [
|
||||
(403, 421),
|
||||
(625, 369),
|
||||
@ -19,6 +16,9 @@ class HPBalancer(ModuleBase):
|
||||
fleet_show_index = 1
|
||||
_hp = {}
|
||||
_hp_has_ship = {}
|
||||
# Color that shows on HP bar.
|
||||
COLOR_HP_GREEN = (156, 235, 57)
|
||||
COLOR_HP_RED = (99, 44, 24)
|
||||
|
||||
@property
|
||||
def hp(self):
|
||||
@ -62,8 +62,8 @@ class HPBalancer(ModuleBase):
|
||||
float: HP.
|
||||
"""
|
||||
data = max(
|
||||
color_bar_percentage(self.device.image, area=area, prev_color=COLOR_HP_RED),
|
||||
color_bar_percentage(self.device.image, area=area, prev_color=COLOR_HP_GREEN)
|
||||
color_bar_percentage(self.device.image, area=area, prev_color=self.COLOR_HP_RED),
|
||||
color_bar_percentage(self.device.image, area=area, prev_color=self.COLOR_HP_GREEN)
|
||||
)
|
||||
return data
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh):
|
||||
return hp_grid
|
||||
|
||||
def _storage_hp_grid(self):
|
||||
return ButtonGrid(origin=(185, 553), delta=(167, 0), button_shape=(99, 4), grid_shape=(6, 1))
|
||||
return ButtonGrid(origin=(185, 553), delta=(166, 0), button_shape=(99, 4), grid_shape=(6, 1))
|
||||
|
||||
def hp_retreat_triggered(self):
|
||||
return False
|
||||
@ -220,12 +220,14 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh):
|
||||
"""
|
||||
Calculate current HP in page STORAGE_CHECK, also detects the wrench (Ship died, need to repair)
|
||||
"""
|
||||
origin = self._hp_grid
|
||||
origin = (self._hp_grid, self.COLOR_HP_RED)
|
||||
self._hp_grid = self._storage_hp_grid
|
||||
self.COLOR_HP_RED = (236, 0, 0)
|
||||
try:
|
||||
self._storage_hp_get()
|
||||
finally:
|
||||
self._hp_grid = origin
|
||||
self._hp_grid = origin[0]
|
||||
self.COLOR_HP_RED = origin[1]
|
||||
return self.hp
|
||||
|
||||
def lv_get(self, after_battle=False):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user