forked from metin2/client
Removed mobile/SMS from messenger
This commit is contained in:
@ -683,13 +683,6 @@ class GameWindow(ui.ScriptWindow):
|
||||
def RefreshGuildGradePage(self):
|
||||
self.interface.RefreshGuildGradePage()
|
||||
|
||||
def RefreshMobile(self):
|
||||
if self.interface:
|
||||
self.interface.RefreshMobile()
|
||||
|
||||
def OnMobileAuthority(self):
|
||||
self.interface.OnMobileAuthority()
|
||||
|
||||
def OnBlockMode(self, mode):
|
||||
self.interface.OnBlockMode(mode)
|
||||
|
||||
|
@ -610,12 +610,6 @@ class Interface(object):
|
||||
self.wndMessenger.ClearGuildMember()
|
||||
self.wndGuild.DeleteGuild()
|
||||
|
||||
def RefreshMobile(self):
|
||||
self.dlgSystem.RefreshMobile()
|
||||
|
||||
def OnMobileAuthority(self):
|
||||
self.dlgSystem.OnMobileAuthority()
|
||||
|
||||
def OnBlockMode(self, mode):
|
||||
self.dlgSystem.OnBlockMode(mode)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -71,15 +71,9 @@ class MessengerItem(ui.Window):
|
||||
def IsOnline(self):
|
||||
return False
|
||||
|
||||
def IsMobile(self):
|
||||
return False
|
||||
|
||||
def OnWhisper(self):
|
||||
pass
|
||||
|
||||
def OnMobileMessage(self):
|
||||
pass
|
||||
|
||||
# Remove
|
||||
def CanRemove(self):
|
||||
return False
|
||||
@ -123,17 +117,16 @@ class MessengerMemberItem(MessengerItem):
|
||||
|
||||
STATE_OFFLINE = 0
|
||||
STATE_ONLINE = 1
|
||||
STATE_MOBILE = 2
|
||||
|
||||
IMAGE_FILE_NAME = { "ONLINE" : "d:/ymir work/ui/game/windows/messenger_list_online.sub",
|
||||
"OFFLINE" : "d:/ymir work/ui/game/windows/messenger_list_offline.sub",
|
||||
"MOBILE" : "d:/ymir work/ui/game/windows/messenger_list_mobile.sub", }
|
||||
IMAGE_FILE_NAME = {
|
||||
"ONLINE" : "d:/ymir work/ui/game/windows/messenger_list_online.sub",
|
||||
"OFFLINE" : "d:/ymir work/ui/game/windows/messenger_list_offline.sub",
|
||||
}
|
||||
|
||||
def __init__(self, getParentEvent):
|
||||
MessengerItem.__init__(self, getParentEvent)
|
||||
self.key = None
|
||||
self.state = self.STATE_OFFLINE
|
||||
self.mobileFlag = False
|
||||
self.Offline()
|
||||
|
||||
def GetStepWidth(self):
|
||||
@ -151,30 +144,13 @@ class MessengerMemberItem(MessengerItem):
|
||||
|
||||
return False
|
||||
|
||||
def IsMobile(self):
|
||||
if self.STATE_MOBILE == self.state:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def Online(self):
|
||||
self.image.LoadImage(self.IMAGE_FILE_NAME["ONLINE"])
|
||||
self.state = self.STATE_ONLINE
|
||||
|
||||
def Offline(self):
|
||||
if self.mobileFlag:
|
||||
self.image.LoadImage(self.IMAGE_FILE_NAME["MOBILE"])
|
||||
self.state = self.STATE_MOBILE
|
||||
|
||||
else:
|
||||
self.image.LoadImage(self.IMAGE_FILE_NAME["OFFLINE"])
|
||||
self.state = self.STATE_OFFLINE
|
||||
|
||||
def SetMobile(self, flag):
|
||||
self.mobileFlag = flag
|
||||
|
||||
if not self.IsOnline():
|
||||
self.Offline()
|
||||
self.image.LoadImage(self.IMAGE_FILE_NAME["OFFLINE"])
|
||||
self.state = self.STATE_OFFLINE
|
||||
|
||||
def CanWhisper(self):
|
||||
if self.IsOnline():
|
||||
@ -186,15 +162,6 @@ class MessengerMemberItem(MessengerItem):
|
||||
if self.IsOnline():
|
||||
self.getParentEvent().whisperButtonEvent(self.GetName())
|
||||
|
||||
def OnMobileMessage(self):
|
||||
if not uiGameOption.MOBILE:
|
||||
return
|
||||
|
||||
if not self.IsMobile():
|
||||
return
|
||||
|
||||
self.getParentEvent().SendMobileMessage(self.GetName())
|
||||
|
||||
def Select(self):
|
||||
MessengerItem.Select(self)
|
||||
|
||||
@ -370,7 +337,6 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
|
||||
self.showingPageSize = 0
|
||||
self.startLine = 0
|
||||
self.hasMobilePhoneNumber = True
|
||||
|
||||
self.isLoaded = 0
|
||||
|
||||
@ -396,7 +362,6 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
self.board = self.GetChild("board")
|
||||
self.scrollBar = self.GetChild("ScrollBar")
|
||||
self.whisperButton = self.GetChild("WhisperButton")
|
||||
self.mobileButton = self.GetChild("MobileButton")
|
||||
self.removeButton = self.GetChild("RemoveButton")
|
||||
self.addFriendButton = self.GetChild("AddFriendButton")
|
||||
self.guildButton = self.GetChild("GuildButton")
|
||||
@ -407,22 +372,11 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
self.board.SetCloseEvent(ui.__mem_func__(self.Close))
|
||||
self.scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll))
|
||||
self.whisperButton.SetEvent(ui.__mem_func__(self.OnPressWhisperButton))
|
||||
self.mobileButton.SetEvent(ui.__mem_func__(self.OnPressMobileButton))
|
||||
self.removeButton.SetEvent(ui.__mem_func__(self.OnPressRemoveButton))
|
||||
self.addFriendButton.SetEvent(ui.__mem_func__(self.OnPressAddFriendButton))
|
||||
self.guildButton.SetEvent(ui.__mem_func__(self.OnPressGuildButton))
|
||||
|
||||
if not uiGameOption.MOBILE: #constInfo.SEND_MOBILE_PHONE_MESSAGE_ENABLE:
|
||||
self.mobileButton.Hide()
|
||||
width = self.GetWidth()
|
||||
height = self.GetHeight()
|
||||
self.addFriendButton.SetPosition(-60, 30)
|
||||
self.whisperButton.SetPosition(-20, 30)
|
||||
self.removeButton.SetPosition(20, 30)
|
||||
self.guildButton.SetPosition(60, 30)
|
||||
|
||||
self.whisperButton.Disable()
|
||||
self.mobileButton.Disable()
|
||||
self.removeButton.Disable()
|
||||
|
||||
resizeButton = self.ResizeButton()
|
||||
@ -450,11 +404,9 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
self.friendNameBoard = None
|
||||
self.questionDialog = None
|
||||
self.popupDialog = None
|
||||
self.inputDialog = None
|
||||
self.familyGroup = None
|
||||
|
||||
self.whisperButton = None
|
||||
self.mobileButton = None
|
||||
self.removeButton = None
|
||||
|
||||
def OnCloseQuestionDialog(self):
|
||||
@ -543,84 +495,6 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
def SetGuildButtonEvent(self, event):
|
||||
self.guildButtonEvent=event
|
||||
|
||||
def SendMobileMessage(self, name):
|
||||
if not uiGameOption.MOBILE:
|
||||
return
|
||||
|
||||
if not self.hasMobilePhoneNumber:
|
||||
questionDialog = uiCommon.QuestionDialog2()
|
||||
questionDialog.SetText1(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_1)
|
||||
questionDialog.SetText2(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_2)
|
||||
questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnAcceptInputMobilePhoneNumber))
|
||||
questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCancelInputMobilePhoneNumber))
|
||||
questionDialog.SetWidth(400)
|
||||
questionDialog.Open()
|
||||
self.questionDialog = questionDialog
|
||||
return
|
||||
|
||||
## Input Sending Mobile Message
|
||||
inputDialog = uiCommon.InputDialog()
|
||||
inputDialog.SetTitle(localeInfo.MESSENGER_SEND_MOBILE_MESSAGE_TITLE)
|
||||
inputDialog.SetMaxLength(50)
|
||||
inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileMessage))
|
||||
inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
|
||||
inputDialog.name = name
|
||||
inputDialog.Open()
|
||||
self.inputDialog = inputDialog
|
||||
|
||||
def OnAcceptInputMobilePhoneNumber(self):
|
||||
if not uiGameOption.MOBILE:
|
||||
return
|
||||
|
||||
## Input Mobile Phone Number
|
||||
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
|
||||
self.OnCancelInputMobilePhoneNumber()
|
||||
|
||||
def OnCancelInputMobilePhoneNumber(self):
|
||||
if not uiGameOption.MOBILE:
|
||||
return
|
||||
self.questionDialog.Close()
|
||||
self.questionDialog = None
|
||||
return True
|
||||
|
||||
def OnInputMobilePhoneNumber(self):
|
||||
if not uiGameOption.MOBILE:
|
||||
return
|
||||
|
||||
text = self.inputDialog.GetText()
|
||||
|
||||
if not text:
|
||||
return
|
||||
|
||||
text.replace('-', '')
|
||||
net.SendChatPacket("/mobile " + text)
|
||||
self.OnCloseInputDialog()
|
||||
return True
|
||||
|
||||
def OnInputMobileMessage(self):
|
||||
if not uiGameOption.MOBILE:
|
||||
return
|
||||
|
||||
text = self.inputDialog.GetText()
|
||||
|
||||
if not text:
|
||||
return
|
||||
|
||||
net.SendMobileMessagePacket(self.inputDialog.name, text)
|
||||
self.OnCloseInputDialog()
|
||||
return True
|
||||
|
||||
def OnCloseInputDialog(self):
|
||||
self.inputDialog.Close()
|
||||
self.inputDialog = None
|
||||
return True
|
||||
|
||||
def OnPressGuildButton(self):
|
||||
self.guildButtonEvent()
|
||||
|
||||
@ -649,10 +523,6 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
if self.selectedItem:
|
||||
self.selectedItem.OnWhisper()
|
||||
|
||||
def OnPressMobileButton(self):
|
||||
if self.selectedItem:
|
||||
self.selectedItem.OnMobileMessage()
|
||||
|
||||
def OnPressRemoveButton(self):
|
||||
if self.selectedItem:
|
||||
if self.selectedItem.CanRemove():
|
||||
@ -702,11 +572,6 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
else:
|
||||
self.whisperButton.Disable()
|
||||
|
||||
if self.selectedItem.IsMobile():
|
||||
self.mobileButton.Enable()
|
||||
else:
|
||||
self.mobileButton.Disable()
|
||||
|
||||
if self.selectedItem.CanRemove():
|
||||
self.removeButton.Enable()
|
||||
else:
|
||||
@ -720,9 +585,6 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
if self.selectedItem.IsOnline():
|
||||
self.OnPressWhisperButton()
|
||||
|
||||
elif self.selectedItem.IsMobile():
|
||||
self.OnPressMobileButton()
|
||||
|
||||
def GetSelf(self):
|
||||
return self
|
||||
|
||||
@ -796,14 +658,6 @@ class MessengerWindow(ui.ScriptWindow):
|
||||
member.Offline()
|
||||
self.OnRefreshList()
|
||||
|
||||
def OnMobile(self, groupIndex, key, mobileFlag):
|
||||
group = self.groupList[groupIndex]
|
||||
member = group.FindMember(key)
|
||||
if not member:
|
||||
return
|
||||
member.SetMobile(mobileFlag)
|
||||
self.OnRefreshList()
|
||||
|
||||
def OnAddLover(self, name, lovePoint):
|
||||
if not self.familyGroup:
|
||||
self.__AddFamilyGroup()
|
||||
|
@ -9,11 +9,6 @@ import constInfo
|
||||
import chrmgr
|
||||
import player
|
||||
|
||||
MOBILE = False
|
||||
|
||||
if localeInfo.IsYMIR():
|
||||
MOBILE = True
|
||||
|
||||
blockMode = 0
|
||||
|
||||
class OptionDialog(ui.ScriptWindow):
|
||||
@ -45,15 +40,9 @@ class OptionDialog(ui.ScriptWindow):
|
||||
print " -------------------------------------- DESTROY OPTION DIALOG"
|
||||
|
||||
def __LoadDialog(self):
|
||||
global NO_MOBILE
|
||||
|
||||
try:
|
||||
pyScriptLoader = ui.PythonScriptLoader()
|
||||
|
||||
if MOBILE:
|
||||
pyScriptLoader.LoadScriptFile(self, "uiscript/optiondialog_formobile.py")
|
||||
else:
|
||||
pyScriptLoader.LoadScriptFile(self, "uiscript/optiondialog.py")
|
||||
pyScriptLoader.LoadScriptFile(self, "uiscript/optiondialog.py")
|
||||
|
||||
except:
|
||||
import exception
|
||||
@ -82,10 +71,6 @@ class OptionDialog(ui.ScriptWindow):
|
||||
self.blockButtonList.append(GetObject("block_guild_button"))
|
||||
self.blockButtonList.append(GetObject("block_whisper_button"))
|
||||
self.blockButtonList.append(GetObject("block_friend_button"))
|
||||
|
||||
if MOBILE:
|
||||
self.inputMobileButton = GetObject("input_mobile_button")
|
||||
self.deleteMobileButton = GetObject("delete_mobile_button")
|
||||
|
||||
except:
|
||||
import exception
|
||||
@ -134,10 +119,6 @@ class OptionDialog(ui.ScriptWindow):
|
||||
self.__ClickRadioButton(self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD())
|
||||
self.__SetPeacePKMode()
|
||||
|
||||
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]
|
||||
@ -294,53 +275,6 @@ class OptionDialog(ui.ScriptWindow):
|
||||
snd.SetSoundVolumef(pos)
|
||||
systemSetting.SetSoundVolumef(pos)
|
||||
|
||||
def __OnChangeMobilePhoneNumber(self):
|
||||
|
||||
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):
|
||||
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):
|
||||
text = self.inputDialog.GetText()
|
||||
|
||||
if not text:
|
||||
return
|
||||
|
||||
text.replace('-', '')
|
||||
net.SendChatPacket("/mobile " + text)
|
||||
self.OnCloseInputDialog()
|
||||
return True
|
||||
|
||||
def OnInputMobileAuthorityCode(self):
|
||||
text = self.inputDialog.GetText()
|
||||
net.SendChatPacket("/mobile_auth " + text)
|
||||
self.OnCloseInputDialog()
|
||||
return True
|
||||
|
||||
def OnDeleteMobile(self):
|
||||
net.SendChatPacket("/mobile")
|
||||
self.OnCloseQuestionDialog()
|
||||
return True
|
||||
|
||||
def OnCloseInputDialog(self):
|
||||
self.inputDialog.Close()
|
||||
self.inputDialog = None
|
||||
return True
|
||||
|
||||
def OnCloseQuestionDialog(self):
|
||||
self.questionDialog.Close()
|
||||
self.questionDialog = None
|
||||
@ -350,30 +284,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):
|
||||
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)):
|
||||
@ -388,7 +298,6 @@ class OptionDialog(ui.ScriptWindow):
|
||||
self.RefreshBlock()
|
||||
|
||||
def Show(self):
|
||||
self.RefreshMobile()
|
||||
self.RefreshBlock()
|
||||
ui.ScriptWindow.Show(self)
|
||||
|
||||
|
@ -136,16 +136,6 @@ class SystemDialog(ui.ScriptWindow):
|
||||
self.Hide()
|
||||
return True
|
||||
|
||||
def RefreshMobile(self):
|
||||
if self.gameOptionDlg:
|
||||
self.gameOptionDlg.RefreshMobile()
|
||||
#self.optionDialog.RefreshMobile()
|
||||
|
||||
def OnMobileAuthority(self):
|
||||
if self.gameOptionDlg:
|
||||
self.gameOptionDlg.OnMobileAuthority()
|
||||
#self.optionDialog.OnMobileAuthority()
|
||||
|
||||
def OnBlockMode(self, mode):
|
||||
uiGameOption.blockMode = mode
|
||||
if self.gameOptionDlg:
|
||||
|
Reference in New Issue
Block a user