Jump to content
Korean Random
NegaTiV26r

создать сообщение в центре уведомлений

Recommended Posts

 

Все сдела что хотел:

А для чего все это делал:

кладете файл по пути http://www.*****.ru/text.txt . Соклановцы устанавливают себе этот скрипт. Вы в файлике пишите инфу и все ваши соклановцы видят ее.

Тут возник еще один вопрос: как сейчас сделать что бы это сообщение было поверх остальных? как реализовано у Юши когда выходит новая версия сборки.

import BigWorld
import urllib
from gui import SystemMessages
from Account import Account
link = Account.onBecomePlayer
def _First(self):
    link(self)
    txt = urllib.urlopen('http://www.*****.ru/text.txt').read()
    type = SystemMessages.SM_TYPE.Warning
    SystemMessages.pushMessage(txt, type)
    Account.onBecomePlayer = link
Account.onBecomePlayer = _First

 

Можешь захукать NotificationListView.__setNotificationList.

Share this post


Link to post

Short link
Share on other sites
import BigWorld
import urllib
from gui import SystemMessages
from Account import Account
link = Account.onBecomePlayer
def _First(self):
    link(self)
    txt = urllib.urlopen('http://www.*****.ru/text.txt').read()
    type = SystemMessages.SM_TYPE.Warning
    SystemMessages.pushMessage(txt, type)
    Account.onBecomePlayer = link
Account.onBecomePlayer = _First

А как к этому скрипту приделать обновление информации?

К примеру: когда у картошки стримы то появляется сообщение

Share this post


Link to post

Short link
Share on other sites

А как к этому скрипту приделать обновление информации?

К примеру: когда у картошки стримы то появляется сообщение

К сожалению не силен в данном моменте

Share this post


Link to post

Short link
Share on other sites

Спасибо всем за скрипты, но в теме не нашел. Как сделать так, чтобы информация была активной, а не пассивной, то есть при первом входе в игру, вылезало окошко с сообщением, а не находилось в логе. Да и второй вопрос, как изменить иконку перед сообщением?

  • Downvote 1

Share this post


Link to post

Short link
Share on other sites


# SystemMessages.SM_TYPE.типы ниже, в скобках выводимая иконка
# -----
# Error - Ошибка (-)
# Warning - Внимание (!)
# Information - Информация (всплывашка не выводится) (i)
# GameGreeting - Письмо (конверт)
# PowerLevel - Исследовано (исслед?)
# FinancialTransactionWithGold - Финансовая операция (голда)
# FinancialTransactionWithCredits - Финансовая операция (кредиты)
# FortificationStartUp - СтартАп (подарок)
# PurchaseForGold - Куплено (голда)
# PurchaseForCredits - Куплено (кредиты)
# DismantlingForGold - Демонтировано (голда)
# Selling - Продано (всплывашка не выводится) (кредиты)
# Remove - Удаление из Ангара (всплывашка не выводится) (кредиты)
# Repair - Ремонт (всплывашка не выводится) (кредиты)
# CustomizationForGold - Кастомизация (голда)
# CustomizationForCredits - Кастомизация (кредиты)


# -*- coding: utf-8-sig -*-
from gui.SystemMessages import SM_TYPE
from gui.SystemMessages import pushMessage
from gui.Scaleform.daapi.view.lobby.LobbyView import LobbyView
def New_onLobbyPlayer(self):
    global Show
    Old_onLobbyPlayer(self)
    if not Show:
           Show = True
            pushMessage(u'<font color="#D042F3">Ляля</font>', SM_TYPE.GameGreeting)


Show = False
Old_onLobbyPlayer = LobbyView._populate
LobbyView._populate = New_onLobbyPlayer

 

Edited by Dark_Knight_MiX

Share this post


Link to post

Short link
Share on other sites

Здравствуйте, а как сделать всплывающее сообщение с кнопками, если можно?

  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Не то, я про сообщение на подобии о приглошение во взвод.

Смотри внимательнее

 

post-16296-0-89615100-1435600499_thumb.j

from gui.Scaleform.daapi.view.dialogs import SimpleDialogMeta, DIALOG_BUTTON_ID
from gui.shared.utils.key_mapping import getBigworldNameFromKey
from gui import DialogsInterface
from gui import InputHandler

class MyConfirmDialogButtons():
    def getLabels(self):
        return [{'id': DIALOG_BUTTON_ID.SUBMIT,'label': 'Ok','focused': True}, \
        {'id': DIALOG_BUTTON_ID.CLOSE,'label': 'Cancel','focused': False}]

def openTestDialog():
    _message = 'Test Message'
    _title = 'Test Title'
    _buttons = MyConfirmDialogButtons()
    meta = SimpleDialogMeta(message=_message, title=_title, buttons=_buttons)
    DialogsInterface.showDialog(meta, lambda result: onClickAction(result))

def onClickAction(result):
    if result:
        print 'PRESS OK'
    else
        print 'PRESS CANCEL'

def onhandleKeyEvent(event):
    key = getBigworldNameFromKey(event.key)
    if key == 'KEY_F11':
        openTestDialog()
    return None

InputHandler.g_instance.onKeyDown += onhandleKeyEvent

Share this post


Link to post

Short link
Share on other sites

 

Смотри внимательнее

 

post-16296-0-89615100-1435600499_thumb.j

from gui.Scaleform.daapi.view.dialogs import SimpleDialogMeta, DIALOG_BUTTON_ID
from gui.shared.utils.key_mapping import getBigworldNameFromKey
from gui import DialogsInterface
from gui import InputHandler

class MyConfirmDialogButtons():
    def getLabels(self):
        return [{'id': DIALOG_BUTTON_ID.SUBMIT,'label': 'Ok','focused': True}, \
        {'id': DIALOG_BUTTON_ID.CLOSE,'label': 'Cancel','focused': False}]

def openTestDialog():
    _message = 'Test Message'
    _title = 'Test Title'
    _buttons = MyConfirmDialogButtons()
    meta = SimpleDialogMeta(message=_message, title=_title, buttons=_buttons)
    DialogsInterface.showDialog(meta, lambda result: onClickAction(result))

def onClickAction(result):
    if result:
        print 'PRESS OK'
    else
        print 'PRESS CANCEL'

def onhandleKeyEvent(event):
    key = getBigworldNameFromKey(event.key)
    if key == 'KEY_F11':
        openTestDialog()
    return None

InputHandler.g_instance.onKeyDown += onhandleKeyEvent
это я понял

Я про сооющение в центре уведомлений с кнопками (на подобии приглошения во взвод и тд)

  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Нашёл где я видел http://www.koreanrandom.com/forum/topic/25584-как-создать-сообщение-с-кнопками-в-центре-уведо/?p=280614 

На второй странице этого раздела


смотрел, нету

from notification.NotificationListView import NotificationListView

old_populate = NotificationListView._populate

def new_populate(self):
    message = {
        'typeID': 1,
        'message': {
            'bgIcon': '',
            'defaultIcon': '',
            'savedData': 0,
            'timestamp': -1,
            'filters': [],
            'buttonsLayout': [
                {
                    'action': 'action_1',
                    'type': 'submit',
                    'label': 'Button 1'
                },
                {
                    'action': 'action_2',
                    'type': 'submit',
                    'label': 'Button 2'
                }
            ],
            'message': 'Test Message',
            'type': 'black',
            'icon': '',
        },
        'entityID': 99999,
        'auxData': ['GameGreeting']
    }
    old_populate(self)
    self.as_appendMessageS(message)

NotificationListView._populate = new_populate

old_onClickAction = NotificationListView.onClickAction

def new_onClickAction(self, typeID, entityID, action):
    if action == 'action_1':
        print 'action_1'
    elif action == 'action_2':
        print 'action_2'
    else:
        old_onClickAction(self, typeID, entityID, action)

NotificationListView.onClickAction = new_onClickAction

post-16296-0-01552700-1436028945.jpg

Share this post


Link to post

Short link
Share on other sites

Нашёл где я видел http://www.koreanrandom.com/forum/topic/25584-как-создать-сообщение-с-кнопками-в-центре-уведо/?p=280614 

На второй странице этого раздела

from notification.NotificationListView import NotificationListView

old_populate = NotificationListView._populate

def new_populate(self):
    message = {
        'typeID': 1,
        'message': {
            'bgIcon': '',
            'defaultIcon': '',
            'savedData': 0,
            'timestamp': -1,
            'filters': [],
            'buttonsLayout': [
                {
                    'action': 'action_1',
                    'type': 'submit',
                    'label': 'Button 1'
                },
                {
                    'action': 'action_2',
                    'type': 'submit',
                    'label': 'Button 2'
                }
            ],
            'message': 'Test Message',
            'type': 'black',
            'icon': '',
        },
        'entityID': 99999,
        'auxData': ['GameGreeting']
    }
    old_populate(self)
    self.as_appendMessageS(message)

NotificationListView._populate = new_populate

old_onClickAction = NotificationListView.onClickAction

def new_onClickAction(self, typeID, entityID, action):
    if action == 'action_1':
        print 'action_1'
    elif action == 'action_2':
        print 'action_2'
    else:
        old_onClickAction(self, typeID, entityID, action)

NotificationListView.onClickAction = new_onClickAction

post-16296-0-01552700-1436028945.jpg

оно не всплывает!!

  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Подскажите пожалуйста, как вывести сообщения в Клановый чат вместо "SystemMessages"? На форуме не нашел :(

Edited by Arfull

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...