Facebook
From Reliable Hamster, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 305
  1. import os
  2. import app
  3. import dbg
  4. import grp
  5. import item
  6. import background
  7. import chr
  8. import chrmgr
  9. import player
  10. import snd
  11. import chat
  12. import textTail
  13. import snd
  14. import net
  15. import effect
  16. import wndMgr
  17. import fly
  18. import systemSetting
  19. import quest
  20. import guild
  21. import skill
  22. import messenger
  23. import localeInfo
  24. import constInfo
  25. import exchange
  26. import ime
  27.  
  28. import ui
  29. import uiCommon
  30. import uiPhaseCurtain
  31. import uiMapNameShower
  32. import uiAffectShower
  33. import uiPlayerGauge
  34. import uiCharacter
  35. import uiTarget
  36. import uiteleport
  37. import event
  38. import uipoli  
  39. import uiboost  
  40. import uiBonus
  41. import uidaily
  42. import uiPosition
  43. import uiTombola
  44.  
  45. # PRIVATE_SHOP_PRICE_LIST
  46. import uiPrivateShopBuilder
  47. # END_OF_PRIVATE_SHOP_PRICE_LIST
  48.  
  49. import mouseModule
  50. import consoleModule
  51. import localeInfo
  52.  
  53. import playerSettingModule
  54. import interfaceModule
  55.  
  56. import musicInfo
  57. import debugInfo
  58. import stringCommander
  59.  
  60. from _weakref import proxy
  61.  
  62. # TEXTTAIL_LIVINGTIME_CONTROL
  63. #if localeInfo.IsJAPAN():
  64. #       app.SetTextTailLivingTime(8.0)
  65. # END_OF_TEXTTAIL_LIVINGTIME_CONTROL
  66.  
  67. # SCREENSHOT_CWDSAVE
  68. SCREENSHOT_CWDSAVE = False
  69. SCREENSHOT_DIR = None
  70.  
  71. if localeInfo.IsEUROPE():
  72.         SCREENSHOT_CWDSAVE = True
  73.  
  74. if localeInfo.IsCIBN10():
  75.         SCREENSHOT_CWDSAVE = False
  76.         SCREENSHOT_DIR = "YT2W"
  77.  
  78. cameraDistance = 1550.0
  79. cameraPitch = 27.0
  80. cameraRotation = 0.0
  81. cameraHeight = 100.0
  82.  
  83. testAlignment = 0
  84.  
  85. class GameWindow(ui.ScriptWindow):
  86.         def __init__(self, stream):
  87.                 self.wndDaily = None
  88.                 self.wndDaily = uidaily.DailyWindow()
  89.                 self.wndBonus = uiBonus.BonusWindow()
  90.                 self.SklepP = uipoli.PoliShop()
  91.                 self.BoostWindow = uiboost.BoostWindow()
  92.                 ui.ScriptWindow.__init__(self, "GAME")
  93.                 self.SetWindowName("game")
  94.                 net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
  95.                 player.SetGameWindow(self)
  96.                 constInfo.wndTombola = uiTombola.TombolaWindow()
  97.  
  98.                 self.quickSlotPageIndex = 0
  99.                 self.lastPKModeSendedTime = 0
  100.                 self.pressNumber = None
  101.  
  102.                 self.guildWarQuestionDialog = None
  103.                 self.interface = None
  104.                 self.targetBoard = None
  105.                 self.console = None
  106.                 self.mapNameShower = None
  107.                 self.affectShower = None
  108.                 self.playerGauge = None
  109.  
  110.                 self.stream=stream
  111.                 self.interface = interfaceModule.Interface()
  112.                 self.interface.MakeInterface()
  113.                 self.interface.ShowDefaultWindows()
  114.  
  115.                 self.curtain = uiPhaseCurtain.PhaseCurtain()
  116.                 self.curtain.speed = 0.03
  117.                 self.curtain.Hide()
  118.  
  119.                 self.targetBoard = uiTarget.TargetBoard()
  120.                 self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
  121.                 self.targetBoard.Hide()
  122.  
  123.                 self.console = consoleModule.ConsoleWindow()
  124.                 self.console.BindGameClass(self)
  125.                 self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
  126.                 self.console.Hide()
  127.  
  128.                 self.mapNameShower = uiMapNameShower.MapNameShower()
  129.                 self.affectShower = uiAffectShower.AffectShower()
  130.                 self.wndPosition = uiPosition.PositionWindow()
  131.  
  132.                 self.playerGauge = uiPlayerGauge.PlayerGauge(self)
  133.                 self.playerGauge.Hide()
  134.  
  135.                 #wj 2014.1.2. ESCŰ�� ���� �� �켱��8�� DropQuestionDialog�� ��� ������. ���� ó=�� itemDropQuestionDialog�� ����Ǿ� ���� �ʾ� ERROR�� �߻��Ͽ� init���� ����� ���ÿ� �ʱ�ȭ ��Ŵ.
  136.                 self.itemDropQuestionDialog = None
  137.  
  138.                 self.__SetQuickSlotMode()
  139.  
  140.                 self.__ServerCommand_Build()
  141.                 self.__ProcessPreservedServerCommand()
  142.                 self.teleport = uiteleport.TeleportWindow()
  143.                 self.ClickBoostWindow = uiboost.BoostWindow()
  144.  
  145.         def __del__(self):
  146.                 player.SetGameWindow(0)
  147.                 net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
  148.                 ui.ScriptWindow.__del__(self)
  149.  
  150.         def Open(self):
  151.                 app.SetFrameSkip(1)
  152.  
  153.                 self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  154.  
  155.                 self.quickSlotPageIndex = 0
  156.                 self.PickingCharacterIndex = -1
  157.                 self.PickingItemIndex = -1
  158.                 self.consoleEnable = False
  159.                 self.isShowDebugInfo = False
  160.                 self.ShowNameFlag = False
  161.  
  162.                 self.enableXMasBoom = False
  163.                 self.startTimeXMasBoom = 0.0
  164.                 self.indexXMasBoom = 0
  165.  
  166.                 global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  167.  
  168.                 app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
  169.  
  170.                 constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
  171.                 constInfo.SET_DEFAULT_CHRNAME_COLOR()
  172.                 constInfo.SET_DEFAULT_FOG_LEVEL()
  173.                 constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
  174.                 constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
  175.                 constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
  176.  
  177.                 # TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  178.                 constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
  179.                 # END_OF_TWO_HANDED_WEAPON_ATTACK_SPEED_UP
  180.  
  181.                 import event
  182.                 event.SetLeftTimeString(localeInfo.UI_LEFT_TIME)
  183.  
  184.                 textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
  185.  
  186.                 if constInfo.PVPMODE_TEST_ENABLE:
  187.                         self.testPKMode = ui.TextLine()
  188.                         self.testPKMode.SetFontName(localeInfo.UI_DEF_FONT)
  189.                         self.testPKMode.SetPosition(0, 15)
  190.                         self.testPKMode.SetWindowHorizontalAlignCenter()
  191.                         self.testPKMode.SetHorizontalAlignCenter()
  192.                         self.testPKMode.SetFeather()
  193.                         self.testPKMode.SetOutline()
  194.                         self.testPKMode.Show()
  195.  
  196.                         self.testAlignment = ui.TextLine()
  197.                         self.testAlignment.SetFontName(localeInfo.UI_DEF_FONT)
  198.                         self.testAlignment.SetPosition(0, 35)
  199.                         self.testAlignment.SetWindowHorizontalAlignCenter()
  200.                         self.testAlignment.SetHorizontalAlignCenter()
  201.                         self.testAlignment.SetFeather()
  202.                         self.testAlignment.SetOutline()
  203.                         self.testAlignment.Show()
  204.  
  205.                 self.__BuildKeyDict()
  206.                 self.__BuildDebugInfo()
  207.  
  208.                 # PRIVATE_SHOP_PRICE_LIST
  209.                 uiPrivateShopBuilder.Clear()
  210.                 # END_OF_PRIVATE_SHOP_PRICE_LIST
  211.  
  212.                 # UNKNOWN_UPDATE
  213.                 exchange.InitTrading()
  214.                 # END_OF_UNKNOWN_UPDATE
  215.  
  216.  
  217.                 ## Sound
  218.                 snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
  219.                 snd.SetSoundVolume(systemSetting.GetSoundVolume())
  220.  
  221.                 netFieldMusicFileName = net.GetFieldMusicFileName()
  222.                 if netFieldMusicFileName:
  223.                         snd.FadeInMusic("BGM/" + netFieldMusicFileName)
  224.                 elif musicInfo.fieldMusic != "":
  225.                         snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  226.  
  227.                 self.__SetQuickSlotMode()
  228.                 self.__SelectQuickPage(self.quickSlotPageIndex)
  229.  
  230.                 self.SetFocus()
  231.                 self.Show()
  232.                 app.ShowCursor()
  233.  
  234.                 net.SendEnterGamePacket()
  235.  
  236.                 # START_GAME_ERROR_EXIT
  237.                 try:
  238.                         self.StartGame()
  239.                 except:
  240.                         import exception
  241.                         exception.Abort("GameWindow.Open")
  242.                 # END_OF_START_GAME_ERROR_EXIT
  243.  
  244.                 # NPC�� ť��ý���8�� ���� �� �ִ� �����۵��� ���; ij��
  245.                 # ex) cubeInformation[20383] = [ {"rewordVNUM": 72723, "rewordCount": 1, "materialInfo": "101,1&102,2", "price": 999 }, ... ]
  246.                 self.cubeInformation = {}
  247.                 self.currentCubeNPC = 0
  248.  
  249.         def Close(self):
  250.                 self.Hide()
  251.  
  252.                 global cameraDistance, cameraPitch, cameraRotation, cameraHeight
  253.                 (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
  254.  
  255.                 if musicInfo.fieldMusic != "":
  256.                         snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
  257.  
  258.                 self.onPressKeyDict = None
  259.                 self.onClickKeyDict = None
  260.                 self.wndDaily = None
  261.  
  262.                 chat.Close()
  263.                 snd.StopAllSound()
  264.                 grp.InitScreenEffect()
  265.                 chr.Destroy()
  266.                 textTail.Clear()
  267.                 quest.Clear()
  268.                 background.Destroy()
  269.                 guild.Destroy()
  270.                 messenger.Destroy()
  271.                 skill.ClearSkillData()
  272.                 wndMgr.Unlock()
  273.                 constInfo.wndTombola.Close()
  274.                 mouseModule.mouseController.DeattachObject()
  275.  
  276.                 if self.guildWarQuestionDialog:
  277.                         self.guildWarQuestionDialog.Close()
  278.  
  279.                 self.guildNameBoard = None
  280.                 self.partyRequestQuestionDialog = None
  281.                 self.partyInviteQuestionDialog = None
  282.                 self.guildInviteQuestionDialog = None
  283.                 self.guildWarQuestionDialog = None
  284.                 self.messengerAddFriendQuestion = None
  285.  
  286.                 # UNKNOWN_UPDATE
  287.                 self.itemDropQuestionDialog = None
  288.                 # END_OF_UNKNOWN_UPDATE
  289.  
  290.                 # QUEST_CONFIRM
  291.                 self.confirmDialog = None
  292.                 # END_OF_QUEST_CONFIRM
  293.  
  294.                 self.PrintCoord = None
  295.                 self.FrameRate = None
  296.                 self.Pitch = None
  297.                 self.Splat = None
  298.                 self.TextureNum = None
  299.                 self.ObjectNum = None
  300.                 self.ViewDistance = None
  301.                 self.PrintMousePos = None
  302.  
  303.                 self.ClearDictionary()
  304.  
  305.                 self.playerGauge = None
  306.                 self.mapNameShower = None
  307.                 self.affectShower = None
  308.  
  309.                 if self.console:
  310.                         self.console.BindGameClass(0)
  311.                         self.console.Close()
  312.                         self.console=None
  313.  
  314.                 if self.targetBoard:
  315.                         self.targetBoard.Destroy()
  316.                         self.targetBoard = None
  317.  
  318.                 if self.interface:
  319.                         self.interface.HideAllWindows()
  320.                         self.interface.Close()
  321.                         self.interface=None
  322.  
  323.                 player.ClearSkillDict()
  324.                 player.ResetCameraRotation()
  325.  
  326.                 self.KillFocus()
  327.                 app.HideCursor()
  328.                
  329.                 if self.teleport.IsShow():
  330.                         self.teleport.Open()
  331.  
  332.                 print "---------------------------------------------------------------------------- CLOSE GAME WINDOW"
  333.  
  334.         def __BuildKeyDict(self):
  335.                 onPressKeyDict = {}
  336.  
  337.                 ##PressKey �� ������ �ִ� ���� ��� ���Ǵ� Ű�̴�.
  338.  
  339.                 ## ���� ����Ű ��Կ� �̿�ȴ�.(���� ���ڵ鵵 �� ���Կ� ����)
  340.                 ## F12 �� Ŭ�� ���׿� Ű�̹Ƿ� ���� �ʴ� �� �t�.
  341.                 onPressKeyDict[app.DIK_1]       = lambda : self.__PressNumKey(1)
  342.                 onPressKeyDict[app.DIK_2]       = lambda : self.__PressNumKey(2)
  343.                 onPressKeyDict[app.DIK_3]       = lambda : self.__PressNumKey(3)
  344.                 onPressKeyDict[app.DIK_4]       = lambda : self.__PressNumKey(4)
  345.                 onPressKeyDict[app.DIK_5]       = lambda : self.__PressNumKey(5)
  346.                 onPressKeyDict[app.DIK_6]       = lambda : self.__PressNumKey(6)
  347.                 onPressKeyDict[app.DIK_7]       = lambda : self.__PressNumKey(7)
  348.                 onPressKeyDict[app.DIK_8]       = lambda : self.__PressNumKey(8)
  349.                 onPressKeyDict[app.DIK_9]       = lambda : self.__PressNumKey(9)
  350.                 onPressKeyDict[app.DIK_F1]      = lambda : self.__PressQuickSlot(4)
  351.                 onPressKeyDict[app.DIK_F2]      = lambda : self.__PressQuickSlot(5)
  352.                 onPressKeyDict[app.DIK_F3]      = lambda : self.__PressQuickSlot(6)
  353.                 onPressKeyDict[app.DIK_F4]      = lambda : self.__PressQuickSlot(7)
  354.                 onPressKeyDict[app.DIK_F5] = lambda: self.interface.wndItemShop.RequestOpen()
  355.                 onPressKeyDict[app.DIK_F8]      = lambda : self.ShowDaily()
  356.  
  357.                 onPressKeyDict[app.DIK_LALT]            = lambda : self.ShowName()
  358.                 onPressKeyDict[app.DIK_LCONTROL]        = lambda : self.ShowMouseImage()
  359.                 onPressKeyDict[app.DIK_SYSRQ]           = lambda : self.SaveScreen()
  360.                 onPressKeyDict[app.DIK_SPACE]           = lambda : self.StartAttack()
  361.  
  362.                 #ij���� �̵�Ű
  363.                 onPressKeyDict[app.DIK_UP]                      = lambda : self.MoveUp()
  364.                 onPressKeyDict[app.DIK_DOWN]            = lambda : self.MoveDown()
  365.                 onPressKeyDict[app.DIK_LEFT]            = lambda : self.MoveLeft()
  366.                 onPressKeyDict[app.DIK_RIGHT]           = lambda : self.MoveRight()
  367.                 onPressKeyDict[app.DIK_W]                       = lambda : self.MoveUp()
  368.                 onPressKeyDict[app.DIK_S]                       = lambda : self.MoveDown()
  369.                 onPressKeyDict[app.DIK_A]                       = lambda : self.MoveLeft()
  370.                 onPressKeyDict[app.DIK_D]                       = lambda : self.MoveRight()
  371.  
  372.                 onPressKeyDict[app.DIK_E]                       = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
  373.                 onPressKeyDict[app.DIK_R]                       = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
  374.                 #onPressKeyDict[app.DIK_F]                      = lambda: app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  375.                 onPressKeyDict[app.DIK_T]                       = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
  376.                 onPressKeyDict[app.DIK_G]                       = self.__PressGKey
  377.                 onPressKeyDict[app.DIK_Q]                       = self.__PressQKey
  378.  
  379.                 onPressKeyDict[app.DIK_NUMPAD9]         = lambda: app.MovieResetCamera()
  380.                 onPressKeyDict[app.DIK_NUMPAD4]         = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
  381.                 onPressKeyDict[app.DIK_NUMPAD6]         = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
  382.                 onPressKeyDict[app.DIK_PGUP]            = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
  383.                 onPressKeyDict[app.DIK_PGDN]            = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
  384.                 onPressKeyDict[app.DIK_NUMPAD8]         = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
  385.                 onPressKeyDict[app.DIK_NUMPAD2]         = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
  386.                 onPressKeyDict[app.DIK_GRAVE]           = lambda : self.PickUpItem()
  387.                 onPressKeyDict[app.DIK_Z]                       = lambda : self.PickUpItem()
  388.                 onPressKeyDict[app.DIK_TAB]                     = lambda : self.Teleport_otwarty()
  389.                 onPressKeyDict[app.DIK_C]                       = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
  390.                 onPressKeyDict[app.DIK_V]                       = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
  391.                 #onPressKeyDict[app.DIK_B]                      = lambda state = "EMOTICON": self.interface.ToggleCharacterWindow(state)
  392.                 onPressKeyDict[app.DIK_N]                       = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
  393.                 onPressKeyDict[app.DIK_I]                       = lambda : self.interface.ToggleInventoryWindow()
  394.                 onPressKeyDict[app.DIK_O]                       = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo()
  395.                 onPressKeyDict[app.DIK_M]                       = lambda : self.interface.PressMKey()
  396.                 #onPressKeyDict[app.DIK_H]                      = lambda : self.interface.OpenHelpWindow()
  397.                 onPressKeyDict[app.DIK_ADD]                     = lambda : self.interface.MiniMapScaleUp()
  398.                 onPressKeyDict[app.DIK_SUBTRACT]        = lambda : self.interface.MiniMapScaleDown()
  399.                 onPressKeyDict[app.DIK_L]                       = lambda : self.interface.ToggleChatLogWindow()
  400.                 onPressKeyDict[app.DIK_LSHIFT]          = lambda : self.__SetQuickPageMode()
  401.  
  402.                 onPressKeyDict[app.DIK_J]                       = lambda : self.__PressJKey()
  403.                 onPressKeyDict[app.DIK_X]                       = lambda : self.__PressXKey()
  404.                 onPressKeyDict[app.DIK_H]                       = lambda : self.__PressHKey()
  405.                 onPressKeyDict[app.DIK_B]                       = lambda : self.__PressBKey()
  406.                 onPressKeyDict[app.DIK_F]                       = lambda : self.__PressFKey()
  407.                 onPressKeyDict[app.DIK_F6]          = lambda : self.ClickPoliShopButton()
  408. #               onPressKeyDict[app.DIK_F7]                      = lambda : self.ShowPositionWindow()
  409.  
  410.                 # CUBE_TEST
  411.                 #onPressKeyDict[app.DIK_K]                      = lambda : self.interface.OpenCubeWindow()
  412.                 # CUBE_TEST_END
  413.  
  414.                 self.onPressKeyDict = onPressKeyDict
  415.  
  416.                 onClickKeyDict = {}
  417.                 onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
  418.                 onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
  419.                 onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
  420.                 onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
  421.                 onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
  422.  
  423.                 onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
  424.                 onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
  425.                 onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
  426.                 onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
  427.                 onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
  428.                 onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
  429.                 onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  430.                 onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
  431.                 onClickKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_STOP)
  432.                 onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
  433.                 onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  434.                 onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
  435.                 onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  436.                 onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
  437.                 onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  438.                 onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
  439.                 onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
  440.                 onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
  441.                 onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
  442.  
  443.                 #if constInfo.PVPMODE_ACCELKEY_ENABLE:
  444.                 #       onClickKeyDict[app.DIK_B] = lambda: self.ChangePKMode()
  445.  
  446.                 self.onClickKeyDict=onClickKeyDict
  447.  
  448.         def __PressNumKey(self,num):
  449.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  450.  
  451.                         if num >= 1 and num <= 9:
  452.                                 if(chrmgr.IsPossibleEmoticon(-1)):
  453.                                         chrmgr.SetEmoticon(-1,int(num)-1)
  454.                                         net.SendEmoticon(int(num)-1)
  455.                 else:
  456.                         if num >= 1 and num <= 4:
  457.                                 self.pressNumber(num-1)
  458.  
  459.         def __ClickBKey(self):
  460.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  461.                         return
  462.                 else:
  463.                         if constInfo.PVPMODE_ACCELKEY_ENABLE:
  464.                                 self.ChangePKMode()
  465.  
  466.         def     __PressXKey(self):
  467.                 self.wndBonus.Show()
  468.                                
  469.         def     __PressJKey(self):
  470.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  471.                         if player.IsMountingHorse():
  472.                                 net.SendChatPacket("/unmount")
  473.                         else:
  474.                                 #net.SendChatPacket("/user_horse_ride")
  475.                                 if not uiPrivateShopBuilder.IsBuildingPrivateShop():
  476.                                         for i in xrange(player.INVENTORY_PAGE_SIZE*player.INVENTORY_PAGE_COUNT):
  477.                                                 if player.GetItemIndex(i) in (71114, 71116, 71118, 71120):
  478.                                                         net.SendItemUsePacket(i)
  479.                                                         break
  480.         def     __PressHKey(self):
  481.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  482.                         net.SendChatPacket("/user_horse_ride")
  483.                 else:
  484.                         self.interface.OpenHelpWindow()
  485.  
  486.         def     __PressBKey(self):
  487.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  488.                         net.SendChatPacket("/user_horse_back")
  489.                 else:
  490.                         state = "EMOTICON"
  491.                         self.interface.ToggleCharacterWindow(state)
  492.  
  493.         def     __PressFKey(self):
  494.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  495.                         net.SendChatPacket("/user_horse_feed")
  496.                 else:
  497.                         app.ZoomCamera(app.CAMERA_TO_POSITIVE)
  498.  
  499.         def __PressGKey(self):
  500.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  501.                         net.SendChatPacket("/ride")
  502.                 else:
  503.                         if self.ShowNameFlag:
  504.                                 self.interface.ToggleGuildWindow()
  505.                         else:
  506.                                 app.PitchCamera(app.CAMERA_TO_POSITIVE)
  507.  
  508.         def     __ReleaseGKey(self):
  509.                 app.PitchCamera(app.CAMERA_STOP)
  510.  
  511.         def __PressQKey(self):
  512.                 if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
  513.                         if 0==interfaceModule.IsQBHide:
  514.                                 interfaceModule.IsQBHide = 1
  515.                                 self.interface.HideAllQuestButton()
  516.                         else:
  517.                                 interfaceModule.IsQBHide = 0
  518.                                 self.interface.ShowAllQuestButton()
  519.                 else:
  520.                         app.RotateCamera(app.CAMERA_TO_NEGATIVE)
  521.  
  522.         def __SetQuickSlotMode(self):
  523.                 self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
  524.  
  525.         def __SetQuickPageMode(self):
  526.                 self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
  527.  
  528.         def __PressQuickSlot(self, localSlotIndex):
  529.                 if localeInfo.IsARABIC():
  530.                         if 0 <= localSlotIndex and localSlotIndex < 4:
  531.                                 player.RequestUseLocalQuickSlot(3-localSlotIndex)
  532.                         else:
  533.                                 player.RequestUseLocalQuickSlot(11-localSlotIndex)
  534.                 else:
  535.                         player.RequestUseLocalQuickSlot(localSlotIndex)
  536.  
  537.         def __SelectQuickPage(self, pageIndex):
  538.                 self.quickSlotPageIndex = pageIndex
  539.                 player.SetQuickPage(pageIndex)
  540.  
  541.         def ToggleDebugInfo(self):
  542.                 self.isShowDebugInfo = not self.isShowDebugInfo
  543.  
  544.                 if self.isShowDebugInfo:
  545.                         self.PrintCoord.Show()
  546.                         self.FrameRate.Show()
  547.                         self.Pitch.Show()
  548.                         self.Splat.Show()
  549.                         self.TextureNum.Show()
  550.                         self.ObjectNum.Show()
  551.                         self.ViewDistance.Show()
  552.                         self.PrintMousePos.Show()
  553.                 else:
  554.                         self.PrintCoord.Hide()
  555.                         self.FrameRate.Hide()
  556.                         self.Pitch.Hide()
  557.                         self.Splat.Hide()
  558.                         self.TextureNum.Hide()
  559.                         self.ObjectNum.Hide()
  560.                         self.ViewDistance.Hide()
  561.                         self.PrintMousePos.Hide()
  562.  
  563.         def __BuildDebugInfo(self):
  564.                 ## Character Position Coordinate
  565.                 self.PrintCoord = ui.TextLine()
  566.                 self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT)
  567.                 self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
  568.  
  569.                 ## Frame Rate
  570.                 self.FrameRate = ui.TextLine()
  571.                 self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
  572.                 self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
  573.  
  574.                 ## Camera Pitch
  575.                 self.Pitch = ui.TextLine()
  576.                 self.Pitch.SetFontName(localeInfo.UI_DEF_FONT)
  577.                 self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
  578.  
  579.                 ## Splat
  580.                 self.Splat = ui.TextLine()
  581.                 self.Splat.SetFontName(localeInfo.UI_DEF_FONT)
  582.                 self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
  583.  
  584.                 ##
  585.                 self.PrintMousePos = ui.TextLine()
  586.                 self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT)
  587.                 self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
  588.  
  589.                 # TextureNum
  590.                 self.TextureNum = ui.TextLine()
  591.                 self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT)
  592.                 self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
  593.  
  594.                 # �:�gƮ �׸��� ����
  595.                 self.ObjectNum = ui.TextLine()
  596.                 self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT)
  597.                 self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120)
  598.  
  599.                 # �þ߰Ÿ�
  600.                 self.ViewDistance = ui.TextLine()
  601.                 self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT)
  602.                 self.ViewDistance.SetPosition(0, 0)
  603.  
  604.         def __NotifyError(self, msg):
  605.                 chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
  606.  
  607.         def ChangePKMode(self):
  608.  
  609.                 if not app.IsPressed(app.DIK_LCONTROL):
  610.                         return
  611.  
  612.                 if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
  613.                         self.__NotifyError(localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
  614.                         return
  615.  
  616.                 curTime = app.GetTime()
  617.                 if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
  618.                         return
  619.  
  620.                 self.lastPKModeSendedTime = curTime
  621.  
  622.                 curPKMode = player.GetPKMode()
  623.                 nextPKMode = curPKMode + 1
  624.                 if nextPKMode == player.PK_MODE_PROTECT:
  625.                         if 0 == player.GetGuildID():
  626.                                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
  627.                                 nextPKMode = 0
  628.                         else:
  629.                                 nextPKMode = player.PK_MODE_GUILD
  630.  
  631.                 elif nextPKMode == player.PK_MODE_MAX_NUM:
  632.                         nextPKMode = 0
  633.  
  634.                 net.SendChatPacket("/PKMode " + str(nextPKMode))
  635.                 print "/PKMode " + str(nextPKMode)
  636.  
  637.         def OnChangePKMode(self):
  638.  
  639.                 self.interface.OnChangePKMode()
  640.  
  641.                 try:
  642.                         self.__NotifyError(localeInfo.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
  643.                 except KeyError:
  644.                         print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
  645.  
  646.                 if constInfo.PVPMODE_TEST_ENABLE:
  647.                         curPKMode = player.GetPKMode()
  648.                         alignment, grade = chr.testGetPKData()
  649.                         self.pkModeNameDict = { 0 : "PEACE", 1 : "REVENGE", 2 : "FREE", 3 : "PROTECT", }
  650.                         self.testPKMode.SetText("Current PK Mode : " + self.pkModeNameDict.get(curPKMode, "UNKNOWN"))
  651.                         self.testAlignment.SetText("Current Alignment : " + str(alignment) + " (" + localeInfo.TITLE_NAME_LIST[grade] + ")")
  652.  
  653.         ###############################################################################################
  654.         ###############################################################################################
  655.         ## Game Callback Functions
  656.  
  657.         # Start
  658.         def StartGame(self):
  659.                 self.RefreshInventory()
  660.                 self.RefreshEquipment()
  661.                 self.RefreshCharacter()
  662.                 self.RefreshSkill()
  663.  
  664.         # Refresh
  665.         def CheckGameButton(self):
  666.                 if self.interface:
  667.                         self.interface.CheckGameButton()
  668.  
  669.         def RefreshAlignment(self):
  670.                 self.interface.RefreshAlignment()
  671.  
  672.         def RefreshStatus(self):
  673.                 self.CheckGameButton()
  674.  
  675.                 if self.interface:
  676.                         self.interface.RefreshStatus()
  677.  
  678.                 if self.playerGauge:
  679.                         self.playerGauge.RefreshGauge()
  680.  
  681.         def RefreshStamina(self):
  682.                 self.interface.RefreshStamina()
  683.  
  684.         def RefreshSkill(self):
  685.                 self.CheckGameButton()
  686.                 if self.interface:
  687.                         self.interface.RefreshSkill()
  688.  
  689.         def RefreshQuest(self):
  690.                 self.interface.RefreshQuest()
  691.  
  692.         def RefreshMessenger(self):
  693.                 self.interface.RefreshMessenger()
  694.  
  695.         def RefreshGuildInfoPage(self):
  696.                 self.interface.RefreshGuildInfoPage()
  697.  
  698.         def RefreshGuildBoardPage(self):
  699.                 self.interface.RefreshGuildBoardPage()
  700.  
  701.         def RefreshGuildMemberPage(self):
  702.                 self.interface.RefreshGuildMemberPage()
  703.  
  704.         def RefreshGuildMemberPageGradeComboBox(self):
  705.                 self.interface.RefreshGuildMemberPageGradeComboBox()
  706.  
  707.         def RefreshGuildSkillPage(self):
  708.                 self.interface.RefreshGuildSkillPage()
  709.  
  710.         def RefreshGuildGradePage(self):
  711.                 self.interface.RefreshGuildGradePage()
  712.  
  713.         def RefreshMobile(self):
  714.                 if self.interface:
  715.                         self.interface.RefreshMobile()
  716.  
  717.         def OnMobileAuthority(self):
  718.                 self.interface.OnMobileAuthority()
  719.  
  720.         def OnBlockMode(self, mode):
  721.                 self.interface.OnBlockMode(mode)
  722.  
  723.         def OpenQuestWindow(self, skin, idx):
  724.                 if constInfo.CApiSetHide == 1:
  725.                         net.SendQuestInputStringPacket(str(constInfo.SendString))
  726.                         constInfo.CApiSetHide = 0
  727.  
  728.                 elif constInfo.INPUT_IGNORE == 0:
  729.                         self.interface.OpenQuestWindow(skin, idx)
  730.  
  731.         def AskGuildName(self):
  732.  
  733.                 guildNameBoard = uiCommon.InputDialog()
  734.                 guildNameBoard.SetTitle(localeInfo.GUILD_NAME)
  735.                 guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
  736.                 guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
  737.                 guildNameBoard.Open()
  738.  
  739.                 self.guildNameBoard = guildNameBoard
  740.  
  741.         def ConfirmGuildName(self):
  742.                 guildName = self.guildNameBoard.GetText()
  743.                 if not guildName:
  744.                         return
  745.  
  746.                 if net.IsInsultIn(guildName):
  747.                         self.PopupMessage(localeInfo.GUILD_CREATE_ERROR_INSULT_NAME)
  748.                         return
  749.  
  750.                 net.SendAnswerMakeGuildPacket(guildName)
  751.                 self.guildNameBoard.Close()
  752.                 self.guildNameBoard = None
  753.                 return True
  754.  
  755.         def CancelGuildName(self):
  756.                 self.guildNameBoard.Close()
  757.                 self.guildNameBoard = None
  758.                 return True
  759.  
  760.         ## Refine
  761.         def PopupMessage(self, msg):
  762.                 self.stream.popupWindow.Close()
  763.                 self.stream.popupWindow.Open(msg, 0, localeInfo.UI_OK)
  764.  
  765.         def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
  766.                 self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
  767.  
  768.         def AppendMaterialToRefineDialog(self, vnum, count):
  769.                 self.interface.AppendMaterialToRefineDialog(vnum, count)
  770.  
  771.         def RunUseSkillEvent(self, slotIndex, coolTime):
  772.                 self.interface.OnUseSkill(slotIndex, coolTime)
  773.  
  774.         def ClearAffects(self):
  775.                 self.affectShower.ClearAffects()
  776.  
  777.         def SetAffect(self, affect):
  778.                 self.affectShower.SetAffect(affect)
  779.  
  780.         def ResetAffect(self, affect):
  781.                 self.affectShower.ResetAffect(affect)
  782.  
  783.         # UNKNOWN_UPDATE
  784.         def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
  785.                 self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
  786.                 if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  787.                         self.interface.DragonSoulActivate(type - chr.NEW_AFFECT_DRAGON_SOUL_DECK1)
  788.                 elif chr.NEW_AFFECT_DRAGON_SOUL_QUALIFIED == type:
  789.                         self.BINARY_DragonSoulGiveQuilification()
  790.  
  791.         def BINARY_NEW_RemoveAffect(self, type, pointIdx):
  792.                 self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
  793.                 if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
  794.                         self.interface.DragonSoulDeactivate()
  795.  
  796.  
  797.  
  798.         # END_OF_UNKNOWN_UPDATE
  799.  
  800.         def ActivateSkillSlot(self, slotIndex):
  801.                 if self.interface:
  802.                         self.interface.OnActivateSkill(slotIndex)
  803.  
  804.         def DeactivateSkillSlot(self, slotIndex):
  805.                 if self.interface:
  806.                         self.interface.OnDeactivateSkill(slotIndex)
  807.  
  808.         def RefreshEquipment(self):
  809.                 if self.interface:
  810.                         self.interface.RefreshInventory()
  811.  
  812.         def RefreshInventory(self):
  813.                 if self.interface:
  814.                         self.interface.RefreshInventory()
  815.  
  816.         def RefreshCharacter(self):
  817.                 if self.interface:
  818.                         self.interface.RefreshCharacter()
  819.  
  820.         def OnGameOver(self):
  821.                 self.CloseTargetBoard()
  822.                 self.OpenRestartDialog()
  823.  
  824.         def OpenRestartDialog(self):
  825.                 self.interface.OpenRestartDialog()
  826.  
  827.         def ChangeCurrentSkill(self, skillSlotNumber):
  828.                 self.interface.OnChangeCurrentSkill(skillSlotNumber)
  829.  
  830.         ## TargetBoard
  831.         def SetPCTargetBoard(self, vid, name):
  832.                 self.targetBoard.Open(vid, name)
  833.  
  834.                 if app.IsPressed(app.DIK_LCONTROL):
  835.  
  836.                         if not player.IsSameEmpire(vid):
  837.                                 return
  838.  
  839.                         if player.IsMainCharacterIndex(vid):
  840.                                 return
  841.                         elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
  842.                                 return
  843.  
  844.                         self.interface.OpenWhisperDialog(name)
  845.  
  846.  
  847.         def RefreshTargetBoardByVID(self, vid):
  848.                 self.targetBoard.RefreshByVID(vid)
  849.  
  850.         def RefreshTargetBoardByName(self, name):
  851.                 self.targetBoard.RefreshByName(name)
  852.  
  853.         def __RefreshTargetBoard(self):
  854.                 self.targetBoard.Refresh()
  855.  
  856.         def SetHPTargetBoard(self, vid, hpPercentage):
  857.                 if vid != self.targetBoard.GetTargetVID():
  858.                         self.targetBoard.ResetTargetBoard()
  859.                         self.targetBoard.SetEnemyVID(vid)
  860.  
  861.                 self.targetBoard.SetHP(hpPercentage)
  862.                 self.targetBoard.Show()
  863.  
  864.         def CloseTargetBoardIfDifferent(self, vid):
  865.                 if vid != self.targetBoard.GetTargetVID():
  866.                         self.targetBoard.Close()
  867.  
  868.         def CloseTargetBoard(self):
  869.                 self.targetBoard.Close()
  870.  
  871.         ## View Equipment
  872.         def OpenEquipmentDialog(self, vid):
  873.                 self.interface.OpenEquipmentDialog(vid)
  874.  
  875.         def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  876.                 self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
  877.  
  878.         def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  879.                 self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
  880.  
  881.         def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  882.                 self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
  883.  
  884.         # SHOW_LOCAL_MAP_NAME
  885.         def ShowMapName(self, mapName, x, y):
  886.  
  887.                 if self.mapNameShower:
  888.                         self.mapNameShower.ShowMapName(mapName, x, y)
  889.  
  890.                 if self.interface:
  891.                         self.interface.SetMapName(mapName)
  892.         # END_OF_SHOW_LOCAL_MAP_NAME
  893.  
  894.         def BINARY_OpenAtlasWindow(self):
  895.                 self.interface.BINARY_OpenAtlasWindow()
  896.  
  897.         ## Chat
  898.         def OnRecvWhisper(self, mode, name, line):
  899.                 if mode == chat.WHISPER_TYPE_GM:
  900.                         self.interface.RegisterGameMasterName(name)
  901.                 chat.AppendWhisper(mode, name, line)
  902.                 self.interface.RecvWhisper(name)
  903.  
  904.         def OnRecvWhisperSystemMessage(self, mode, name, line):
  905.                 chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
  906.                 self.interface.RecvWhisper(name)
  907.  
  908.         def OnRecvWhisperError(self, mode, name, line):
  909.                 if localeInfo.WHISPER_ERROR.has_key(mode):
  910.                         chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name))
  911.                 else:
  912.                         chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
  913.                 self.interface.RecvWhisper(name)
  914.  
  915.         def RecvWhisper(self, name):
  916.                 self.interface.RecvWhisper(name)
  917.  
  918.         def OnPickMoney(self, money):
  919.                 self.interface.OnPickMoneyNew(money)
  920.  
  921.         def OnShopError(self, type):
  922.                 try:
  923.                         self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type])
  924.                 except KeyError:
  925.                         self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type))
  926.  
  927.         def OnSafeBoxError(self):
  928.                 self.PopupMessage(localeInfo.SAFEBOX_ERROR)
  929.  
  930.         def OnFishingSuccess(self, isFish, fishName):
  931.                 chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000)
  932.  
  933.         # ADD_FISHING_MESSAGE
  934.         def OnFishingNotifyUnknown(self):
  935.                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN)
  936.  
  937.         def OnFishingWrongPlace(self):
  938.                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE)
  939.         # END_OF_ADD_FISHING_MESSAGE
  940.  
  941.         def OnFishingNotify(self, isFish, fishName):
  942.                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName))
  943.  
  944.         def OnFishingFailure(self):
  945.                 chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000)
  946.  
  947.         def OnCannotPickItem(self):
  948.                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM)
  949.  
  950.         # MINING
  951.         def OnCannotMining(self):
  952.                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
  953.         # END_OF_MINING
  954.  
  955.         def OnCannotUseSkill(self, vid, type):
  956.                 if localeInfo.USE_SKILL_ERROR_TAIL_DICT.has_key(type):
  957.                         textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type])
  958.  
  959.                 if localeInfo.USE_SKILL_ERROR_CHAT_DICT.has_key(type):
  960.                         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_SKILL_ERROR_CHAT_DICT[type])
  961.  
  962.         def     OnCannotShotError(self, vid, type):
  963.                 textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type)))
  964.  
  965.         ## PointReset
  966.         def StartPointReset(self):
  967.                 self.interface.OpenPointResetDialog()
  968.  
  969.         ## Shop
  970.         if app.ENABLE_OFFLINE_SHOP:
  971.                 def StartShop(self, vid, owner_vid, grid_type):
  972.                         self.interface.OpenShopDialog(vid, owner_vid, grid_type)
  973.         else:
  974.                 def StartShop(self, vid):
  975.                         self.interface.OpenShopDialog(vid)
  976.  
  977.         def EndShop(self):
  978.                 self.interface.CloseShopDialog()
  979.  
  980.         def RefreshShop(self):
  981.                 self.interface.RefreshShopDialog()
  982.         if app.ENABLE_OFFLINE_SHOP:
  983.                 def RefreshShopMoney(self):
  984.                         self.interface.RefreshShopDialogMoney()
  985.  
  986.         def SetShopSellingPrice(self, Price):
  987.                 pass
  988.  
  989.         ## Exchange
  990.         def StartExchange(self):
  991.                 self.interface.StartExchange()
  992.  
  993.         def EndExchange(self):
  994.                 self.interface.EndExchange()
  995.  
  996.         def RefreshExchange(self):
  997.                 self.interface.RefreshExchange()
  998.  
  999.         ## Party
  1000.         def RecvPartyInviteQuestion(self, leaderVID, leaderName):
  1001.                 partyInviteQuestionDialog = uiCommon.QuestionDialog()
  1002.                 partyInviteQuestionDialog.SetText(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
  1003.                 partyInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerPartyInvite(arg))
  1004.                 partyInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerPartyInvite(arg))
  1005.                 partyInviteQuestionDialog.Open()
  1006.                 partyInviteQuestionDialog.partyLeaderVID = leaderVID
  1007.                 self.partyInviteQuestionDialog = partyInviteQuestionDialog
  1008.  
  1009.         def AnswerPartyInvite(self, answer):
  1010.  
  1011.                 if not self.partyInviteQuestionDialog:
  1012.                         return
  1013.  
  1014.                 partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
  1015.  
  1016.                 distance = player.GetCharacterDistance(partyLeaderVID)
  1017.                 if distance < 0.0 or distance > 5000:
  1018.                         answer = False
  1019.  
  1020.                 net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
  1021.  
  1022.                 self.partyInviteQuestionDialog.Close()
  1023.                 self.partyInviteQuestionDialog = None
  1024.  
  1025.         def AddPartyMember(self, pid, name):
  1026.                 self.interface.AddPartyMember(pid, name)
  1027.  
  1028.         def UpdatePartyMemberInfo(self, pid):
  1029.                 self.interface.UpdatePartyMemberInfo(pid)
  1030.  
  1031.         def RemovePartyMember(self, pid):
  1032.                 self.interface.RemovePartyMember(pid)
  1033.                 self.__RefreshTargetBoard()
  1034.  
  1035.         def LinkPartyMember(self, pid, vid):
  1036.                 self.interface.LinkPartyMember(pid, vid)
  1037.  
  1038.         def UnlinkPartyMember(self, pid):
  1039.                 self.interface.UnlinkPartyMember(pid)
  1040.  
  1041.         def UnlinkAllPartyMember(self):
  1042.                 self.interface.UnlinkAllPartyMember()
  1043.  
  1044.         def ExitParty(self):
  1045.                 self.interface.ExitParty()
  1046.                 self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
  1047.  
  1048.         def ChangePartyParameter(self, distributionMode):
  1049.                 self.interface.ChangePartyParameter(distributionMode)
  1050.  
  1051.         ## Messenger
  1052.         def OnMessengerAddFriendQuestion(self, name):
  1053.                 messengerAddFriendQuestion = uiCommon.QuestionDialog2()
  1054.                 messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
  1055.                 messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
  1056.                 messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
  1057.                 messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
  1058.                 messengerAddFriendQuestion.Open()
  1059.                 messengerAddFriendQuestion.name = name
  1060.                 self.messengerAddFriendQuestion = messengerAddFriendQuestion
  1061.  
  1062.         def OnAcceptAddFriend(self):
  1063.                 name = self.messengerAddFriendQuestion.name
  1064.                 net.SendChatPacket("/messenger_auth y " + name)
  1065.                 self.OnCloseAddFriendQuestionDialog()
  1066.                 return True
  1067.  
  1068.         def OnDenyAddFriend(self):
  1069.                 name = self.messengerAddFriendQuestion.name
  1070.                 net.SendChatPacket("/messenger_auth n " + name)
  1071.                 self.OnCloseAddFriendQuestionDialog()
  1072.                 return True
  1073.  
  1074.         def OnCloseAddFriendQuestionDialog(self):
  1075.                 self.messengerAddFriendQuestion.Close()
  1076.                 self.messengerAddFriendQuestion = None
  1077.                 return True
  1078.  
  1079.         ## SafeBox
  1080.         def OpenSafeboxWindow(self, size):
  1081.                 self.interface.OpenSafeboxWindow(size)
  1082.  
  1083.         def RefreshSafebox(self):
  1084.                 self.interface.RefreshSafebox()
  1085.  
  1086.         def RefreshSafeboxMoney(self):
  1087.                 self.interface.RefreshSafeboxMoney()
  1088.         if app.ENABLE_OFFLINE_SHOP:
  1089.                 def AppendOfflineShopInfo(self, name, vid, mapIdx, x, y):
  1090.                         self.interface.AppendOfflineShopData(name, vid, mapIdx, x, y)
  1091.  
  1092.         # ITEM_MALL
  1093.         def OpenMallWindow(self, size):
  1094.                 self.interface.OpenMallWindow(size)
  1095.  
  1096.         def RefreshMall(self):
  1097.                 self.interface.RefreshMall()
  1098.         # END_OF_ITEM_MALL
  1099.  
  1100.         ## Guild
  1101.         def RecvGuildInviteQuestion(self, guildID, guildName):
  1102.                 guildInviteQuestionDialog = uiCommon.QuestionDialog()
  1103.                 guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN)
  1104.                 guildInviteQuestionDialog.SetAcceptEvent(lambda arg=True: self.AnswerGuildInvite(arg))
  1105.                 guildInviteQuestionDialog.SetCancelEvent(lambda arg=False: self.AnswerGuildInvite(arg))
  1106.                 guildInviteQuestionDialog.Open()
  1107.                 guildInviteQuestionDialog.guildID = guildID
  1108.                 self.guildInviteQuestionDialog = guildInviteQuestionDialog
  1109.  
  1110.         def AnswerGuildInvite(self, answer):
  1111.  
  1112.                 if not self.guildInviteQuestionDialog:
  1113.                         return
  1114.  
  1115.                 guildLeaderVID = self.guildInviteQuestionDialog.guildID
  1116.                 net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
  1117.  
  1118.                 self.guildInviteQuestionDialog.Close()
  1119.                 self.guildInviteQuestionDialog = None
  1120.  
  1121.  
  1122.         def DeleteGuild(self):
  1123.                 self.interface.DeleteGuild()
  1124.  
  1125.         ## Clock
  1126.         def ShowClock(self, second):
  1127.                 self.interface.ShowClock(second)
  1128.  
  1129.         def HideClock(self):
  1130.                 self.interface.HideClock()
  1131.  
  1132.         ## Emotion
  1133.         def BINARY_ActEmotion(self, emotionIndex):
  1134.                 if self.interface.wndCharacter:
  1135.                         self.interface.wndCharacter.ActEmotion(emotionIndex)
  1136.  
  1137.         ###############################################################################################
  1138.         ###############################################################################################
  1139.         ## Keyboard Functions
  1140.  
  1141.         def CheckFocus(self):
  1142.                 if False == self.IsFocus():
  1143.                         if True == self.interface.IsOpenChat():
  1144.                                 self.interface.ToggleChat()
  1145.  
  1146.                         self.SetFocus()
  1147.  
  1148.         def SaveScreen(self):
  1149.                 print "save screen"
  1150.  
  1151.                 # SCREENSHOT_CWDSAVE
  1152.                 if SCREENSHOT_CWDSAVE:
  1153.                         if not os.path.exists(os.getcwd()+os.sep+"screenshot"):
  1154.                                 os.mkdir(os.getcwd()+os.sep+"screenshot")
  1155.  
  1156.                         (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep)
  1157.                 elif SCREENSHOT_DIR:
  1158.                         (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
  1159.                 else:
  1160.                         (succeeded, name) = grp.SaveScreenShot()
  1161.                 # END_OF_SCREENSHOT_CWDSAVE
  1162.  
  1163.                 if succeeded:
  1164.                         pass
  1165.                         """
  1166.                         chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1)
  1167.                         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2)
  1168.                         """
  1169.                 else:
  1170.                         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE)
  1171.  
  1172.         def ShowName(self):
  1173.                 self.ShowNameFlag = True
  1174.                 self.playerGauge.EnableShowAlways()
  1175.                 player.SetQuickPage(self.quickSlotPageIndex+1)
  1176.  
  1177.         # ADD_ALWAYS_SHOW_NAME
  1178.         def __IsShowName(self):
  1179.  
  1180.                 if systemSetting.IsAlwaysShowName():
  1181.                         return True
  1182.  
  1183.                 if self.ShowNameFlag:
  1184.                         return True
  1185.  
  1186.                 return False
  1187.         # END_OF_ADD_ALWAYS_SHOW_NAME
  1188.  
  1189.         def HideName(self):
  1190.                 self.ShowNameFlag = False
  1191.                 self.playerGauge.DisableShowAlways()
  1192.                 player.SetQuickPage(self.quickSlotPageIndex)
  1193.  
  1194.         def ShowMouseImage(self):
  1195.                 self.interface.ShowMouseImage()
  1196.  
  1197.         def HideMouseImage(self):
  1198.                 self.interface.HideMouseImage()
  1199.  
  1200.         def StartAttack(self):
  1201.                 player.SetAttackKeyState(True)
  1202.  
  1203.         def EndAttack(self):
  1204.                 player.SetAttackKeyState(False)
  1205.  
  1206.         def MoveUp(self):
  1207.                 player.SetSingleDIKKeyState(app.DIK_UP, True)
  1208.  
  1209.         def MoveDown(self):
  1210.                 player.SetSingleDIKKeyState(app.DIK_DOWN, True)
  1211.  
  1212.         def MoveLeft(self):
  1213.                 player.SetSingleDIKKeyState(app.DIK_LEFT, True)
  1214.  
  1215.         def MoveRight(self):
  1216.                 player.SetSingleDIKKeyState(app.DIK_RIGHT, True)
  1217.  
  1218.         def StopUp(self):
  1219.                 player.SetSingleDIKKeyState(app.DIK_UP, False)
  1220.  
  1221.         def StopDown(self):
  1222.                 player.SetSingleDIKKeyState(app.DIK_DOWN, False)
  1223.  
  1224.         def StopLeft(self):
  1225.                 player.SetSingleDIKKeyState(app.DIK_LEFT, False)
  1226.  
  1227.         def StopRight(self):
  1228.                 player.SetSingleDIKKeyState(app.DIK_RIGHT, False)
  1229.  
  1230.         def PickUpItem(self):
  1231.                 player.PickCloseItem()
  1232.                
  1233.         def Teleport_otwarty(self):
  1234.                 self.teleport.Open()
  1235.  
  1236.         ###############################################################################################
  1237.         ###############################################################################################
  1238.         ## Event Handler
  1239.  
  1240.         def OnKeyDown(self, key):
  1241.                 if self.interface.wndWeb and self.interface.wndWeb.IsShow():
  1242.                         return
  1243.  
  1244.                 if key == app.DIK_ESC:
  1245.                         self.RequestDropItem(False)
  1246.                         constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1247.  
  1248.                 try:
  1249.                         self.onPressKeyDict[key]()
  1250.                 except KeyError:
  1251.                         pass
  1252.                 except:
  1253.                         raise
  1254.  
  1255.                 return True
  1256.  
  1257.         def OnKeyUp(self, key):
  1258.                 try:
  1259.                         self.onClickKeyDict[key]()
  1260.                 except KeyError:
  1261.                         pass
  1262.                 except:
  1263.                         raise
  1264.  
  1265.                 return True
  1266.  
  1267.         def OnMouseLeftButtonDown(self):
  1268.                 if self.interface.BUILD_OnMouseLeftButtonDown():
  1269.                         return
  1270.  
  1271.                 if mouseModule.mouseController.isAttached():
  1272.                         self.CheckFocus()
  1273.                 else:
  1274.                         hyperlink = ui.GetHyperlink()
  1275.                         if hyperlink:
  1276.                                 return
  1277.                         else:
  1278.                                 self.CheckFocus()
  1279.                                 player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  1280.  
  1281.                 return True
  1282.  
  1283.         def OnMouseLeftButtonUp(self):
  1284.  
  1285.                 if self.interface.BUILD_OnMouseLeftButtonUp():
  1286.                         return
  1287.  
  1288.                 if mouseModule.mouseController.isAttached():
  1289.  
  1290.                         attachedType = mouseModule.mouseController.GetAttachedType()
  1291.                         attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  1292.                         attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
  1293.                         attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
  1294.  
  1295.                         ## QuickSlot
  1296.                         if player.SLOT_TYPE_QUICK_SLOT == attachedType:
  1297.                                 player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
  1298.  
  1299.                         ## Inventory
  1300.                         elif player.SLOT_TYPE_INVENTORY == attachedType:
  1301.  
  1302.                                 if player.ITEM_MONEY == attachedItemIndex:
  1303.                                         self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
  1304.                                 else:
  1305.                                         self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1306.  
  1307.                         ## DragonSoul
  1308.                         elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1309.                                 self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
  1310.  
  1311.                         mouseModule.mouseController.DeattachObject()
  1312.  
  1313.                 else:
  1314.                         hyperlink = ui.GetHyperlink()
  1315.                         if hyperlink:
  1316.                                 if app.IsPressed(app.DIK_LALT):
  1317.                                         link = chat.GetLinkFromHyperlink(hyperlink)
  1318.                                         ime.PasteString(link)
  1319.                                 else:
  1320.                                         self.interface.MakeHyperlinkTooltip(hyperlink)
  1321.                                 return
  1322.                         else:
  1323.                                 player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  1324.  
  1325.                 #player.EndMouseWalking()
  1326.                 return True
  1327.  
  1328.         def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
  1329.                 if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1330.                         attachedInvenType = player.SlotTypeToInvenType(attachedType)
  1331.                         if True == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
  1332.                                 if player.IsEquipmentSlot(attachedItemSlotPos) and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedType:
  1333.                                         self.stream.popupWindow.Close()
  1334.                                         self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1335.                                 else:
  1336.                                         if chr.IsNPC(dstChrID):
  1337.                                                 net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
  1338.                                         else:
  1339.                                                 net.SendExchangeStartPacket(dstChrID)
  1340.                                                 net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
  1341.                         else:
  1342.                                 self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
  1343.  
  1344.         def __PutMoney(self, attachedType, attachedMoney, dstChrID):
  1345.                 if True == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
  1346.                         net.SendExchangeStartPacket(dstChrID)
  1347.                         net.SendExchangeElkAddPacket(attachedMoney)
  1348.                 else:
  1349.                         self.__DropMoney(attachedType, attachedMoney)
  1350.  
  1351.         def __DropMoney(self, attachedType, attachedMoney):
  1352.                 # PRIVATESHOP_DISABLE_ITEM_DROP - ���λ�a ���� �ִ� ���� ������ �� ����
  1353.                 if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1354.                         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1355.                         return
  1356.                 # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1357.  
  1358.                 if attachedMoney>=1000:
  1359.                         self.stream.popupWindow.Close()
  1360.                         self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK)
  1361.                         return
  1362.  
  1363.                 itemDropQuestionDialog = uiCommon.QuestionDialog()
  1364.                 itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney))
  1365.                 itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1366.                 itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1367.                 itemDropQuestionDialog.Open()
  1368.                 itemDropQuestionDialog.dropType = attachedType
  1369.                 itemDropQuestionDialog.dropCount = attachedMoney
  1370.                 itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
  1371.                 self.itemDropQuestionDialog = itemDropQuestionDialog
  1372.  
  1373.         def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
  1374.                 # PRIVATESHOP_DISABLE_ITEM_DROP - ���λ�a ���� �ִ� ���� ������ �� ����
  1375.                 if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1376.                         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1377.                         return
  1378.                 # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1379.  
  1380.                 if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
  1381.                         self.stream.popupWindow.Close()
  1382.                         self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
  1383.  
  1384.                 else:
  1385.                         if player.SLOT_TYPE_INVENTORY == attachedType:
  1386.                                 dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
  1387.  
  1388.                                 item.SelectItem(dropItemIndex)
  1389.                                 dropItemName = item.GetItemName()
  1390.  
  1391.                                 ## Question Text
  1392.                                 questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1393.  
  1394.                                 ## Dialog
  1395.                                 itemDropQuestionDialog = uiCommon.QuestionDialog()
  1396.                                 itemDropQuestionDialog.SetText(questionText)
  1397.                                 itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1398.                                 itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1399.                                 itemDropQuestionDialog.Open()
  1400.                                 itemDropQuestionDialog.dropType = attachedType
  1401.                                 itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1402.                                 itemDropQuestionDialog.dropCount = attachedItemCount
  1403.                                 self.itemDropQuestionDialog = itemDropQuestionDialog
  1404.  
  1405.                                 constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1406.                         elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
  1407.                                 dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
  1408.  
  1409.                                 item.SelectItem(dropItemIndex)
  1410.                                 dropItemName = item.GetItemName()
  1411.  
  1412.                                 ## Question Text
  1413.                                 questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
  1414.  
  1415.                                 ## Dialog
  1416.                                 itemDropQuestionDialog = uiCommon.QuestionDialog()
  1417.                                 itemDropQuestionDialog.SetText(questionText)
  1418.                                 itemDropQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDropItem(arg))
  1419.                                 itemDropQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDropItem(arg))
  1420.                                 itemDropQuestionDialog.Open()
  1421.                                 itemDropQuestionDialog.dropType = attachedType
  1422.                                 itemDropQuestionDialog.dropNumber = attachedItemSlotPos
  1423.                                 itemDropQuestionDialog.dropCount = attachedItemCount
  1424.                                 self.itemDropQuestionDialog = itemDropQuestionDialog
  1425.  
  1426.                                 constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
  1427.  
  1428.         def RequestDropItem(self, answer):
  1429.                 if not self.itemDropQuestionDialog:
  1430.                         return
  1431.  
  1432.                 if answer:
  1433.                         dropType = self.itemDropQuestionDialog.dropType
  1434.                         dropCount = self.itemDropQuestionDialog.dropCount
  1435.                         dropNumber = self.itemDropQuestionDialog.dropNumber
  1436.  
  1437.                         if player.SLOT_TYPE_INVENTORY == dropType:
  1438.                                 if dropNumber == player.ITEM_MONEY:
  1439.                                         net.SendGoldDropPacketNew(dropCount)
  1440.                                         snd.PlaySound("sound/ui/money.wav")
  1441.                                 else:
  1442.                                         # PRIVATESHOP_DISABLE_ITEM_DROP
  1443.                                         self.__SendDropItemPacket(dropNumber, dropCount)
  1444.                                         # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1445.                         elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
  1446.                                         # PRIVATESHOP_DISABLE_ITEM_DROP
  1447.                                         self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
  1448.                                         # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1449.  
  1450.                 self.itemDropQuestionDialog.Close()
  1451.                 self.itemDropQuestionDialog = None
  1452.  
  1453.                 constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
  1454.  
  1455.         # PRIVATESHOP_DISABLE_ITEM_DROP
  1456.         def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
  1457.                 if uiPrivateShopBuilder.IsBuildingPrivateShop():
  1458.                         chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
  1459.                         return
  1460.  
  1461.                 net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
  1462.         # END_OF_PRIVATESHOP_DISABLE_ITEM_DROP
  1463.  
  1464.         def OnMouseRightButtonDown(self):
  1465.  
  1466.                 self.CheckFocus()
  1467.  
  1468.                 if True == mouseModule.mouseController.isAttached():
  1469.                         mouseModule.mouseController.DeattachObject()
  1470.  
  1471.                 else:
  1472.                         player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
  1473.  
  1474.                 return True
  1475.  
  1476.         def OnMouseRightButtonUp(self):
  1477.                 if True == mouseModule.mouseController.isAttached():
  1478.                         return True
  1479.  
  1480.                 player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
  1481.                 return True
  1482.  
  1483.         def OnMouseMiddleButtonDown(self):
  1484.                 player.SetMouseMiddleButtonState(player.MBS_PRESS)
  1485.  
  1486.         def OnMouseMiddleButtonUp(self):
  1487.                 player.SetMouseMiddleButtonState(player.MBS_CLICK)
  1488.  
  1489.         def OnUpdate(self):
  1490.                 self.wndDaily.DailyUpdate()
  1491.                 app.UpdateGame()
  1492.  
  1493.                 if self.mapNameShower.IsShow():
  1494.                         self.mapNameShower.Update()
  1495.  
  1496.                 if self.isShowDebugInfo:
  1497.                         self.UpdateDebugInfo()
  1498.  
  1499.                 if self.enableXMasBoom:
  1500.                         self.__XMasBoom_Update()
  1501.  
  1502.                 self.interface.BUILD_OnUpdate()
  1503.                 self.interface.BsUpdate()
  1504.                 self.interface.BiologUpdate()
  1505.                 if app.ENABLE_OFFLINE_SHOP:
  1506.                         self.interface.OFFSHOP_OnUpdate()
  1507.  
  1508.  
  1509.         def UpdateDebugInfo(self):
  1510.                 #
  1511.                 # ij���� ��ǥ �� FPS ���
  1512.                 (x, y, z) = player.GetMainCharacterPosition()
  1513.                 nUpdateTime = app.GetUpdateTime()
  1514.                 nUpdateFPS = app.GetUpdateFPS()
  1515.                 nRenderFPS = app.GetRenderFPS()
  1516.                 nFaceCount = app.GetFaceCount()
  1517.                 fFaceSpeed = app.GetFaceSpeed()
  1518.                 nST=background.GetRenderShadowTime()
  1519.                 (fAveRT, nCurRT) =  app.GetRenderTime()
  1520.                 (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
  1521.                 (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
  1522.                 if iPatch == 0:
  1523.                         iPatch = 1
  1524.  
  1525.                 #(dwRenderedThing, dwRenderedCRC) = background.GetRenderedGraphicThingInstanceNum()
  1526.  
  1527.                 self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
  1528.                 xMouse, yMouse = wndMgr.GetMousePosition()
  1529.                 self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse))
  1530.  
  1531.                 self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
  1532.  
  1533.                 if fAveRT>1.0:
  1534.                         self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
  1535.  
  1536.                 self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
  1537.                 #self.Pitch.SetText("Pitch: %.2f" % (app.GetCameraPitch())
  1538.                 #self.TextureNum.SetText("TN : %s" % (sTextureNum))
  1539.                 #self.ObjectNum.SetText("GTI : %d, CRC : %d" % (dwRenderedThing, dwRenderedCRC))
  1540.                 self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
  1541.  
  1542.         def OnRender(self):
  1543.                 app.RenderGame()
  1544.  
  1545.                 if self.console.Console.collision:
  1546.                         background.RenderCollision()
  1547.                         chr.RenderCollision()
  1548.  
  1549.                 (x, y) = app.GetCursorPosition()
  1550.  
  1551.                 ########################
  1552.                 # Picking
  1553.                 ########################
  1554.                 textTail.UpdateAllTextTail()
  1555.  
  1556.                 if True == wndMgr.IsPickedWindow(self.hWnd):
  1557.  
  1558.                         self.PickingCharacterIndex = chr.Pick()
  1559.  
  1560.                         if -1 != self.PickingCharacterIndex:
  1561.                                 textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
  1562.                         if 0 != self.targetBoard.GetTargetVID():
  1563.                                 textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
  1564.  
  1565.                         # ADD_ALWAYS_SHOW_NAME
  1566.                         if not self.__IsShowName():
  1567.                                 self.PickingItemIndex = item.Pick()
  1568.                                 if -1 != self.PickingItemIndex:
  1569.                                         textTail.ShowItemTextTail(self.PickingItemIndex)
  1570.                         # END_OF_ADD_ALWAYS_SHOW_NAME
  1571.  
  1572.                 ## Show all name in the range
  1573.  
  1574.                 # ADD_ALWAYS_SHOW_NAME
  1575.                 if self.__IsShowName():
  1576.                         textTail.ShowAllTextTail()
  1577.                         self.PickingItemIndex = textTail.Pick(x, y)
  1578.                 # END_OF_ADD_ALWAYS_SHOW_NAME
  1579.  
  1580.                 textTail.UpdateShowingTextTail()
  1581.                 textTail.ArrangeTextTail()
  1582.                 if -1 != self.PickingItemIndex:
  1583.                         textTail.SelectItemName(self.PickingItemIndex)
  1584.  
  1585.                 grp.PopState()
  1586.                 grp.SetInterfaceRenderState()
  1587.  
  1588.                 textTail.Render()
  1589.                 textTail.HideAllTextTail()
  1590.  
  1591.         def OnPressEscapeKey(self):
  1592.                 if constInfo.wndTombola.IsShow():
  1593.                         constInfo.wndTombola.Close()
  1594.                         return
  1595.                        
  1596.                 if app.TARGET == app.GetCursor():
  1597.                         app.SetCursor(app.NORMAL)
  1598.  
  1599.                 elif True == mouseModule.mouseController.isAttached():
  1600.                         mouseModule.mouseController.DeattachObject()
  1601.  
  1602.                 else:
  1603.                         self.interface.OpenSystemDialog()
  1604.  
  1605.                 return True
  1606.  
  1607.         def OnIMEReturn(self):
  1608.                 if app.IsPressed(app.DIK_LSHIFT):
  1609.                         self.interface.OpenWhisperDialogWithoutTarget()
  1610.                 else:
  1611.                         self.interface.ToggleChat()
  1612.                 return True
  1613.  
  1614.         def OnPressExitKey(self):
  1615.                 self.interface.ToggleSystemDialog()
  1616.                 return True
  1617.  
  1618.         ## BINARY CALLBACK
  1619.         ######################################################################################
  1620.  
  1621.         # WEDDING
  1622.         def BINARY_LoverInfo(self, name, lovePoint):
  1623.                 if self.interface.wndMessenger:
  1624.                         self.interface.wndMessenger.OnAddLover(name, lovePoint)
  1625.                 if self.affectShower:
  1626.                         self.affectShower.SetLoverInfo(name, lovePoint)
  1627.  
  1628.         def BINARY_UpdateLovePoint(self, lovePoint):
  1629.                 if self.interface.wndMessenger:
  1630.                         self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
  1631.                 if self.affectShower:
  1632.                         self.affectShower.OnUpdateLovePoint(lovePoint)
  1633.         # END_OF_WEDDING
  1634.  
  1635.         # QUEST_CONFIRM
  1636.         def BINARY_OnQuestConfirm(self, msg, timeout, pid):
  1637.                 confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
  1638.                 confirmDialog.Open(msg, timeout)
  1639.                 confirmDialog.SetAcceptEvent(lambda answer=True, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1640.                 confirmDialog.SetCancelEvent(lambda answer=False, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
  1641.                 self.confirmDialog = confirmDialog
  1642.     # END_OF_QUEST_CONFIRM
  1643.  
  1644.     # GIFT command
  1645.         def Gift_Show(self):
  1646.                 self.interface.ShowGift()
  1647.  
  1648.         # CUBE
  1649.         def BINARY_Cube_Open(self, npcVNUM):
  1650.                 self.currentCubeNPC = npcVNUM
  1651.  
  1652.                 self.interface.OpenCubeWindow()
  1653.  
  1654.  
  1655.                 if npcVNUM not in self.cubeInformation:
  1656.                         net.SendChatPacket("/cube r_info")
  1657.                 else:
  1658.                         cubeInfoList = self.cubeInformation[npcVNUM]
  1659.  
  1660.                         i = 0
  1661.                         for cubeInfo in cubeInfoList:
  1662.                                 self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"])
  1663.  
  1664.                                 j = 0
  1665.                                 for materialList in cubeInfo["materialList"]:
  1666.                                         for materialInfo in materialList:
  1667.                                                 itemVnum, itemCount = materialInfo
  1668.                                                 self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount)
  1669.                                         j = j + 1
  1670.  
  1671.                                 i = i + 1
  1672.  
  1673.                         self.interface.wndCube.Refresh()
  1674.  
  1675.         def BINARY_Cube_Close(self):
  1676.                 self.interface.CloseCubeWindow()
  1677.  
  1678.         # f�ۿ� �ʿ��� ���, ����Ǵ� �ϼ�ǰ�� VNUM�� ���� d�� update
  1679.         def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
  1680.                 self.interface.UpdateCubeInfo(gold, itemVnum, count)
  1681.  
  1682.         def BINARY_Cube_Succeed(self, itemVnum, count):
  1683.                 print "ť�� f�� ����"
  1684.                 self.interface.SucceedCubeWork(itemVnum, count)
  1685.                 pass
  1686.  
  1687.         def BINARY_Cube_Failed(self):
  1688.                 print "ť�� f�� ����"
  1689.                 self.interface.FailedCubeWork()
  1690.                 pass
  1691.  
  1692.         def BINARY_Cube_ResultList(self, npcVNUM, listText):
  1693.                 # ResultList Text Format : 72723,1/72725,1/72730.1/50001,5  �̷���8�� "/" ���ڷ� ���е� ����Ʈ�� ��
  1694.                 #print listText
  1695.  
  1696.                 if npcVNUM == 0:
  1697.                         npcVNUM = self.currentCubeNPC
  1698.  
  1699.                 self.cubeInformation[npcVNUM] = []
  1700.  
  1701.                 try:
  1702.                         for eachInfoText in listText.split("/"):
  1703.                                 eachInfo = eachInfoText.split(",")
  1704.                                 itemVnum        = int(eachInfo[0])
  1705.                                 itemCount       = int(eachInfo[1])
  1706.  
  1707.                                 self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount})
  1708.                                 self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
  1709.  
  1710.                         resultCount = len(self.cubeInformation[npcVNUM])
  1711.                         requestCount = 7
  1712.                         modCount = resultCount % requestCount
  1713.                         splitCount = resultCount / requestCount
  1714.                         for i in xrange(splitCount):
  1715.                                 #print("/cube r_info %d %d" % (i * requestCount, requestCount))
  1716.                                 net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
  1717.  
  1718.                         if 0 < modCount:
  1719.                                 #print("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1720.                                 net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
  1721.  
  1722.                 except RuntimeError, msg:
  1723.                         dbg.TraceError(msg)
  1724.                         return 0
  1725.  
  1726.                 pass
  1727.  
  1728.         def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText):
  1729.                 # Material Text Format : 125,1|126,2|127,2|123,5&555,5&555,4/120000
  1730.                 try:
  1731.                         #print listText
  1732.  
  1733.                         if 3 > len(listText):
  1734.                                 dbg.TraceError("Wrong Cube Material Infomation")
  1735.                                 return 0
  1736.  
  1737.  
  1738.  
  1739.                         eachResultList = listText.split("@")
  1740.  
  1741.                         cubeInfo = self.cubeInformation[self.currentCubeNPC]
  1742.  
  1743.                         itemIndex = 0
  1744.                         for eachResultText in eachResultList:
  1745.                                 cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
  1746.                                 materialList = cubeInfo[startIndex + itemIndex]["materialList"]
  1747.  
  1748.                                 gold = 0
  1749.                                 splitResult = eachResultText.split("/")
  1750.                                 if 1 < len(splitResult):
  1751.                                         gold = int(splitResult[1])
  1752.  
  1753.                                 #print "splitResult : ", splitResult
  1754.                                 eachMaterialList = splitResult[0].split("&")
  1755.  
  1756.                                 i = 0
  1757.                                 for eachMaterialText in eachMaterialList:
  1758.                                         complicatedList = eachMaterialText.split("|")
  1759.  
  1760.                                         if 0 < len(complicatedList):
  1761.                                                 for complicatedText in complicatedList:
  1762.                                                         (itemVnum, itemCount) = complicatedText.split(",")
  1763.                                                         itemVnum = int(itemVnum)
  1764.                                                         itemCount = int(itemCount)
  1765.                                                         self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1766.  
  1767.                                                         materialList[i].append((itemVnum, itemCount))
  1768.  
  1769.                                         else:
  1770.                                                 itemVnum, itemCount = eachMaterialText.split(",")
  1771.                                                 itemVnum = int(itemVnum)
  1772.                                                 itemCount = int(itemCount)
  1773.                                                 self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
  1774.  
  1775.                                                 materialList[i].append((itemVnum, itemCount))
  1776.  
  1777.                                         i = i + 1
  1778.  
  1779.  
  1780.  
  1781.                                 itemIndex = itemIndex + 1
  1782.  
  1783.                         self.interface.wndCube.Refresh()
  1784.  
  1785.  
  1786.                 except RuntimeError, msg:
  1787.                         dbg.TraceError(msg)
  1788.                         return 0
  1789.  
  1790.                 pass
  1791.  
  1792.         # END_OF_CUBE
  1793.  
  1794.         # ��ȥ��
  1795.         def BINARY_Highlight_Item(self, inven_type, inven_pos):
  1796.                 # @fixme003 (+if self.interface:)
  1797.                 if self.interface:
  1798.                         self.interface.Highligt_Item(inven_type, inven_pos)
  1799.  
  1800.         def BINARY_DragonSoulGiveQuilification(self):
  1801.                 self.interface.DragonSoulGiveQuilification()
  1802.  
  1803.         def BINARY_DragonSoulRefineWindow_Open(self):
  1804.                 self.interface.OpenDragonSoulRefineWindow()
  1805.  
  1806.         def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos):
  1807.                 self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos)
  1808.  
  1809.         def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos):
  1810.                 self.interface.SucceedDragonSoulRefine(inven_type, inven_pos)
  1811.  
  1812.         # END of DRAGON SOUL REFINE WINDOW
  1813.  
  1814.         def BINARY_SetBigMessage(self, message):
  1815.                 self.interface.bigBoard.SetTip(message)
  1816.  
  1817.         def BINARY_SetTipMessage(self, message):
  1818.                 self.interface.tipBoard.SetTip(message)
  1819.  
  1820.         def BINARY_AppendNotifyMessage(self, type):
  1821.                 if not type in localeInfo.NOTIFY_MESSAGE:
  1822.                         return
  1823.                 chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type])
  1824.  
  1825.         def BINARY_Guild_EnterGuildArea(self, areaID):
  1826.                 self.interface.BULID_EnterGuildArea(areaID)
  1827.  
  1828.         def BINARY_Guild_ExitGuildArea(self, areaID):
  1829.                 self.interface.BULID_ExitGuildArea(areaID)
  1830.  
  1831.         def BINARY_GuildWar_OnSendDeclare(self, guildID):
  1832.                 pass
  1833.  
  1834.         def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
  1835.                 mainCharacterName = player.GetMainCharacterName()
  1836.                 masterName = guild.GetGuildMasterName()
  1837.                 if mainCharacterName == masterName:
  1838.                         self.__GuildWar_OpenAskDialog(guildID, warType)
  1839.  
  1840.         def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
  1841.                 self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
  1842.  
  1843.         def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
  1844.                 self.interface.OnStartGuildWar(guildSelf, guildOpp)
  1845.  
  1846.         def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
  1847.                 self.interface.OnEndGuildWar(guildSelf, guildOpp)
  1848.  
  1849.         def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
  1850.                 self.interface.BINARY_SetObserverMode(isEnable)
  1851.  
  1852.         def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
  1853.                 self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  1854.  
  1855.         def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
  1856.                 guildID1 = int(guildID1)
  1857.                 guildID2 = int(guildID2)
  1858.                 memberCount1 = int(memberCount1)
  1859.                 memberCount2 = int(memberCount2)
  1860.                 observerCount = int(observerCount)
  1861.  
  1862.                 self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
  1863.                 self.interface.wndMiniMap.UpdateObserverCount(observerCount)
  1864.  
  1865.         def __GuildWar_OpenAskDialog(self, guildID, warType):
  1866.  
  1867.                 guildName = guild.GetGuildName(guildID)
  1868.  
  1869.                 # REMOVED_GUILD_BUG_FIX
  1870.                 if "Noname" == guildName:
  1871.                         return
  1872.                 # END_OF_REMOVED_GUILD_BUG_FIX
  1873.  
  1874.                 import uiGuild
  1875.                 questionDialog = uiGuild.AcceptGuildWarDialog()
  1876.                 questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
  1877.                 questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
  1878.                 questionDialog.Open(guildName, warType)
  1879.  
  1880.                 self.guildWarQuestionDialog = questionDialog
  1881.  
  1882.         def __GuildWar_CloseAskDialog(self):
  1883.                 self.guildWarQuestionDialog.Close()
  1884.                 self.guildWarQuestionDialog = None
  1885.  
  1886.         def __GuildWar_OnAccept(self):
  1887.  
  1888.                 guildName = self.guildWarQuestionDialog.GetGuildName()
  1889.  
  1890.                 net.SendChatPacket("/war " + guildName)
  1891.                 self.__GuildWar_CloseAskDialog()
  1892.  
  1893.                 return 1
  1894.  
  1895.         def __GuildWar_OnDecline(self):
  1896.  
  1897.                 guildName = self.guildWarQuestionDialog.GetGuildName()
  1898.  
  1899.                 net.SendChatPacket("/nowar " + guildName)
  1900.                 self.__GuildWar_CloseAskDialog()
  1901.  
  1902.                 return 1
  1903.         if app.ENABLE_OFFLINE_SHOP:
  1904.                 def BINARY_SetOfflineShopMoveMode(self, isEnable):
  1905.                         self.interface.BINARY_SetMoveShopMode(isEnable)
  1906.         ## BINARY CALLBACK
  1907.         ######################################################################################
  1908.  
  1909.         def __ServerCommand_Build(self):
  1910.                 serverCommandList={
  1911.                         "tombola"                               : self.SetTombola,
  1912.                         "OnPrepare"                             : self.__PrepareTombola,
  1913.                         "OnRun"                                 : self.__RunTombola,
  1914.                         "openTombola"                   : self.__OpenTombola,
  1915.                         "TombolaSetEnable"              : self.TombolaSetEnable,
  1916.                         "get_input_value"               : self.GetInputValue,
  1917.                
  1918.                         "daily_update"                  : self.__Daily_Update,
  1919.                         "GetInputStart"                 : self.GetInputStart,
  1920.                         "GetInputStop"                  : self.GetInputStop,
  1921.                         "GetInput"                              : self.GetInput,
  1922.                         "MarmurShopQuest"       : self.MarmurShop,
  1923.                         "offline_wyplacanie"    : self.__setWyplacanieYangOffline,
  1924.                         "obieranie_itemshop"    : self.__odbieranie_itemshop,
  1925.                         "ConsoleEnable"                 : self.__Console_Enable,
  1926.                         "DayMode"                               : self.__DayMode_Update,
  1927.                         "PRESERVE_DayMode"              : self.__PRESERVE_DayMode_Update,
  1928.                         "CloseRestartWindow"    : self.__RestartDialog_Close,
  1929.                         "OpenPrivateShop"               : self.__PrivateShop_Open,
  1930.                         "PartyHealReady"                : self.PartyHealReady,
  1931.                         "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
  1932.                         "CloseSafebox"                  : self.CommandCloseSafebox,
  1933.  
  1934.                         # ITEM_MALL
  1935.                         "CloseMall"                             : self.CommandCloseMall,
  1936.                         "ShowMeMallPassword"    : self.AskMallPassword,
  1937.                         "item_mall"                             : self.__ItemMall_Open,
  1938.                         # END_OF_ITEM_MALL
  1939.  
  1940.                         "RefineSuceeded"                : self.RefineSuceededMessage,
  1941.                         "RefineFailed"                  : self.RefineFailedMessage,
  1942.                         "xmas_snow"                             : self.__XMasSnow_Enable,
  1943.                         "xmas_boom"                             : self.__XMasBoom_Enable,
  1944.                         "xmas_song"                             : self.__XMasSong_Enable,
  1945.                         "xmas_tree"                             : self.__XMasTree_Enable,
  1946.                         "newyear_boom"                  : self.__XMasBoom_Enable,
  1947.                         "PartyRequest"                  : self.__PartyRequestQuestion,
  1948.                         "PartyRequestDenied"    : self.__PartyRequestDenied,
  1949.                         "horse_state"                   : self.__Horse_UpdateState,
  1950.                         "hide_horse_state"              : self.__Horse_HideState,
  1951.                         "WarUC"                                 : self.__GuildWar_UpdateMemberCount,
  1952.                         "test_server"                   : self.__EnableTestServerFlag,
  1953.                         "mall"                  : self.__InGameShop_Show,
  1954.  
  1955.                         # WEDDING
  1956.                         "lover_login"                   : self.__LoginLover,
  1957.                         "lover_logout"                  : self.__LogoutLover,
  1958.                         "lover_near"                    : self.__LoverNear,
  1959.                         "lover_far"                             : self.__LoverFar,
  1960.                         "lover_divorce"                 : self.__LoverDivorce,
  1961.                         "PlayMusic"                             : self.__PlayMusic,
  1962.                         # END_OF_WEDDING
  1963.  
  1964.                         # PRIVATE_SHOP_PRICE_LIST
  1965.                         "MyShopPriceList"               : self.__PrivateShop_PriceList,
  1966.                         # END_OF_PRIVATE_SHOP_PRICE_LIST
  1967.                         "SetItemShopCash"          : self.interface.wndItemShop.SetCash,
  1968.                         "OpenShopWindow"            : self.interface.wndItemShop.Open,
  1969.                         "SetItemShopItems"          : self.interface.wndItemShop.AddItem,
  1970.                         "UpdateItemShopItem"        : self.interface.wndItemShop.UpdateItem,
  1971.                         "ClearItemShopItems"        : self.interface.wndItemShop.ClearItems,
  1972.                         "RefreshItemShopPage"       : self.interface.wndItemShop.RefreshPage,
  1973.                         "DeleteItemShopItem"        : self.interface.wndItemShop.DeleteItem,
  1974.                         "ItemShopEditor"            : self.interface.wndItemShop.SetEditorFlag,
  1975.                        
  1976.                         # Zapisywanie pozycji
  1977.                         "SavePosition"                  : self.ZapisanePozycje1,
  1978.                         "SaveMapNames"                  : self.ZapisaneNazwyMap,
  1979.                         # koniec zapisu
  1980.                        
  1981.                         #biolog
  1982.                         "Biolog"                                : self.__Biolog,
  1983.                         "Biolog_hide"                   : self.__BiologHide,
  1984.                         "Biolog_status"                 : self.__Biolog_status,
  1985.                         # koniec biologa
  1986.                         # Teleport
  1987.                         "Teleport"                              : self.Teleport,
  1988.                         # koniec teleportu
  1989.                 }
  1990.  
  1991.                 if app.ENABLE_OFFLINE_SHOP:
  1992.                         serverCommandList.update({"offlineshop_info" : self.AppendOfflineShopInfo })
  1993.                 self.serverCommander=stringCommander.Analyzer()
  1994.                 for serverCommandItem in serverCommandList.items():
  1995.                         self.serverCommander.SAFE_RegisterCallBack(
  1996.                                 serverCommandItem[0], serverCommandItem[1]
  1997.                         )
  1998.  
  1999.         def BINARY_ServerCommand_Run(self, line):
  2000.                 #dbg.TraceError(line)
  2001.                 try:
  2002.                         #print " BINARY_ServerCommand_Run", line
  2003.                         return self.serverCommander.Run(line)
  2004.                 except RuntimeError, msg:
  2005.                         dbg.TraceError(msg)
  2006.                         return 0
  2007.  
  2008.         def __ProcessPreservedServerCommand(self):
  2009.                 try:
  2010.                         command = net.GetPreservedServerCommand()
  2011.                         while command:
  2012.                                 print " __ProcessPreservedServerCommand", command
  2013.                                 self.serverCommander.Run(command)
  2014.                                 command = net.GetPreservedServerCommand()
  2015.                 except RuntimeError, msg:
  2016.                         dbg.TraceError(msg)
  2017.                         return 0
  2018.  
  2019.         def PartyHealReady(self):
  2020.                 self.interface.PartyHealReady()
  2021.  
  2022.         def AskSafeboxPassword(self):
  2023.                 self.interface.AskSafeboxPassword()
  2024.  
  2025.         # ITEM_MALL
  2026.         def AskMallPassword(self):
  2027.                 self.interface.AskMallPassword()
  2028.  
  2029.         def __ItemMall_Open(self):
  2030.                 self.interface.OpenItemMall();
  2031.  
  2032.         def CommandCloseMall(self):
  2033.                 self.interface.CommandCloseMall()
  2034.         # END_OF_ITEM_MALL
  2035.  
  2036.         def RefineSuceededMessage(self):
  2037.                 snd.PlaySound("sound/ui/make_soket.wav")
  2038.                 self.PopupMessage(localeInfo.REFINE_SUCCESS)
  2039.  
  2040.         def RefineFailedMessage(self):
  2041.                 snd.PlaySound("sound/ui/jaeryun_fail.wav")
  2042.                 self.PopupMessage(localeInfo.REFINE_FAILURE)
  2043.  
  2044.         def CommandCloseSafebox(self):
  2045.                 self.interface.CommandCloseSafebox()
  2046.  
  2047.         # PRIVATE_SHOP_PRICE_LIST
  2048.         def __PrivateShop_PriceList(self, itemVNum, itemPrice):
  2049.                 uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)
  2050.         # END_OF_PRIVATE_SHOP_PRICE_LIST
  2051.  
  2052.         def __Horse_HideState(self):
  2053.                 self.affectShower.SetHorseState(0, 0, 0)
  2054.  
  2055.         def __Horse_UpdateState(self, level, health, battery):
  2056.                 self.affectShower.SetHorseState(int(level), int(health), int(battery))
  2057.  
  2058.         def __IsXMasMap(self):
  2059.                 mapDict = ( "metin2_map_n_flame_01",
  2060.                                         "metin2_map_n_desert_01",
  2061.                                         "metin2_map_spiderdungeon",
  2062.                                         "metin2_map_deviltower1", )
  2063.  
  2064.                 if background.GetCurrentMapName() in mapDict:
  2065.                         return False
  2066.  
  2067.                 return True
  2068.  
  2069.         def __XMasSnow_Enable(self, mode):
  2070.  
  2071.                 self.__XMasSong_Enable(mode)
  2072.  
  2073.                 if "1"==mode:
  2074.  
  2075.                         if not self.__IsXMasMap():
  2076.                                 return
  2077.  
  2078.                         print "XMAS_SNOW ON"
  2079.                         background.EnableSnow(1)
  2080.  
  2081.                 else:
  2082.                         print "XMAS_SNOW OFF"
  2083.                         background.EnableSnow(0)
  2084.  
  2085.         def __XMasBoom_Enable(self, mode):
  2086.                 if "1"==mode:
  2087.  
  2088.                         if not self.__IsXMasMap():
  2089.                                 return
  2090.  
  2091.                         print "XMAS_BOOM ON"
  2092.                         self.__DayMode_Update("dark")
  2093.                         self.enableXMasBoom = True
  2094.                         self.startTimeXMasBoom = app.GetTime()
  2095.                 else:
  2096.                         print "XMAS_BOOM OFF"
  2097.                         self.__DayMode_Update("light")
  2098.                         self.enableXMasBoom = False
  2099.  
  2100.         def __XMasTree_Enable(self, grade):
  2101.  
  2102.                 print "XMAS_TREE ", grade
  2103.                 background.SetXMasTree(int(grade))
  2104.  
  2105.         def __XMasSong_Enable(self, mode):
  2106.                 if "1"==mode:
  2107.                         print "XMAS_SONG ON"
  2108.  
  2109.                         XMAS_BGM = "xmas.mp3"
  2110.  
  2111.                         if app.IsExistFile("BGM/" + XMAS_BGM)==1:
  2112.                                 if musicInfo.fieldMusic != "":
  2113.                                         snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2114.  
  2115.                                 musicInfo.fieldMusic=XMAS_BGM
  2116.                                 snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2117.  
  2118.                 else:
  2119.                         print "XMAS_SONG OFF"
  2120.  
  2121.                         if musicInfo.fieldMusic != "":
  2122.                                 snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
  2123.  
  2124.                         musicInfo.fieldMusic=musicInfo.METIN2THEMA
  2125.                         snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2126.  
  2127.         def __RestartDialog_Close(self):
  2128.                 self.interface.CloseRestartDialog()
  2129.  
  2130.         def __Console_Enable(self):
  2131.                 constInfo.CONSOLE_ENABLE = True
  2132.                 self.consoleEnable = True
  2133.                 app.EnableSpecialCameraMode()
  2134.                 ui.EnablePaste(True)
  2135.  
  2136.         ## PrivateShop
  2137.         if app.ENABLE_OFFLINE_SHOP:
  2138.                 def __PrivateShop_Open(self, hasCoin, hasGoldbar, hasWon):
  2139.                         self.interface.OpenPrivateShopInputNameDialog(hasCoin, hasGoldbar, hasWon)
  2140.         else:
  2141.                 def __PrivateShop_Open(self):
  2142.                         self.interface.OpenPrivateShopInputNameDialog()
  2143.  
  2144.         def BINARY_PrivateShop_Appear(self, vid, text):
  2145.                 if app.ENABLE_OFFLINE_SHOP:
  2146.                         fmName = "%s's Offline shop" % player.GetName()
  2147.                         if (systemSetting.IsShowOfflineShop() != 1 and not player.IsMainCharacterIndex(vid)) and (systemSetting.IsShowOfflineShop() == 2 and chr.GetNameByVID(vid) != fmName):
  2148.                                 return
  2149.                         if chr.GetVirtualNumber(vid) < 30000:
  2150.                                 return
  2151.                 self.interface.AppearPrivateShop(vid, text)
  2152.  
  2153.         def BINARY_PrivateShop_Disappear(self, vid):
  2154.                 self.interface.DisappearPrivateShop(vid)
  2155.  
  2156.         ## DayMode
  2157.         def __PRESERVE_DayMode_Update(self, mode):
  2158.                 if "light"==mode:
  2159.                         background.SetEnvironmentData(0)
  2160.                 elif "dark"==mode:
  2161.  
  2162.                         if not self.__IsXMasMap():
  2163.                                 return
  2164.  
  2165.                         background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2166.                         background.SetEnvironmentData(1)
  2167.  
  2168.         def __DayMode_Update(self, mode):
  2169.                 if "light"==mode:
  2170.                         self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
  2171.                 elif "dark"==mode:
  2172.  
  2173.                         if not self.__IsXMasMap():
  2174.                                 return
  2175.  
  2176.                         self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
  2177.  
  2178.         def __DayMode_OnCompleteChangeToLight(self):
  2179.                 background.SetEnvironmentData(0)
  2180.                 self.curtain.FadeIn()
  2181.  
  2182.         def __DayMode_OnCompleteChangeToDark(self):
  2183.                 background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
  2184.                 background.SetEnvironmentData(1)
  2185.                 self.curtain.FadeIn()
  2186.  
  2187.         ## XMasBoom
  2188.         def __XMasBoom_Update(self):
  2189.  
  2190.                 self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
  2191.                 if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
  2192.                         return
  2193.  
  2194.                 boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
  2195.                 boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
  2196.  
  2197.                 if app.GetTime() - self.startTimeXMasBoom > boomTime:
  2198.  
  2199.                         self.indexXMasBoom += 1
  2200.  
  2201.                         for i in xrange(boomCount):
  2202.                                 self.__XMasBoom_Boom()
  2203.  
  2204.         def __XMasBoom_Boom(self):
  2205.                 x, y, z = player.GetMainCharacterPosition()
  2206.                 randX = app.GetRandom(-150, 150)
  2207.                 randY = app.GetRandom(-150, 150)
  2208.  
  2209.                 snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
  2210.  
  2211.         def __PartyRequestQuestion(self, vid):
  2212.                 vid = int(vid)
  2213.                 partyRequestQuestionDialog = uiCommon.QuestionDialog()
  2214.                 partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
  2215.                 partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
  2216.                 partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
  2217.                 partyRequestQuestionDialog.SetAcceptEvent(lambda arg=True: self.__AnswerPartyRequest(arg))
  2218.                 partyRequestQuestionDialog.SetCancelEvent(lambda arg=False: self.__AnswerPartyRequest(arg))
  2219.                 partyRequestQuestionDialog.Open()
  2220.                 partyRequestQuestionDialog.vid = vid
  2221.                 self.partyRequestQuestionDialog = partyRequestQuestionDialog
  2222.  
  2223.         def __AnswerPartyRequest(self, answer):
  2224.                 if not self.partyRequestQuestionDialog:
  2225.                         return
  2226.  
  2227.                 vid = self.partyRequestQuestionDialog.vid
  2228.  
  2229.                 if answer:
  2230.                         net.SendChatPacket("/party_request_accept " + str(vid))
  2231.                 else:
  2232.                         net.SendChatPacket("/party_request_deny " + str(vid))
  2233.  
  2234.                 self.partyRequestQuestionDialog.Close()
  2235.                 self.partyRequestQuestionDialog = None
  2236.  
  2237.         def __PartyRequestDenied(self):
  2238.                 self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
  2239.  
  2240.         def __EnableTestServerFlag(self):
  2241.                 app.EnableTestServerFlag()
  2242.  
  2243.         def __InGameShop_Show(self, url):
  2244.                 if constInfo.IN_GAME_SHOP_ENABLE:
  2245.                         self.interface.OpenWebWindow(url)
  2246.  
  2247.         # WEDDING
  2248.         def __LoginLover(self):
  2249.                 if self.interface.wndMessenger:
  2250.                         self.interface.wndMessenger.OnLoginLover()
  2251.  
  2252.         def __LogoutLover(self):
  2253.                 if self.interface.wndMessenger:
  2254.                         self.interface.wndMessenger.OnLogoutLover()
  2255.                 if self.affectShower:
  2256.                         self.affectShower.HideLoverState()
  2257.  
  2258.         def __LoverNear(self):
  2259.                 if self.affectShower:
  2260.                         self.affectShower.ShowLoverState()
  2261.  
  2262.         def __LoverFar(self):
  2263.                 if self.affectShower:
  2264.                         self.affectShower.HideLoverState()
  2265.  
  2266.         def __LoverDivorce(self):
  2267.                 if self.interface.wndMessenger:
  2268.                         self.interface.wndMessenger.ClearLoverInfo()
  2269.                 if self.affectShower:
  2270.                         self.affectShower.ClearLoverState()
  2271.  
  2272.         def __PlayMusic(self, flag, filename):
  2273.                 flag = int(flag)
  2274.                 if flag:
  2275.                         snd.FadeOutAllMusic()
  2276.                         musicInfo.SaveLastPlayFieldMusic()
  2277.                         snd.FadeInMusic("BGM/" + filename)
  2278.                 else:
  2279.                         snd.FadeOutAllMusic()
  2280.                         musicInfo.LoadLastPlayFieldMusic()
  2281.                         snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
  2282.                        
  2283.         if app.ENABLE_SASH_SYSTEM:
  2284.                 def ActSash(self, iAct, bWindow):
  2285.                         if self.interface:
  2286.                                 self.interface.ActSash(iAct, bWindow)
  2287.  
  2288.                 def AlertSash(self, bWindow):
  2289.                         snd.PlaySound("sound/ui/make_soket.wav")
  2290.                         if bWindow:
  2291.                                 self.PopupMessage(localeInfo.SASH_DEL_SERVEITEM)
  2292.                         else:
  2293.                                 self.PopupMessage(localeInfo.SASH_DEL_ABSORDITEM)
  2294.  
  2295.         # END_OF_WEDDING
  2296.         if app.ENABLE_SEND_TARGET_INFO:
  2297.                 def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
  2298.                         if not raceNum in constInfo.MONSTER_INFO_DATA:
  2299.                                 constInfo.MONSTER_INFO_DATA.update({raceNum : {}})
  2300.                                 constInfo.MONSTER_INFO_DATA[raceNum].update({"items" : []})
  2301.                         curList = constInfo.MONSTER_INFO_DATA[raceNum]["items"]
  2302.  
  2303.                         isUpgradeable = False
  2304.                         isMetin = False
  2305.                         item.SelectItem(itemVnum)
  2306.                         if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
  2307.                                 isUpgradeable = True
  2308.                         elif item.GetItemType() == item.ITEM_TYPE_METIN:
  2309.                                 isMetin = True
  2310.  
  2311.                         for curItem in curList:
  2312.                                 if isUpgradeable:
  2313.                                         if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10:
  2314.                                                 if not (itemVnum in curItem["vnum_list"]):
  2315.                                                         curItem["vnum_list"].append(itemVnum)
  2316.                                                 return
  2317.                                 elif isMetin:
  2318.                                         if curItem.has_key("vnum_list"):
  2319.                                                 baseVnum = curItem["vnum_list"][0]
  2320.                                         if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000):
  2321.                                                 if not (itemVnum in curItem["vnum_list"]):
  2322.                                                         curItem["vnum_list"].append(itemVnum)
  2323.                                                 return
  2324.                                 else:
  2325.                                         if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount:
  2326.                                                 return
  2327.  
  2328.                         if isUpgradeable or isMetin:
  2329.                                 curList.append({"vnum_list":[itemVnum], "count":itemCount})
  2330.                         else:
  2331.                                 curList.append({"vnum":itemVnum, "count":itemCount})
  2332.  
  2333.                 def BINARY_RefreshTargetMonsterDropInfo(self, raceNum):
  2334.                         self.targetBoard.RefreshMonsterInfoBoard()
  2335.  
  2336.         def __setWyplacanieYangOffline(self, value):
  2337.                 constInfo.OFFLINE_WYPLACANIE_YANG = int(value)
  2338.  
  2339.         def __odbieranie_itemshop(self, value):
  2340.                 constInfo.OdbieranieIs = int(value)
  2341.                
  2342.         def ClickPoliShopButton(self):
  2343.                 if FALSE == player.IsObserverMode():
  2344.                         self.SklepP.Show()
  2345.                        
  2346.         def BoostWindowShopButton(self):
  2347.                 if FALSE == player.IsObserverMode():
  2348.                         self.BoostWindow.Show()
  2349.                        
  2350.         def MarmurShop(self, qid):
  2351.                 constInfo.MarmurShopQuest = int(qid)
  2352.                
  2353.         def GetInputStart(self):
  2354.                 constInfo.INPUT_IGNORE = 1
  2355.                
  2356.         def ShowPositionWindow(self):          
  2357.                 self.wndPosition.Show()
  2358.  
  2359.         def ShowPositionWindow(self):          
  2360.                 self.wndPosition.Show()
  2361.  
  2362.         def GetInputStop(self):
  2363.                 constInfo.INPUT_IGNORE = 0
  2364.  
  2365.         def GetInput(self):
  2366.                 net.SendQuestInputStringPacket(str(constInfo.INPUT_DATA))
  2367.                
  2368.         def ShowDaily(self):
  2369.                 self.wndDaily.Show()
  2370.                
  2371.         def __Daily_Update(self, arg):
  2372.                 data = arg.split("|")
  2373.                 constInfo.DAILY_DAY = int(data[0])
  2374.                 constInfo.DAILY_TIME = int(data[1])
  2375.                
  2376.         def __Biolog(self, arg):
  2377.                 data = arg.split("|")
  2378.                 constInfo.BIOLOG_ITEM = int(data[0])
  2379.                 constInfo.BIOLOG_TIME = int(data[1])
  2380.                 constInfo.BIOLOG_COUNT = int(data[2])
  2381.                 constInfo.BIOLOG_SZANSA = int(data[3])
  2382.  
  2383.         def __Biolog_status(self, arg):
  2384.                 constInfo.BIOLOG_STATUS = int(arg)
  2385.  
  2386.         def __BiologHide(self, arg):
  2387.                 constInfo.BIOLOG_ITEM = int(arg)
  2388.                 self.interface.HideBiologWindow()
  2389.                
  2390.         def ZapisanePozycje1(self, qid):
  2391.                 constInfo.ZapiszPozycje = int(qid)
  2392.                
  2393.         def ZapisaneNazwyMap(self, data):
  2394.                 constInfo.SAVE_MAP_NAME = data
  2395.                 self.wndPosition.UpdateMapNames()
  2396.                
  2397.         def Teleport(self, getString):
  2398.                 if getString.find("index") != -1:
  2399.                         self.teleport.UpdateIndex(int(getString.split("x")[1]))
  2400.                 else:
  2401.                         constInfo.SendString = str(self.teleport.SendToServer)
  2402.                         constInfo.CApiSetHide = 1
  2403.        
  2404.         def GetInputValue(self):
  2405.                 net.SendQuestInputStringPacket(str(constInfo.VIDT))
  2406.                
  2407.         def TombolaSetEnable(self):
  2408.                 constInfo.wndTombola.EnableButton()
  2409.        
  2410.         def     __OpenTombola(self):
  2411.                 constInfo.wndTombola.Open()
  2412.                
  2413.         def __PrepareTombola(self, data):
  2414.                 constInfo.wndTombola.OnPrepare(str(data))
  2415.                
  2416.         def __RunTombola(self, number):
  2417.                 constInfo.wndTombola.OnRun(str(number))
  2418.                
  2419.         def SetTombola(self, qid):
  2420.                 constInfo.TOMBOLA = int(qid)   
  2421.