usure.py (1660B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\services\usure.py 2 from carbon.common.script.sys.service import Service 3 from carbon.common.script.sys.serviceConst import ROLE_SERVICE 4 from carbonui import uiconst 5 from locks import TempLock 6 from eve.client.script.ui.shared.messageboxWithTimeout import MessageBoxWithTimeout 7 from player_messaging.client import get_supressed_result 8 from player_messaging.client.ui_message import prompt_player_fsd_dialog 9 DEFAULT_TIMEOUT = 20 10 11 class YouSureBoutThat(Service): 12 __guid__ = 'svc.usure' 13 __dependencies__ = [] 14 __notifyevents__ = [] 15 __startupdependencies__ = ['settings'] 16 __exportedcalls__ = {'ConfirmGeneric': [ROLE_SERVICE]} 17 18 def __init__(self): 19 super(self.__class__, self).__init__() 20 self.suppressed = settings.user.suppress 21 22 def ConfirmGeneric(self, msgKey, msgTimeout = DEFAULT_TIMEOUT, **msgKwArgs): 23 response = get_supressed_result(msgKey) 24 if response is None: 25 suppress = cfg.GetSuppressValueForMessage(msgKey, msgKwArgs) 26 if suppress not in (None, uiconst.ID_YES, uiconst.ID_NO): 27 self.LogWarn('ConfirmGeneric expects suppressible messages to specify a value to suppress on. %s uses %s which is not supported by this function.' % (msgKey, suppress)) 28 with TempLock('%s_%s' % (msgKey, str(msgKwArgs))): 29 msgBoxParams = {'timeout': msgTimeout} 30 response = prompt_player_fsd_dialog(msgKey, msgKwArgs, uiconst.YESNO, suppress=suppress, customMsgBox=(MessageBoxWithTimeout, msgBoxParams)) 31 return response == uiconst.ID_YES