Jump to content
Korean Random
Ekspoint

Нажатие клавишь

Recommended Posts

В какой функции можно использовать нажатие клавишь что бы работали только в ангаре?

  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

if (messenger.MessengerEntry.g_instance.gui._GUIDecorator__currentScope == 2):    ...

Я так проверяю, не знаю насколько это правильно но пока нареканий нет.

Edited by Console
  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites
if (messenger.MessengerEntry.g_instance.gui._GUIDecorator__currentScope == 2):    ...
Я так проверяю, не знаю насколько это правильно но пока нареканий нет.

 

и что это?

  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Это проверка находиться ли игрок в ангаре.

old_handleKeyEvent = game.handleKeyEvent
def new_handleKeyEvent(event):
    if gui_instance._GUIDecorator__currentScope == 2:
        ...

    return old_handleKeyEvent(event)
game.handleKeyEvent = new_handleKeyEvent
  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

 

Это проверка находиться ли игрок в ангаре.

old_handleKeyEvent = game.handleKeyEvent
def new_handleKeyEvent(event):
    if gui_instance._GUIDecorator__currentScope == 2:
        ...

    return old_handleKeyEvent(event)
game.handleKeyEvent = new_handleKeyEvent
спс, гляну

А для боя как?

  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

 

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

А вообще самый четкий вариант все сделать так, чтобы экземпляр класса мода создавался при инициализации нужного класса, и убивался при его деструкции.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...