首页 > 解决方案 > 追溯小问题

问题描述

当我在游戏中使用“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

标签: python

解决方案


我改变了这条线

if self.parentWindow.parentWindow.gameWindow != None: #--line 115

有了这个

if self.sub_parent.parentWindow.parentWindow.gameWindow != None:

非常感谢您的宝贵时间,您是最棒的!!!


推荐阅读