Jump to content
Korean Random

Bigimot

User
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Bigimot

  1. Нашёл где я видел 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
  2.  

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

     

    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
×
×
  • Create New...