From 5baf11a3f1bcf1087e113da194a46a79e20e88b9 Mon Sep 17 00:00:00 2001 From: wszqkzqk Date: Wed, 14 Sep 2022 07:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=87=E5=BF=97=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/menubar.py | 8 ++++---- source/constants.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/component/menubar.py b/source/component/menubar.py index 5683de3..4e119a1 100755 --- a/source/component/menubar.py +++ b/source/component/menubar.py @@ -83,7 +83,7 @@ class Card(): def setSelect(self, can_select): self.select = can_select if can_select: - if self.not_recommend: + if self.not_recommend % 2: self.orig_image.set_alpha(128) self.image = pg.Surface((self.rect.w, self.rect.h)) # 黑底 self.image.blit(self.orig_image, (0,0), (0, 0, self.rect.w, self.rect.h)) @@ -307,8 +307,8 @@ class Panel(): c.SOUND_TAPPING_CARD.play() if delete_card.info[c.PLANT_NAME_INDEX] == c.COFFEEBEAN: for i in self.card_list: - if i.info[c.PLANT_NAME_INDEX] in c.CAN_SLEEP_PLANTS: - i.not_recommend = 1 + if i.not_recommend == c.REASON_SLEEP_BUT_COFFEE_BEAN: + i.not_recommend = c.REASON_WILL_SLEEP i.orig_image.set_alpha(128) i.image = pg.Surface((i.rect.w, i.rect.h)) # 黑底 i.image.blit(i.orig_image, (0,0), (0, 0, i.rect.w, i.rect.h)) @@ -325,7 +325,7 @@ class Panel(): if card.info[c.PLANT_NAME_INDEX] == c.COFFEEBEAN: for i in self.card_list: if i.not_recommend == c.REASON_WILL_SLEEP: - i.not_recommend = 0 + i.not_recommend = c.REASON_SLEEP_BUT_COFFEE_BEAN i.image = i.orig_image i.image.set_alpha(255) break diff --git a/source/constants.py b/source/constants.py index b62c79d..e27a7f8 100755 --- a/source/constants.py +++ b/source/constants.py @@ -453,6 +453,7 @@ CAN_SLEEP_PLANTS = { # 选卡不推荐选择理由 REASON_WILL_SLEEP = 1 +REASON_SLEEP_BUT_COFFEE_BEAN = 2 REASON_OTHER = 3 # 植物生命值