Ekspoint Posted July 3, 2015 Share Posted July 3, 2015 (edited) Как создать сообщение на подобие такого? Edited July 3, 2015 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
SkepticalFox Posted July 4, 2015 Share Posted July 4, 2015 Как создать сообщение на подобие такого? Найди этот текст в res\text\lc_messages Потом поиском по питон-файлам клиента @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted July 4, 2015 Author Share Posted July 4, 2015 Найди этот текст в res\text\lc_messages Потом поиском по питон-файлам клиента попробую @ Quote Link to comment Short link Share on other sites More sharing options...
SkepticalFox Posted July 4, 2015 Share Posted July 4, 2015 (edited) попробую 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 Edited July 4, 2015 by ShadowHunterRUS 4 @ Quote Link to comment Short link Share on other sites More sharing options...
IzeBerg Posted July 5, 2015 Share Posted July 5, 2015 (edited) 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 shot_174.jpg В таком случае другие сообщения поломаются. Или я нуб ничего не понимаю? Edited July 5, 2015 by IzeBerg @ Quote Link to comment Short link Share on other sites More sharing options...
SkepticalFox Posted July 5, 2015 Share Posted July 5, 2015 В таком случае другие сообщения поломаются. Или я нуб ничего не понимаю?Если не совпадут entityID, то ничего не поломается. @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted July 6, 2015 Author Share Posted July 6, 2015 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 это я знаю, мне нужно что бы оно вылезало при входе, а не уже в нем висела @ Quote Link to comment Short link Share on other sites More sharing options...
SV_Kirov Posted July 6, 2015 Share Posted July 6, 2015 import BigWorld from urllib import urlopen from Account import Account from gui import SystemMessages def New_onBecomePlayer(self): global Show Old_onBecomePlayer(self) if not Show: Show = True SystemMessages.pushMessage(urlopen('http://net2ftp.ru/node0/[email protected]/Spam_message.xml').read(), type=SystemMessages.SM_TYPE.GameGreeting) Show = False Old_onBecomePlayer = Account.onBecomePlayer Account.onBecomePlayer = New_onBecomePlayer Переделай под себя @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted July 6, 2015 Author Share Posted July 6, 2015 (edited) import BigWorld from urllib import urlopen from Account import Account from gui import SystemMessages def New_onBecomePlayer(self): global Show Old_onBecomePlayer(self) if not Show: Show = True SystemMessages.pushMessage(urlopen('http://net2ftp.ru/node0/[email protected]/Spam_message.xml').read(), type=SystemMessages.SM_TYPE.GameGreeting) Show = False Old_onBecomePlayer = Account.onBecomePlayer Account.onBecomePlayer = New_onBecomePlayer Переделай под себя я это и скидывал тут просто сообщение, а мне еще кнопки к нему нужны Edited July 6, 2015 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 12, 2015 Share Posted September 12, 2015 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 shot_174.jpg Как поменять размер кнопки и можно ли их двигать? 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted September 12, 2015 Author Share Posted September 12, 2015 Как поменять размер кнопки и можно ли их двигать? 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', 'width': 40 }, { 'action': 'action_2', 'type': 'submit', 'label': 'Button 2', 'width': 100 } ], '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 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 12, 2015 Share Posted September 12, 2015 (edited) А можно ли на заднем плане поставить картинку? Edited September 12, 2015 by DannyGreene @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted September 12, 2015 Author Share Posted September 12, 2015 А можно ли на заднем плане поставить картинку или в bgIcon добавить свою иконку в формате png и размерам больше чем стандартная иконка? да, как в html 'icon': 'img://gui/maps/icons/buttons/remove.png', скрытие кнопки from notification.NotificationListView import NotificationListView from notification.settings import NOTIFICATION_BUTTON_STATE 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': 'Button 1', 'width': 40 }, { 'action': 'action_2', 'type': 'cancel', 'label': 'Button 2', 'width': 100 } ], 'message': 'Test Message', 'type': 'black', 'icon': 'img://gui/maps/icons/buttons/remove.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': print 'action_1' elif action == 'action_2': print 'action_2' else: old_onClickAction(self, typeID, entityID, action) NotificationListView.onClickAction = new_onClickAction 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 12, 2015 Share Posted September 12, 2015 (edited) через Icon не катит он растягивает картинку и делает отступы. Мне надо прижать картинку к правому верхнему углу. Может есть решения? Edited September 12, 2015 by DannyGreene 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted September 12, 2015 Author Share Posted September 12, 2015 (edited) [member=DannyGreene] "<img src='img://gui/maps/icons/tooltip/damage.png' width='24' height='24'" Edited September 12, 2015 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
Vampire_BY Posted September 12, 2015 Share Posted September 12, 2015 (edited) "<img src='img://gui/maps/icons/tooltip/damage.png' width='24' height='24'" Если так делать для icon то так не пишет. А если вставлять в message есть отступы. p.s Проблемам вроде как решена через 'bgIcon': '', нет отступа. Жаль что есть потеря качества Edited September 12, 2015 by DannyGreene @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted September 12, 2015 Author Share Posted September 12, 2015 (edited) Вопрос в первом посту не решен, тема актуальна Edited September 12, 2015 by Dark_Knight_MiX @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted July 21, 2016 Share Posted July 21, 2016 Добрый вечер! Не подскажете, как к кнопке привязать ссылку на сайт? Спасибо!!! @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted July 21, 2016 Author Share Posted July 21, 2016 Добрый вечер! Не подскажете, как к кнопке привязать ссылку на сайт? Спасибо!!! import BigWorld from notification.NotificationListView import NotificationListView from notification.settings import NOTIFICATION_BUTTON_STATE 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': 'HTTP', 'width': 40 }, { 'action': 'action_2', 'type': 'cancel', 'label': 'Button 2', 'width': 100 } ], 'message': 'Test Message', 'type': 'black', 'icon': 'img://gui/maps/icons/buttons/remove.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': BigWorld.wg_openWebBrowser('http://worldoftanks.ru/ru/news/pc-browser/1/last_stand_withdrawal/?page=1') elif action == 'action_2': print 'action_2' else: old_onClickAction(self, typeID, entityID, action) NotificationListView.onClickAction = new_onClickAction 1 @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted July 24, 2016 Share Posted July 24, 2016 (edited) import BigWorld from notification.NotificationListView import NotificationListView from notification.settings import NOTIFICATION_BUTTON_STATE 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': 'HTTP', 'width': 40 }, { 'action': 'action_2', 'type': 'cancel', 'label': 'Button 2', 'width': 100 } ], 'message': 'Test Message', 'type': 'black', 'icon': 'img://gui/maps/icons/buttons/remove.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': BigWorld.wg_openWebBrowser('http://worldoftanks.ru/ru/news/pc-browser/1/last_stand_withdrawal/?page=1') elif action == 'action_2': print 'action_2' else: old_onClickAction(self, typeID, entityID, action) NotificationListView.onClickAction = new_onClickAction Спасибо БОЛЬШОЕ!!! Ещё вопросы: 1.При нажатии кнопки сайт открывался бы не в браузере, а в ангаре (в своём окне). 2.Из #11 не понял как двигать кнопки (надо одну кнопку по центру). Edited July 24, 2016 by sergey spb @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
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.