避免提示的歧义
This commit is contained in:
parent
7e93949f91
commit
f3b602a30e
@ -33,8 +33,8 @@ class State():
|
|||||||
|
|
||||||
# 工具:范围判断函数,用于判断点击
|
# 工具:范围判断函数,用于判断点击
|
||||||
def inArea(self, rect, x, y):
|
def inArea(self, rect, x, y):
|
||||||
if (x >= rect.x and x <= rect.right and
|
if (rect.x <= x <= rect.right and
|
||||||
y >= rect.y and y <= rect.bottom):
|
rect.y <= y <= rect.bottom):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@ -96,8 +96,6 @@ class Control():
|
|||||||
def setupUserData(self):
|
def setupUserData(self):
|
||||||
if not os.path.exists(os.path.dirname(c.USERDATA_PATH)):
|
if not os.path.exists(os.path.dirname(c.USERDATA_PATH)):
|
||||||
os.makedirs(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:
|
with open(c.USERDATA_PATH, "w") as f:
|
||||||
savedata = json.dumps(c.INIT_USERDATA, sort_keys=True, indent=4)
|
savedata = json.dumps(c.INIT_USERDATA, sort_keys=True, indent=4)
|
||||||
f.write(savedata)
|
f.write(savedata)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user