Jump to content
Korean Random

вывод сообщения над миникартой


Recommended Posts

народ подскажите тут на сайте искал но чёт не нашел. по типу этого как вывести собственно сообщение?  

mCkHyRx.png

Link to comment
Short link
Share on other sites

@Lom 

import functools
import BigWorld
from gui.Scaleform.framework import WindowLayer
from gui.shared.personality import ServicesLocator
from gui.Scaleform.genConsts.BATTLE_MESSAGES_CONSTS import BATTLE_MESSAGES_CONSTS
from gui.Scaleform.genConsts.BATTLE_VIEW_ALIASES import BATTLE_VIEW_ALIASES
from gui.Scaleform.daapi.view.battle.shared.messages.fading_messages import _COLOR_TO_METHOD

# Usage:
# color=BATTLE_MESSAGES_CONSTS, possible values:
# COLOR_YELLOW = 'yellow'
# COLOR_RED = 'red'
# COLOR_PURPLE = 'purple'
# COLOR_GREEN = 'green'
# COLOR_GOLD = 'gold'
# COLOR_SELF = 'self'
# panel=BATTLE_VIEW_ALIASES, possible values:
# VEHICLE_MESSAGES = 'battleVehicleMessages' (above consumables panel)
# VEHICLE_ERROR_MESSAGES = 'battleVehicleErrorMessages' (near crosshair)
# PLAYER_MESSAGES = 'battlePlayerMessages' (above minimap)
# sendFadingMessage('Hello from playerMessages!', color=BATTLE_MESSAGES_CONSTS.COLOR_PURPLE)
# sendFadingMessage('Hello from vehicleErrorMessages!', color=BATTLE_MESSAGES_CONSTS.COLOR_YELLOW, panel=BATTLE_VIEW_ALIASES.VEHICLE_ERROR_MESSAGES)
def sendFadingMessage(text, color=BATTLE_MESSAGES_CONSTS.COLOR_GREEN, panel=BATTLE_VIEW_ALIASES.PLAYER_MESSAGES):
    app = ServicesLocator.appLoader.getDefBattleApp()
    battlePage = app.containerManager.getContainer(WindowLayer.VIEW).getView()
    if battlePage is not None:
        viewComponent = battlePage.components.get(panel)
        method = getattr(viewComponent, _COLOR_TO_METHOD.get(color, 'as_showGreenMessageS'), None)
        if method is not None:
            method(None, text)
            return
    BigWorld.callback(0.0, functools.partial(sendFadingMessage, text, color, panel))

 

Edited by Kurzdor
  • Upvote 1
Link to comment
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...