ropgapuk Posted September 8, 2016 Share Posted September 8, 2016 Шура, а можно поподробнее, лучше в пример кода из постов выше. Как не пробовал ничего не выходит, висит внизу и всё тут. Заранее благодарю! @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted September 8, 2016 Author Share Posted September 8, 2016 Шура, а можно поподробнее, лучше в пример кода из постов выше. Как не пробовал ничего не выходит, висит внизу и всё тут. Заранее благодарю! def new_as(self, value): old_as_setMessagesListS(self, value) value.insert(0, messages()) old_as_setMessagesListS = NotificationsListMeta.as_setMessagesListS NotificationsListMeta.as_setMessagesListS = new_as @ Quote Link to comment Short link Share on other sites More sharing options...
Jonario Posted September 10, 2016 Share Posted September 10, 2016 (edited) В новом патче 0.9.16 (тестовом клиенте) код из шапки запускается без ошибок. Но и окна в центре уведомлений нет. Edited September 21, 2016 by Jonario @ Quote Link to comment Short link Share on other sites More sharing options...
Jonario Posted September 21, 2016 Share Posted September 21, 2016 @Ekspoint, , @ShuraBB Не подскажите как теперь создать такое сообщение в новом патче 0.9.16 с измененным окном системных сообщений? @ Quote Link to comment Short link Share on other sites More sharing options...
ShuraBB Posted September 21, 2016 Share Posted September 21, 2016 Через NotificationListView.__setNotificationList 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted September 21, 2016 Author Share Posted September 21, 2016 (edited) @Ekspoint, , @ShuraBB Не подскажите как теперь создать такое сообщение в новом патче 0.9.16 с измененным окном системных сообщений? 'так' from notification.NotificationListView import NotificationListView def messages(): return { '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'] } def new_getMessagesList(self): result = old_getMessagesList(self) if self._NotificationListView__currentGroup in 'info': result.append(messages()) return result old_getMessagesList = NotificationListView._NotificationListView__getMessagesList NotificationListView._NotificationListView__getMessagesList = new_getMessagesList 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) old_onClickAction = NotificationListView.onClickAction NotificationListView.onClickAction = new_onClickAction ну это я так сделал :) Edited October 24, 2016 by Ekspoint 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Jonario Posted September 22, 2016 Share Posted September 22, 2016 (edited) ну это я так сделал :) Вот такой конфуз, заменяется и содержимое кнопок других сообщений, причем в другом окне системного канала. 'Скриншот' P.S: В коде "base" клиент лишним посчитал, его я убрал. def new_getMessagesList(base, self) Edited September 22, 2016 by Jonario @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted September 24, 2016 Author Share Posted September 24, 2016 Вот такой конфуз, заменяется и содержимое кнопок других сообщений, причем в другом окне системного канала. 'Скриншот' P.S:В коде "base" клиент лишним посчитал, его я убрал. def new_getMessagesList(base, self) это я забыл убрать :)А в других окнах не должно заменяться @ Quote Link to comment Short link Share on other sites More sharing options...
Jonario Posted September 24, 2016 Share Posted September 24, 2016 А в других окнах не должно заменяться Ну так то по идее по коду то да, но на практике получается что меняется и в другом окне. Можно и самому воспроизвести пока что идет тест и надпись такая у каждого висит в третьем окне (персональные уведомления). @ Quote Link to comment Short link Share on other sites More sharing options...
sergey spb Posted October 9, 2016 Share Posted October 9, 2016 (edited) Добрый день! Может кто поможет, чтобы работало в 0.9.16? В 0.9.15.2 всё работало. # Embedded file name: mod_clikimport BigWorldfrom notification.NotificationListView import NotificationListViewfrom notification.settings import NOTIFICATION_BUTTON_STATEfrom gui.SystemMessages import SM_TYPEfrom adisp import process@processdef openBrowserWindow(url, title):from gui import game_controlwidth = 990height = 550browserSize = [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': 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']}self.as_appendMessageS(message)old_populate(self)old_populate = NotificationListView._populateNotificationListView._populate = new_populatedef new_onClickAction(self, typeID, entityID, action):if action == 'action_1':openBrowserWindow('https://www.google.ru\xd0\x98\xd0\xbd\xd1\x84\xd0\xbe\xd1\x80\xd0\xbc\xd0\xb0\xd1\x86\xd0\xb8\xd1\x8f')elif action == 'action_2':print 'action_2'else:old_onClickAction(self, typeID, entityID, action)old_onClickAction = NotificationListView.onClickActionNotificationListView.onClickAction = new_onClickAction Спасибо! Edited October 9, 2016 by sergey spb @ Quote Link to comment Short link Share on other sites More sharing options...
BeJIuKuu_TaHKoBbIu_BouH Posted October 9, 2016 Share Posted October 9, 2016 (edited) del Edited October 16, 2016 by gad_575__2 @ Quote Link to comment Short link Share on other sites More sharing options...
ShuraBB Posted October 10, 2016 Share Posted October 10, 2016 >как в 0.9.16 к кнопке привязать ссылку Также как и раньше: делать свой action и в обработчике вызвать нужную ссылку 2 @ Quote Link to comment Short link Share on other sites More sharing options...
BeJIuKuu_TaHKoBbIu_BouH Posted October 11, 2016 Share Posted October 11, 2016 (edited) del Edited October 16, 2016 by gad_575__2 4 @ Quote Link to comment Short link Share on other sites More sharing options...
ShuraBB Posted October 11, 2016 Share Posted October 11, 2016 >отвечай нормально, сбрасывая нужный код, как это делают все. А целиком мод за тебя не написать? Примеров кода выше более чем достаточно. Если тебе он не понятен - задавай конкретные вопросы. 3 @ Quote Link to comment Short link Share on other sites More sharing options...
GPCracker Posted October 15, 2016 Share Posted October 15, 2016 (edited) Также как и раньше: делать свой action и в обработчике вызвать нужную ссылкуВ этом плане у меня тоже ничего не менялось. Все работает, как и раньше. сбрасывая нужный код, как это делают все.Ну, во-первых, код уже сброшен, и давно, и он не менялся. Во-вторых, реально, писать за тебя код никто не должен и не подписывался. И все - это понятие растяжимое. Edited October 15, 2016 by GPCracker 1 @ Quote Link to comment Short link Share on other sites More sharing options...
BeJIuKuu_TaHKoBbIu_BouH Posted October 16, 2016 Share Posted October 16, 2016 (edited) del Edited October 16, 2016 by gad_575__2 1 @ Quote Link to comment Short link Share on other sites More sharing options...
Lom Posted December 15, 2016 Share Posted December 15, 2016 не знаю # 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 как видишь первым стоит а именно так же в новом патче как сделать? ))) конечно если это не секрет))) @ Quote Link to comment Short link Share on other sites More sharing options...
Ekspoint Posted December 16, 2016 Author Share Posted December 16, 2016 а именно так же в новом патче как сделать? ))) конечно если это не секрет))) http://www.koreanrandom.com/forum/topic/25584-%D0%BA%D0%B0%D0%BA-%D1%81%D0%BE%D0%B7%D0%B4%D0%B0%D1%82%D1%8C-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5-%D1%81-%D0%BA%D0%BD%D0%BE%D0%BF%D0%BA%D0%B0%D0%BC%D0%B8-%D0%B2-%D1%86%D0%B5%D0%BD%D1%82%D1%80%D0%B5-%D1%83%D0%B2%D0%B5%D0%B4%D0%BE/page-3?do=findComment&comment=354448 @ Quote Link to comment Short link Share on other sites More sharing options...
Lom Posted December 16, 2016 Share Posted December 16, 2016 (edited) http://www.koreanrandom.com/forum/topic/25584-%D0%BA%D0%B0%D0%BA-%D1%81%D0%BE%D0%B7%D0%B4%D0%B0%D1%82%D1%8C-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5-%D1%81-%D0%BA%D0%BD%D0%BE%D0%BF%D0%BA%D0%B0%D0%BC%D0%B8-%D0%B2-%D1%86%D0%B5%D0%BD%D1%82%D1%80%D0%B5-%D1%83%D0%B2%D0%B5%D0%B4%D0%BE/page-3?do=findComment&comment=354448 такой я сделал чтобы просто две кнопочки были)) я имел ввиду именно такой пример какой у тебя там на скринах. чтобы при нажатии на сайт перебрасывало))) всё! догнал как надо было сделать))) Edited December 16, 2016 by ЛОМ @ Quote Link to comment Short link Share on other sites More sharing options...
Lom Posted December 16, 2016 Share Posted December 16, 2016 (edited) подскажите пожалуйста ,вот сделал, в ангаре кнопки есть. но почему на сайт не выкидывает когда нажимаю на кнопку куда вписан сайт? или такое уже не возможно сделать как раньше ? в питоне ошибок нет пока не нажмешь на кнопку. вот если нажать на кнопку1 то в питоне вот такие ошибки показывает. 2016-12-16 19:10:04.839: ERROR: Traceback (most recent call last): 2016-12-16 19:10:04.839: ERROR: File "mod_test", line 45, in new_onClickAction 2016-12-16 19:10:04.839: ERROR: NameError: global name 'openBrowserWindow' is not defined Edited December 16, 2016 by ЛОМ @ 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.