Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

fix dorm bar detection in new UI #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions modules/headquarters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,25 @@ def feed_snacks(self):

def get_dorm_bar_color(self, percentage, corner_bar):
if corner_bar:
x_coord = 45 + int(780 * percentage)
x_coord = 40 + int(625 * percentage)
y_coord = 1025
else:
x_coord = 630 + int(880 * percentage)
y_coord = 400
return Utils.get_region_color_average(Region(x_coord, y_coord, 10, 10))

def get_dorm_bar_filled(self, percentage, corner_bar=False):
return not self.get_dorm_bar_empty(percentage, corner_bar)

def get_dorm_bar_empty(self, percentage, corner_bar=False):
low = np.array([0, 0, 0])
high = np.array([255, 20, 128])
low = np.array([0, 0, 220])
high = np.array([255, 255, 255])
col = self.get_dorm_bar_color(percentage, corner_bar)
if np.all((low <= col) & (col <= high)):
return True
else:
return False

def get_dorm_bar_empty(self, percentage, corner_bar=False):
return not self.get_dorm_bar_filled(percentage, corner_bar)

def skill_levelling(self):
"""
This method ensures that the skills currently being levelled continue to do so.
Expand Down