Removed mobile/SMS from messenger

This commit is contained in:
2024-03-31 10:35:00 +00:00
parent e3a957cf4b
commit f46e28d3f2
19 changed files with 11 additions and 986 deletions

View File

@ -14,11 +14,6 @@ import interfaceModule #
blockMode = 0
viewChatMode = 0
MOBILE = False
if localeInfo.IsYMIR():
MOBILE = True
class OptionDialog(ui.ScriptWindow):
@ -87,22 +82,13 @@ class OptionDialog(ui.ScriptWindow):
self.showsalesTextButtonList.append(GetObject("salestext_on_button"))
self.showsalesTextButtonList.append(GetObject("salestext_off_button"))
global MOBILE
if MOBILE:
self.inputMobileButton = GetObject("input_mobile_button")
self.deleteMobileButton = GetObject("delete_mobile_button")
except:
import exception
exception.Abort("OptionDialog.__Load_BindObject")
def __Load(self):
global MOBILE
if MOBILE:
self.__Load_LoadScript("uiscript/gameoptiondialog_formobile.py")
else:
self.__Load_LoadScript("uiscript/gameoptiondialog.py")
self.__Load_LoadScript("uiscript/gameoptiondialog.py")
self.__Load_BindObject()
@ -151,11 +137,6 @@ class OptionDialog(ui.ScriptWindow):
self.__ClickRadioButton(self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD())
self.__SetPeacePKMode()
#global MOBILE
if MOBILE:
self.inputMobileButton.SetEvent(ui.__mem_func__(self.__OnChangeMobilePhoneNumber))
self.deleteMobileButton.SetEvent(ui.__mem_func__(self.__OnDeleteMobilePhoneNumber))
def __ClickRadioButton(self, buttonList, buttonIndex):
try:
selButton=buttonList[buttonIndex]
@ -334,67 +315,6 @@ class OptionDialog(ui.ScriptWindow):
def OnChangePKMode(self):
self.__RefreshPVPButtonList()
def __OnChangeMobilePhoneNumber(self):
global MOBILE
if not MOBILE:
return
import uiCommon
inputDialog = uiCommon.InputDialog()
inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_TITLE)
inputDialog.SetMaxLength(13)
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobilePhoneNumber))
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
inputDialog.Open()
self.inputDialog = inputDialog
def __OnDeleteMobilePhoneNumber(self):
global MOBILE
if not MOBILE:
return
import uiCommon
questionDialog = uiCommon.QuestionDialog()
questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE_PHONE_NUMBER)
questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDeleteMobile))
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
questionDialog.Open()
self.questionDialog = questionDialog
def OnInputMobilePhoneNumber(self):
global MOBILE
if not MOBILE:
return
text = self.inputDialog.GetText()
if not text:
return
text.replace('-', '')
net.SendChatPacket("/mobile " + text)
self.OnCloseInputDialog()
return True
def OnInputMobileAuthorityCode(self):
global MOBILE
if not MOBILE:
return
text = self.inputDialog.GetText()
net.SendChatPacket("/mobile_auth " + text)
self.OnCloseInputDialog()
return True
def OnDeleteMobile(self):
global MOBILE
if not MOBILE:
return
net.SendChatPacket("/mobile")
self.OnCloseQuestionDialog()
return True
def OnCloseInputDialog(self):
self.inputDialog.Close()
self.inputDialog = None
@ -409,34 +329,6 @@ class OptionDialog(ui.ScriptWindow):
self.Close()
return True
def RefreshMobile(self):
global MOBILE
if not MOBILE:
return
if player.HasMobilePhoneNumber():
self.inputMobileButton.Hide()
self.deleteMobileButton.Show()
else:
self.inputMobileButton.Show()
self.deleteMobileButton.Hide()
def OnMobileAuthority(self):
global MOBILE
if not MOBILE:
return
import uiCommon
inputDialog = uiCommon.InputDialogWithDescription()
inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_TITLE)
inputDialog.SetDescription(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_DESCRIPTION)
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileAuthorityCode))
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
inputDialog.SetMaxLength(4)
inputDialog.SetBoardWidth(310)
inputDialog.Open()
self.inputDialog = inputDialog
def RefreshBlock(self):
global blockMode
for i in xrange(len(self.blockButtonList)):
@ -483,7 +375,6 @@ class OptionDialog(ui.ScriptWindow):
self.RefreshBlock()
def Show(self):
self.RefreshMobile()
self.RefreshBlock()
ui.ScriptWindow.Show(self)