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

Commit

Permalink
fix dorm bar detection in new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
asd111333 committed May 22, 2020
1 parent 16a1bfb commit 2cfaeb0
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 2cfaeb0

Please sign in to comment.