Ссылка не работает
Вот вроде рабочий вариант (с XVM и без). Во всплывающем окне.
def new_NotificationsActionsHandlers_handleAction(self, model, typeID, entityID, actionName):
import sys, re
regex = re.compile(
r'^https?://'
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?|'
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'
r'(?::\d+)?'
r'(?:/?|[/?]\S+)$', re.IGNORECASE
)
if regex.match(actionName) is None:
return old_NotificationsActionsHandlers_handleAction(self, model, typeID, entityID, actionName)
if 'xfw' not in sys.modules:
from gui.shared import g_eventBus, events
g_eventBus.handleEvent(events.OpenLinkEvent(events.OpenLinkEvent.SPECIFIED, actionName))
return None
from notification.actions_handlers import NotificationsActionsHandlers
old_NotificationsActionsHandlers_handleAction = NotificationsActionsHandlers.handleAction
NotificationsActionsHandlers.handleAction = new_NotificationsActionsHandlers_handleAction
import BigWorld
from gui import SystemMessages
from Account import Account
link = Account.onBecomePlayer
def _First(self):
link(self)
msg = 'Сайт игры <a href="event:http://worldoftanks.ru">worldoftanks.ru</a>'
type = SystemMessages.SM_TYPE.GameGreeting
SystemMessages.pushMessage(msg, type)
Account.onBecomePlayer = link
Account.onBecomePlayer = _First