python - 追溯小问题
问题描述
当我在游戏中使用“swtichbot bonuschanger”时出现该错误
回溯(最近一次通话最后):
OnToggleDown 中的文件“ui.py”,第 1506 行
文件“switchbot.py”,第 115 行,在激活中
AttributeError 'int' 对象没有属性 'gameWindow'
ui.py
def OnToggleDown(self):
if self.eventDown:
self.eventDown() #--Line 1506
开关机器人.py
def Activate(self):
self.sub_parent.resetSwitch()
self.Status_new.SetColor(COLOR_ACTIVE)
self.sub_parent.StatusBar.SetColor(COLOR_ACTIVE)
self.sub_parent.StatusText.SetText("Activ")
self.Starter.SetText("Switcher slot ("+str(self.index+1)+")")
self.sub_parent.boni_active = 1
if self.parentWindow.parentWindow.gameWindow != None: #--line 115
self.sub_parent.blockBar.swib_normal.SetColor(COLOR_ACTIVE)
pass
我如何编辑它们以不再出现此错误?只是一点帮助我是新手:D
解决方案
我改变了这条线
if self.parentWindow.parentWindow.gameWindow != None: #--line 115
有了这个
if self.sub_parent.parentWindow.parentWindow.gameWindow != None:
非常感谢您的宝贵时间,您是最棒的!!!
推荐阅读
- javascript - 如何使按钮在 html 中可拖动?
- html - vs code - 让 html intellisense 在其他文档类型中工作
- php - API Routes 通过 Laravel 中的 web Route 处理
- javascript - 反应改变地图功能中整个元素的状态,而不仅仅是按下的按钮
- apache-kafka - 重新平衡期间的消费者超时
- excel - Excel 2010-2019 - 删除文件菜单项并在 CustomUI 中添加新选项卡
- javascript - 引导复选框值正确传递但未显示在框中
- excel - 有没有办法让 Excel 的 CUBESET 函数采用多个 Sort By 参数?
- python-3.x - 如何使用 API (Python) 从 Google Doc 中获取粗体/斜体文本
- java - setMaxResult(0) 在休眠 5.2.6+ 中返回一个空列表,但在以前的版本中并非如此