Ekspoint 2,122 Posted September 16, 2015 В какой функции можно использовать нажатие клавишь что бы работали только в ангаре? 1 1 Quote Share this post Link to post Short link Share on other sites
KoHcoJlb 1 #292430 Posted September 16, 2015 (edited) if (messenger.MessengerEntry.g_instance.gui._GUIDecorator__currentScope == 2): ... Я так проверяю, не знаю насколько это правильно но пока нареканий нет. Edited September 16, 2015 by Console 1 1 Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #292431 Posted September 16, 2015 if (messenger.MessengerEntry.g_instance.gui._GUIDecorator__currentScope == 2): ...Я так проверяю, не знаю насколько это правильно но пока нареканий нет. и что это? 1 1 Quote Share this post Link to post Short link Share on other sites
KoHcoJlb 1 #292446 Posted September 16, 2015 Это проверка находиться ли игрок в ангаре. old_handleKeyEvent = game.handleKeyEvent def new_handleKeyEvent(event): if gui_instance._GUIDecorator__currentScope == 2: ... return old_handleKeyEvent(event) game.handleKeyEvent = new_handleKeyEvent 1 1 Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #292457 Posted September 17, 2015 Это проверка находиться ли игрок в ангаре. old_handleKeyEvent = game.handleKeyEvent def new_handleKeyEvent(event): if gui_instance._GUIDecorator__currentScope == 2: ... return old_handleKeyEvent(event) game.handleKeyEvent = new_handleKeyEvent спс, глянуА для боя как? 1 1 Quote Share this post Link to post Short link Share on other sites
KoHcoJlb 1 #292483 Posted September 17, 2015 Для боя 3 вроде. Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #292484 Posted September 17, 2015 Для боя 3 вроде. я уже нашел, спс Quote Share this post Link to post Short link Share on other sites
GPCracker 2,088 #292858 Posted September 21, 2015 if (messenger.MessengerEntry.g_instance.gui._GUIDecorator__currentScope == 2): ... И зачем такие танцы, еще и с приватными атрибутами? Не проще сделать import BigWorld from Avatar import PlayerAvatar from Account import PlayerAccount if isinstance(BigWorld.player(), PlayerAvatar): #Battle if isinstance(BigWorld.player(), PlayerAccount): #Hangar А вообще самый четкий вариант все сделать так, чтобы экземпляр класса мода создавался при инициализации нужного класса, и убивался при его деструкции. 1 Quote Share this post Link to post Short link Share on other sites