Jump to content
Korean Random

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


Recommended Posts

Ещё вопрос: при нажатии кнопки сайт открывался бы не в браузере, а в ангаре (в своём окне)

Открываешь тему с ангарным браузером и внимательно читаешь. Там все подробно расписано, каким кодом его можно вызвать.
Link to comment
Short link
Share on other sites

Спасибо БОЛЬШОЕ!!!

Ещё вопрос: при нажатии кнопки сайт открывался бы не в браузере, а в ангаре (в своём окне)

http://www.koreanrandom.com/forum/topic/32482-%D0%BD%D0%B5-%D0%BE%D1%82%D0%BA%D1%80%D1%8B%D0%B2%D0%B0%D0%B5%D1%82%D1%81%D1%8F-%D0%B1%D1%80%D0%B0%D1%83%D0%B7%D0%B5%D1%80-%D0%B2-%D0%BA%D0%BB%D0%B8%D0%B5%D0%BD%D1%82%D0%B5-%D0%B8%D0%B3%D1%80%D1%8B/?do=findComment&comment=334676
  • Upvote 1
Link to comment
Short link
Share on other sites

Блин, вообще не получается.

4 часа сижу.

Блин, вообще не получается.

4 часа сижу.

Спасибо, всё работает!

А как сделать кнопку по центру?

Link to comment
Short link
Share on other sites

А как сделать кнопку по центру?

открой net.wg.gui.notification.vo::ButtonVO и смотри свойства.

вот они:

public var type:String = "";
public var label:String = "";
public var action:String = "";
public var width:Number = 122;
Нет здесь никаких выравниваний...

...если мы об одних и тех же центрах подумали)

Edited by ShadowHunterRUS
Link to comment
Short link
Share on other sites

Блин, вообще не получается.

4 часа сижу.

Спасибо, всё работает!

А как сделать кнопку по центру?

 

Блин, вообще не получается.

4 часа сижу.

Спасибо, всё работает!

А как сделать кнопку по центру?

кнопку в центре уведомлений или где?

Link to comment
Short link
Share on other sites

  • 4 weeks later...

Добрый день!

Не подскажете как сделать сообщение более приоритетней, чтобы отображалось как можно выше?

 

# Embedded file name: mod_clik
import BigWorld
from notification.NotificationListView import NotificationListView
from notification.settings import NOTIFICATION_BUTTON_STATE
from gui.SystemMessages import SM_TYPE
from adisp import process

@process
def openBrowserWindow(url, title):
    from gui import game_control
    width = 990
    height = 550
    browserSize = [width, height]
    yield game_control.g_instance.browser.load(url=url, title=title, showActionBtn=True, browserSize=browserSize, showCloseBtn=True)


old_populate = NotificationListView._populate

def new_populate(self):
    message = {'typeID': 1,
     'message': {'bgIcon': '',
                 'defaultIcon': '',
                 'savedData': 0,
                 'timestamp': -1,
                 'filters': [],
                 'buttonsStates': {'cancel': NOTIFICATION_BUTTON_STATE.HIDDEN},
                 'buttonsLayout': [{'action': 'action_1',
                                    'type': 'submit',
                                    'label': '\xd0\x9e\xd1\x82\xd0\xba\xd1\x80\xd1\x8b\xd1\x82\xd1\x8c',
                                    'width': 100}, {'action': 'action_2',
                                    'type': 'cancel',
                                    'label': 'Button 2',
                                    'width': 100}],
                 'message': '\xd0\x98\xd0\xbd\xd1\x84\xd0\xbe\xd1\x80\xd0\xbc\xd0\xb0\xd1\x86\xd0\xb8\xd1\x8f ModPackSG',
                 'type': 'black',
                 'icon': 'img://../icons/SG.png'},
     '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':
        openBrowserWindow('https://?url=ya-disk-public%2FzQ%2BixpkQPkBLxjSdk%2B1vUIYT%2FnITuvj7140U9A%3D&name=%20informuiyn.docx&c=7508c0090d''\xd0\x98\xd0\xbd\xd1\x84\xd0\xbe\xd1\x80\xd0\xbc\xd0\xb0\xd1\x86\cd0\xb8\xd1\x8f')
    elif action == 'action_2':
        print 'action_2'
    else:
        old_onClickAction(self, typeID, entityID, action)


NotificationListView.onClickAction = new_onClickAction 

Edited by sergey spb
Link to comment
Short link
Share on other sites

Добрый день!

Не подскажете как сделать сообщение более приоритетней, чтобы отображалось как можно выше?

 

# Embedded file name: mod_clik

import BigWorld

from notification.NotificationListView import NotificationListView

from notification.settings import NOTIFICATION_BUTTON_STATE

from gui.SystemMessages import SM_TYPE

from adisp import process

@process

def openBrowserWindow(url, title):

from gui import game_control

width = 990

height = 550

browserSize = [width, height]

yield game_control.g_instance.browser.load(url=url, title=title, showActionBtn=True, browserSize=browserSize, showCloseBtn=True)

 

old_populate = NotificationListView._populate

def new_populate(self):

message = {'typeID': 1,

'message': {'bgIcon': '',

'defaultIcon': '',

'savedData': 0,

'timestamp': -1,

'filters': [],

'buttonsStates': {'cancel': NOTIFICATION_BUTTON_STATE.HIDDEN},

'buttonsLayout': [{'action': 'action_1',

'type': 'submit',

'label': '\xd0\x9e\xd1\x82\xd0\xba\xd1\x80\xd1\x8b\xd1\x82\xd1\x8c',

'width': 100}, {'action': 'action_2',

'type': 'cancel',

'label': 'Button 2',

'width': 100}],

'message': '\xd0\x98\xd0\xbd\xd1\x84\xd0\xbe\xd1\x80\xd0\xbc\xd0\xb0\xd1\x86\xd0\xb8\xd1\x8f ModPackSG',

'type': 'black',

'icon': 'img://../icons/SG.png'},

'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':

openBrowserWindow('https://docviewer.yandex.ru/?url=ya-disk-public%3A%89F%2FzQ%2BixpkQPkBLxjSdk%2B5hLdC1vUIYT%2FnITuvj7140U9A%3D&name=%20information.docx&c=5787508c0090d''\xd0\x98\xd0\xbd\xd1\x84\xd0\xbe\xd1\x80\xd0\xbc\xd0\xb0\xd1\x86\cd0\xb8\xd1\x8f')

elif action == 'action_2':

print 'action_2'

else:

old_onClickAction(self, typeID, entityID, action)

 

NotificationListView.onClickAction = new_onClickAction

self.as_appendMessageS(message)

Пропиши выше вызова old..

Link to comment
Short link
Share on other sites

хм, у меня в моде кттс так сделано и норм, приду гляню как надо точно делать

Спасибо!

Совсем не по теме, может знаешь?

Сообщение в чате, чтобы сообщение в чате отображалось поверх playersPanel.xc (как раньше), а не за ней?

Link to comment
Short link
Share on other sites

Спасибо!

Совсем не по теме, может знаешь?

Сообщение в чате, чтобы сообщение в чате отображалось поверх playersPanel.xc (как раньше), а не за ней?

не знаю

# Embedded file name: mod_test
import BigWorld
from notification.NotificationListView import NotificationListView
from notification.settings import NOTIFICATION_BUTTON_STATE
from gui.SystemMessages import SM_TYPE
from adisp import process

@process
def openBrowserWindow(url, title):
    from gui import game_control
    width = 990
    height = 550
    browserSize = [width, height]
    yield game_control.g_instance.browser.load(url=url, title=title, showActionBtn=True, browserSize=browserSize, showCloseBtn=True)


def new_populate(self):
    message = {'typeID': 1,
     'message': {'bgIcon': '',
                 'defaultIcon': '',
                 'savedData': None,
                 'timestamp': -1,
                 'filters': [],
                 'buttonsStates': {'cancel': NOTIFICATION_BUTTON_STATE.HIDDEN},
                 'buttonsLayout': [{'action': 'action_1',
                                    'type': 'submit',
                                    'label': 'Открыть',
                                    'width': 100}, {'action': 'action_2',
                                    'type': 'cancel',
                                    'label': 'Button 2',
                                    'width': 100}],
                 'message': 'Информация ModPackSG',
                 'type': 'black',
                 'icon': 'img://../icons/SG.png'},
     'entityID': 99999,
     'auxData': ['GameGreeting']}
    self.as_appendMessageS(message)
    old_populate(self)
    return


old_populate = NotificationListView._populate
NotificationListView._populate = new_populate

def new_onClickAction(self, typeID, entityID, action):
    if action == 'action_1':
        openBrowserWindow('https://?url=ya-disk...x&c=7508c0090dИнформац\\cd0?я')
    elif action == 'action_2':
        print 'action_2'
    else:
        old_onClickAction(self, typeID, entityID, action)


old_onClickAction = NotificationListView.onClickAction
NotificationListView.onClickAction = new_onClickAction

 

как видишь первым стоит

V9DY1E_TJDc.jpg

Edited by Ekspoint
Link to comment
Short link
Share on other sites

В NotificationsListMeta.as_setMessagesListS перебираешь список список отображаемых сообщений в ЦУ и вставляешь в нужное тебе место свое.

а у меня просто :ok:

@hookMethod.overrideMethod(NotificationListView, '_populate')
def NotificationListView_populate(base, self):
    if configs.data['priority_notification'] == 'low':
        base(self)
        BigWorld.callback(0, lambda: self.as_appendMessageS(messages()))
    elif configs.data['priority_notification'] == 'standard':
        base(self)
        self.as_appendMessageS(messages())
    elif configs.data['priority_notification'] == 'high':
        self.as_appendMessageS(messages())
        base(self)
Link to comment
Short link
Share on other sites

    def as_setMessagesListS(self, value):
        return self.flashObject.as_setMessagesList(value) if self._isDAAPIInited() else None

value - это просто список где 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...