Advertisement
thespeedy

uigameoption.py

Oct 4th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 17.23 KB | None | 0 0
  1. import ui
  2. import snd
  3. import systemSetting
  4. try:
  5.     import m2net
  6. except ImportError:
  7.     import net as m2net
  8. import chat
  9. import app
  10. import localeInfo
  11. import constInfo
  12. import chrmgr
  13. import player
  14. import uiPrivateShopBuilder # ±èÁØÈ£
  15. import interfaceModule # ±èÁØÈ£
  16.  
  17. blockMode = 0
  18. viewChatMode = 0
  19.  
  20. MOBILE = False
  21.  
  22. if localeInfo.IsYMIR():
  23.     MOBILE = True
  24.  
  25.  
  26. class OptionDialog(ui.ScriptWindow):
  27.  
  28.     def __init__(self):
  29.         ui.ScriptWindow.__init__(self)
  30.         self.__Initialize()
  31.         self.__Load()
  32.         self.RefreshViewChat()
  33.         self.RefreshAlwaysShowName()
  34.         self.RefreshShowDamage()
  35.         self.RefreshShowSalesText()
  36.         if app.WJ_SHOW_MOB_INFO:
  37.             self.RefreshShowMobInfo()
  38.  
  39.     def __del__(self):
  40.         ui.ScriptWindow.__del__(self)
  41.         print " -------------------------------------- DELETE GAME OPTION DIALOG"
  42.  
  43.     def __Initialize(self):
  44.         self.titleBar = 0
  45.         self.nameColorModeButtonList = []
  46.         self.viewTargetBoardButtonList = []
  47.         self.pvpModeButtonDict = {}
  48.         self.blockButtonList = []
  49.         self.viewChatButtonList = []
  50.         self.alwaysShowNameButtonList = []
  51.         self.showDamageButtonList = []
  52.         self.showsalesTextButtonList = []
  53.         if app.WJ_SHOW_MOB_INFO:
  54.             self.showMobInfoButtonList = []
  55.  
  56.     def Destroy(self):
  57.         self.ClearDictionary()
  58.  
  59.         self.__Initialize()
  60.         print " -------------------------------------- DESTROY GAME OPTION DIALOG"
  61.  
  62.     def __Load_LoadScript(self, fileName):
  63.         try:
  64.             pyScriptLoader = ui.PythonScriptLoader()
  65.             pyScriptLoader.LoadScriptFile(self, fileName)
  66.         except:
  67.             import exception
  68.             exception.Abort("OptionDialog.__Load_LoadScript")
  69.  
  70.     def __Load_BindObject(self):
  71.         try:
  72.             GetObject = self.GetChild
  73.             self.titleBar = GetObject("titlebar")
  74.             self.nameColorModeButtonList.append(GetObject("name_color_normal"))
  75.             self.nameColorModeButtonList.append(GetObject("name_color_empire"))
  76.             self.viewTargetBoardButtonList.append(GetObject("target_board_no_view"))
  77.             self.viewTargetBoardButtonList.append(GetObject("target_board_view"))
  78.             self.pvpModeButtonDict[player.PK_MODE_PEACE] = GetObject("pvp_peace")
  79.             self.pvpModeButtonDict[player.PK_MODE_REVENGE] = GetObject("pvp_revenge")
  80.             self.pvpModeButtonDict[player.PK_MODE_GUILD] = GetObject("pvp_guild")
  81.             self.pvpModeButtonDict[player.PK_MODE_FREE] = GetObject("pvp_free")
  82.             self.blockButtonList.append(GetObject("block_exchange_button"))
  83.             self.blockButtonList.append(GetObject("block_party_button"))
  84.             self.blockButtonList.append(GetObject("block_guild_button"))
  85.             self.blockButtonList.append(GetObject("block_whisper_button"))
  86.             self.blockButtonList.append(GetObject("block_friend_button"))
  87.             self.blockButtonList.append(GetObject("block_party_request_button"))
  88.             self.viewChatButtonList.append(GetObject("view_chat_on_button"))
  89.             self.viewChatButtonList.append(GetObject("view_chat_off_button"))
  90.             self.alwaysShowNameButtonList.append(GetObject("always_show_name_on_button"))
  91.             self.alwaysShowNameButtonList.append(GetObject("always_show_name_off_button"))
  92.             self.showDamageButtonList.append(GetObject("show_damage_on_button"))
  93.             self.showDamageButtonList.append(GetObject("show_damage_off_button"))
  94.             self.showsalesTextButtonList.append(GetObject("salestext_on_button"))
  95.             self.showsalesTextButtonList.append(GetObject("salestext_off_button"))
  96.  
  97.             if app.WJ_SHOW_MOB_INFO:
  98.                 self.showMobInfoButtonList.append(GetObject("show_mob_level_button"))
  99.                 self.showMobInfoButtonList.append(GetObject("show_mob_AI_flag_button"))
  100.  
  101.             global MOBILE
  102.             if MOBILE:
  103.                 self.inputMobileButton = GetObject("input_mobile_button")
  104.                 self.deleteMobileButton = GetObject("delete_mobile_button")
  105.  
  106.         except:
  107.             import exception
  108.             exception.Abort("OptionDialog.__Load_BindObject")
  109.  
  110.     def __Load(self):
  111.         global MOBILE
  112.         if MOBILE:
  113.             self.__Load_LoadScript("uiscript/gameoptiondialog_formobile.py")
  114.         else:
  115.             if app.WJ_SHOW_MOB_INFO:
  116.                 self.__Load_LoadScript("uiscript/gameoptiondialog_wjmobinfo.py")
  117.             else:
  118.                 self.__Load_LoadScript("uiscript/gameoptiondialog.py")
  119.  
  120.         self.__Load_BindObject()
  121.  
  122.         self.SetCenterPosition()
  123.  
  124.         self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
  125.  
  126.         self.nameColorModeButtonList[0].SAFE_SetEvent(self.__OnClickNameColorModeNormalButton)
  127.         self.nameColorModeButtonList[1].SAFE_SetEvent(self.__OnClickNameColorModeEmpireButton)
  128.  
  129.         self.viewTargetBoardButtonList[0].SAFE_SetEvent(self.__OnClickTargetBoardViewButton)
  130.         self.viewTargetBoardButtonList[1].SAFE_SetEvent(self.__OnClickTargetBoardNoViewButton)
  131.  
  132.         self.pvpModeButtonDict[player.PK_MODE_PEACE].SAFE_SetEvent(self.__OnClickPvPModePeaceButton)
  133.         self.pvpModeButtonDict[player.PK_MODE_REVENGE].SAFE_SetEvent(self.__OnClickPvPModeRevengeButton)
  134.         self.pvpModeButtonDict[player.PK_MODE_GUILD].SAFE_SetEvent(self.__OnClickPvPModeGuildButton)
  135.         self.pvpModeButtonDict[player.PK_MODE_FREE].SAFE_SetEvent(self.__OnClickPvPModeFreeButton)
  136.  
  137.         self.blockButtonList[0].SetToggleUpEvent(self.__OnClickBlockExchangeButton)
  138.         self.blockButtonList[1].SetToggleUpEvent(self.__OnClickBlockPartyButton)
  139.         self.blockButtonList[2].SetToggleUpEvent(self.__OnClickBlockGuildButton)
  140.         self.blockButtonList[3].SetToggleUpEvent(self.__OnClickBlockWhisperButton)
  141.         self.blockButtonList[4].SetToggleUpEvent(self.__OnClickBlockFriendButton)
  142.         self.blockButtonList[5].SetToggleUpEvent(self.__OnClickBlockPartyRequest)
  143.  
  144.         self.blockButtonList[0].SetToggleDownEvent(self.__OnClickBlockExchangeButton)
  145.         self.blockButtonList[1].SetToggleDownEvent(self.__OnClickBlockPartyButton)
  146.         self.blockButtonList[2].SetToggleDownEvent(self.__OnClickBlockGuildButton)
  147.         self.blockButtonList[3].SetToggleDownEvent(self.__OnClickBlockWhisperButton)
  148.         self.blockButtonList[4].SetToggleDownEvent(self.__OnClickBlockFriendButton)
  149.         self.blockButtonList[5].SetToggleDownEvent(self.__OnClickBlockPartyRequest)
  150.  
  151.         self.viewChatButtonList[0].SAFE_SetEvent(self.__OnClickViewChatOnButton)
  152.         self.viewChatButtonList[1].SAFE_SetEvent(self.__OnClickViewChatOffButton)
  153.  
  154.         self.alwaysShowNameButtonList[0].SAFE_SetEvent(self.__OnClickAlwaysShowNameOnButton)
  155.         self.alwaysShowNameButtonList[1].SAFE_SetEvent(self.__OnClickAlwaysShowNameOffButton)
  156.  
  157.         self.showDamageButtonList[0].SAFE_SetEvent(self.__OnClickShowDamageOnButton)
  158.         self.showDamageButtonList[1].SAFE_SetEvent(self.__OnClickShowDamageOffButton)
  159.  
  160.         self.showsalesTextButtonList[0].SAFE_SetEvent(self.__OnClickSalesTextOnButton)
  161.         self.showsalesTextButtonList[1].SAFE_SetEvent(self.__OnClickSalesTextOffButton)
  162.  
  163.         if app.WJ_SHOW_MOB_INFO:
  164.             self.showMobInfoButtonList[0].SetToggleUpEvent(self.__OnClickShowMobLevelButton)
  165.             self.showMobInfoButtonList[1].SetToggleUpEvent(self.__OnClickShowMobAIFlagButton)
  166.  
  167.             self.showMobInfoButtonList[0].SetToggleDownEvent(self.__OnClickShowMobLevelButton)
  168.             self.showMobInfoButtonList[1].SetToggleDownEvent(self.__OnClickShowMobAIFlagButton)
  169.  
  170.         self.__ClickRadioButton(self.nameColorModeButtonList, constInfo.GET_CHRNAME_COLOR_INDEX())
  171.         self.__ClickRadioButton(self.viewTargetBoardButtonList, constInfo.GET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD())
  172.         self.__SetPeacePKMode()
  173.  
  174.         #global MOBILE
  175.         if MOBILE:
  176.             self.inputMobileButton.SetEvent(ui.__mem_func__(self.__OnChangeMobilePhoneNumber))
  177.             self.deleteMobileButton.SetEvent(ui.__mem_func__(self.__OnDeleteMobilePhoneNumber))
  178.  
  179.     def __ClickRadioButton(self, buttonList, buttonIndex):
  180.         try:
  181.             selButton=buttonList[buttonIndex]
  182.         except IndexError:
  183.             return
  184.  
  185.         for eachButton in buttonList:
  186.             eachButton.SetUp()
  187.  
  188.         selButton.Down()
  189.  
  190.     def __SetNameColorMode(self, index):
  191.         constInfo.SET_CHRNAME_COLOR_INDEX(index)
  192.         self.__ClickRadioButton(self.nameColorModeButtonList, index)
  193.  
  194.     def __SetTargetBoardViewMode(self, flag):
  195.         constInfo.SET_VIEW_OTHER_EMPIRE_PLAYER_TARGET_BOARD(flag)
  196.         self.__ClickRadioButton(self.viewTargetBoardButtonList, flag)
  197.  
  198.     def __OnClickNameColorModeNormalButton(self):
  199.         self.__SetNameColorMode(0)
  200.  
  201.     def __OnClickNameColorModeEmpireButton(self):
  202.         self.__SetNameColorMode(1)
  203.  
  204.     def __OnClickTargetBoardViewButton(self):
  205.         self.__SetTargetBoardViewMode(0)
  206.  
  207.     def __OnClickTargetBoardNoViewButton(self):
  208.         self.__SetTargetBoardViewMode(1)
  209.  
  210.     def __OnClickCameraModeShortButton(self):
  211.         self.__SetCameraMode(0)
  212.  
  213.     def __OnClickCameraModeLongButton(self):
  214.         self.__SetCameraMode(1)
  215.  
  216.     def __OnClickFogModeLevel0Button(self):
  217.         self.__SetFogLevel(0)
  218.  
  219.     def __OnClickFogModeLevel1Button(self):
  220.         self.__SetFogLevel(1)
  221.  
  222.     def __OnClickFogModeLevel2Button(self):
  223.         self.__SetFogLevel(2)
  224.  
  225.     def __OnClickBlockExchangeButton(self):
  226.         self.RefreshBlock()
  227.         global blockMode
  228.         m2net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_EXCHANGE))
  229.     def __OnClickBlockPartyButton(self):
  230.         self.RefreshBlock()
  231.         global blockMode
  232.         m2net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_PARTY))
  233.     def __OnClickBlockGuildButton(self):
  234.         self.RefreshBlock()
  235.         global blockMode
  236.         m2net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_GUILD))
  237.     def __OnClickBlockWhisperButton(self):
  238.         self.RefreshBlock()
  239.         global blockMode
  240.         m2net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_WHISPER))
  241.     def __OnClickBlockFriendButton(self):
  242.         self.RefreshBlock()
  243.         global blockMode
  244.         m2net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_FRIEND))
  245.     def __OnClickBlockPartyRequest(self):
  246.         self.RefreshBlock()
  247.         global blockMode
  248.         m2net.SendChatPacket("/setblockmode " + str(blockMode ^ player.BLOCK_PARTY_REQUEST))
  249.  
  250.     def __OnClickViewChatOnButton(self):
  251.         global viewChatMode
  252.         viewChatMode = 1
  253.         systemSetting.SetViewChatFlag(viewChatMode)
  254.         self.RefreshViewChat()
  255.     def __OnClickViewChatOffButton(self):
  256.         global viewChatMode
  257.         viewChatMode = 0
  258.         systemSetting.SetViewChatFlag(viewChatMode)
  259.         self.RefreshViewChat()
  260.  
  261.     def __OnClickAlwaysShowNameOnButton(self):
  262.         systemSetting.SetAlwaysShowNameFlag(True)
  263.         self.RefreshAlwaysShowName()
  264.  
  265.     def __OnClickAlwaysShowNameOffButton(self):
  266.         systemSetting.SetAlwaysShowNameFlag(False)
  267.         self.RefreshAlwaysShowName()
  268.  
  269.     def __OnClickShowDamageOnButton(self):
  270.         systemSetting.SetShowDamageFlag(True)
  271.         self.RefreshShowDamage()
  272.  
  273.     def __OnClickShowDamageOffButton(self):
  274.         systemSetting.SetShowDamageFlag(False)
  275.         self.RefreshShowDamage()
  276.  
  277.     def __OnClickSalesTextOnButton(self):
  278.         systemSetting.SetShowSalesTextFlag(True)
  279.         self.RefreshShowSalesText()
  280.         uiPrivateShopBuilder.UpdateADBoard()
  281.  
  282.     def __OnClickSalesTextOffButton(self):
  283.         systemSetting.SetShowSalesTextFlag(False)
  284.         self.RefreshShowSalesText()
  285.  
  286.     def __OnClickShowMobLevelButton(self):
  287.         if app.WJ_SHOW_MOB_INFO:
  288.             if systemSetting.IsShowMobLevel():
  289.                 systemSetting.SetShowMobLevel(False)
  290.             else:
  291.                 systemSetting.SetShowMobLevel(True)
  292.  
  293.             self.RefreshShowMobInfo()
  294.  
  295.     def __OnClickShowMobAIFlagButton(self):
  296.         if app.WJ_SHOW_MOB_INFO:
  297.             if systemSetting.IsShowMobAIFlag():
  298.                 systemSetting.SetShowMobAIFlag(False)
  299.             else:
  300.                 systemSetting.SetShowMobAIFlag(True)
  301.  
  302.             self.RefreshShowMobInfo()
  303.  
  304.     def __CheckPvPProtectedLevelPlayer(self):
  305.         if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  306.             self.__SetPeacePKMode()
  307.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  308.             return 1
  309.  
  310.         return 0
  311.  
  312.     def __SetPKMode(self, mode):
  313.         for btn in self.pvpModeButtonDict.values():
  314.             btn.SetUp()
  315.         if self.pvpModeButtonDict.has_key(mode):
  316.             self.pvpModeButtonDict[mode].Down()
  317.  
  318.     def __SetPeacePKMode(self):
  319.         self.__SetPKMode(player.PK_MODE_PEACE)
  320.  
  321.     def __RefreshPVPButtonList(self):
  322.         self.__SetPKMode(player.GetPKMode())
  323.  
  324.     def __OnClickPvPModePeaceButton(self):
  325.         if self.__CheckPvPProtectedLevelPlayer():
  326.             return
  327.  
  328.         self.__RefreshPVPButtonList()
  329.  
  330.         if constInfo.PVPMODE_ENABLE:
  331.             m2net.SendChatPacket("/pkmode 0", chat.CHAT_TYPE_TALKING)
  332.         else:
  333.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
  334.  
  335.     def __OnClickPvPModeRevengeButton(self):
  336.         if self.__CheckPvPProtectedLevelPlayer():
  337.             return
  338.  
  339.         self.__RefreshPVPButtonList()
  340.  
  341.         if constInfo.PVPMODE_ENABLE:
  342.             m2net.SendChatPacket("/pkmode 1", chat.CHAT_TYPE_TALKING)
  343.         else:
  344.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
  345.  
  346.     def __OnClickPvPModeFreeButton(self):
  347.         if self.__CheckPvPProtectedLevelPlayer():
  348.             return
  349.  
  350.         self.__RefreshPVPButtonList()
  351.  
  352.         if constInfo.PVPMODE_ENABLE:
  353.             m2net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING)
  354.         else:
  355.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
  356.  
  357.     def __OnClickPvPModeGuildButton(self):
  358.         if self.__CheckPvPProtectedLevelPlayer():
  359.             return
  360.  
  361.         self.__RefreshPVPButtonList()
  362.  
  363.         if 0 == player.GetGuildID():
  364.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  365.             return
  366.  
  367.         if constInfo.PVPMODE_ENABLE:
  368.             m2net.SendChatPacket("/pkmode 4", chat.CHAT_TYPE_TALKING)
  369.         else:
  370.             chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT)
  371.  
  372.     def OnChangePKMode(self):
  373.         self.__RefreshPVPButtonList()
  374.  
  375.     def __OnChangeMobilePhoneNumber(self):
  376.         global MOBILE
  377.         if not MOBILE:
  378.             return
  379.  
  380.         import uiCommon
  381.         inputDialog = uiCommon.InputDialog()
  382.         inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_TITLE)
  383.         inputDialog.SetMaxLength(13)
  384.         inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobilePhoneNumber))
  385.         inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
  386.         inputDialog.Open()
  387.         self.inputDialog = inputDialog
  388.  
  389.     def __OnDeleteMobilePhoneNumber(self):
  390.         global MOBILE
  391.         if not MOBILE:
  392.             return
  393.  
  394.         import uiCommon
  395.         questionDialog = uiCommon.QuestionDialog()
  396.         questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE_PHONE_NUMBER)
  397.         questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnDeleteMobile))
  398.         questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  399.         questionDialog.Open()
  400.         self.questionDialog = questionDialog
  401.  
  402.     def OnInputMobilePhoneNumber(self):
  403.         global MOBILE
  404.         if not MOBILE:
  405.             return
  406.  
  407.         text = self.inputDialog.GetText()
  408.  
  409.         if not text:
  410.             return
  411.  
  412.         text.replace('-', '')
  413.         m2net.SendChatPacket("/mobile " + text)
  414.         self.OnCloseInputDialog()
  415.         return True
  416.  
  417.     def OnInputMobileAuthorityCode(self):
  418.         global MOBILE
  419.         if not MOBILE:
  420.             return
  421.  
  422.         text = self.inputDialog.GetText()
  423.         m2net.SendChatPacket("/mobile_auth " + text)
  424.         self.OnCloseInputDialog()
  425.         return True
  426.  
  427.     def OnDeleteMobile(self):
  428.         global MOBILE
  429.         if not MOBILE:
  430.             return
  431.  
  432.         m2net.SendChatPacket("/mobile")
  433.         self.OnCloseQuestionDialog()
  434.         return True
  435.  
  436.     def OnCloseInputDialog(self):
  437.         self.inputDialog.Close()
  438.         self.inputDialog = None
  439.         return True
  440.  
  441.     def OnCloseQuestionDialog(self):
  442.         self.questionDialog.Close()
  443.         self.questionDialog = None
  444.         return True
  445.  
  446.     def OnPressEscapeKey(self):
  447.         self.Close()
  448.         return True
  449.  
  450.     def RefreshMobile(self):
  451.         global MOBILE
  452.         if not MOBILE:
  453.             return
  454.  
  455.         if player.HasMobilePhoneNumber():
  456.             self.inputMobileButton.Hide()
  457.             self.deleteMobileButton.Show()
  458.         else:
  459.             self.inputMobileButton.Show()
  460.             self.deleteMobileButton.Hide()
  461.  
  462.     def OnMobileAuthority(self):
  463.         global MOBILE
  464.         if not MOBILE:
  465.             return
  466.  
  467.         import uiCommon
  468.         inputDialog = uiCommon.InputDialogWithDescription()
  469.         inputDialog.SetTitle(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_TITLE)
  470.         inputDialog.SetDescription(localeInfo.MESSENGER_INPUT_MOBILE_AUTHORITY_DESCRIPTION)
  471.         inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileAuthorityCode))
  472.         inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
  473.         inputDialog.SetMaxLength(4)
  474.         inputDialog.SetBoardWidth(310)
  475.         inputDialog.Open()
  476.         self.inputDialog = inputDialog
  477.  
  478.     def RefreshBlock(self):
  479.         global blockMode
  480.         for i in xrange(len(self.blockButtonList)):
  481.             if 0 != (blockMode & (1 << i)):
  482.                 self.blockButtonList[i].Down()
  483.             else:
  484.                 self.blockButtonList[i].SetUp()
  485.  
  486.     def RefreshViewChat(self):
  487.         if systemSetting.IsViewChat():
  488.             self.viewChatButtonList[0].Down()
  489.             self.viewChatButtonList[1].SetUp()
  490.         else:
  491.             self.viewChatButtonList[0].SetUp()
  492.             self.viewChatButtonList[1].Down()
  493.  
  494.     def RefreshAlwaysShowName(self):
  495.         if systemSetting.IsAlwaysShowName():
  496.             self.alwaysShowNameButtonList[0].Down()
  497.             self.alwaysShowNameButtonList[1].SetUp()
  498.         else:
  499.             self.alwaysShowNameButtonList[0].SetUp()
  500.             self.alwaysShowNameButtonList[1].Down()
  501.  
  502.     def RefreshShowDamage(self):
  503.         if systemSetting.IsShowDamage():
  504.             self.showDamageButtonList[0].Down()
  505.             self.showDamageButtonList[1].SetUp()
  506.         else:
  507.             self.showDamageButtonList[0].SetUp()
  508.             self.showDamageButtonList[1].Down()
  509.  
  510.     def RefreshShowSalesText(self):
  511.         if systemSetting.IsShowSalesText():
  512.             self.showsalesTextButtonList[0].Down()
  513.             self.showsalesTextButtonList[1].SetUp()
  514.         else:
  515.             self.showsalesTextButtonList[0].SetUp()
  516.             self.showsalesTextButtonList[1].Down()
  517.  
  518.     def RefreshShowMobInfo(self):
  519.         if app.WJ_SHOW_MOB_INFO:
  520.             if systemSetting.IsShowMobLevel():
  521.                 self.showMobInfoButtonList[0].Down()
  522.             else:
  523.                 self.showMobInfoButtonList[0].SetUp()
  524.  
  525.             if systemSetting.IsShowMobAIFlag():
  526.                 self.showMobInfoButtonList[1].Down()
  527.             else:
  528.                 self.showMobInfoButtonList[1].SetUp()
  529.  
  530.     def OnBlockMode(self, mode):
  531.         global blockMode
  532.         blockMode = mode
  533.         self.RefreshBlock()
  534.  
  535.     def Show(self):
  536.         self.RefreshMobile()
  537.         self.RefreshBlock()
  538.         ui.ScriptWindow.Show(self)
  539.  
  540.     def Close(self):
  541.         self.Hide()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement