From f3b602a30e5b577f1e1d3f4baa940e1503128da4 Mon Sep 17 00:00:00 2001 From: wszqkzqk Date: Mon, 8 Aug 2022 10:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E6=8F=90=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E6=AD=A7=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/tool.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/tool.py b/source/tool.py index 221f5f2..cb48806 100755 --- a/source/tool.py +++ b/source/tool.py @@ -33,8 +33,8 @@ class State(): # 工具:范围判断函数,用于判断点击 def inArea(self, rect, x, y): - if (x >= rect.x and x <= rect.right and - y >= rect.y and y <= rect.bottom): + if (rect.x <= x <= rect.right and + rect.y <= y <= rect.bottom): return True else: return False @@ -96,8 +96,6 @@ class Control(): def setupUserData(self): if not os.path.exists(os.path.dirname(c.USERDATA_PATH)): os.makedirs(os.path.dirname(c.USERDATA_PATH)) - else: - logger.warning("已有游戏数据目录但未找到游戏存档文件,请检查存档是否丢失!程序将新建初始存档!\n") with open(c.USERDATA_PATH, "w") as f: savedata = json.dumps(c.INIT_USERDATA, sort_keys=True, indent=4) f.write(savedata)