forked from metin2/client
75 lines
2.1 KiB
Python
75 lines
2.1 KiB
Python
|
import net
|
|||
|
|
|||
|
import ui
|
|||
|
import networkModule
|
|||
|
|
|||
|
###################################################################################################
|
|||
|
## PointReset
|
|||
|
class PointResetDialog(ui.ScriptWindow):
|
|||
|
|
|||
|
def __init__(self):
|
|||
|
ui.ScriptWindow.__init__(self)
|
|||
|
self.ConfirmDialog = ui.ScriptWindow()
|
|||
|
|
|||
|
def LoadDialog(self):
|
|||
|
try:
|
|||
|
PythonScriptLoader = ui.PythonScriptLoader()
|
|||
|
PythonScriptLoader.LoadScriptFile(self, "uiscript/questiondialog2.py")
|
|||
|
PythonScriptLoader.LoadScriptFile(self.ConfirmDialog, "uiscript/questiondialog2.py")
|
|||
|
except:
|
|||
|
import exception
|
|||
|
exception.Abort("PointResetDialog.LoadDialog.LoadObject")
|
|||
|
|
|||
|
try:
|
|||
|
GetObject = self.ConfirmDialog.GetChild
|
|||
|
self.ConfirmText = GetObject("message1")
|
|||
|
self.ConfirmText2 = GetObject("message2")
|
|||
|
self.ConfirmAcceptButton = GetObject("accept")
|
|||
|
self.ConfirmCancelButton = GetObject("cancel")
|
|||
|
except:
|
|||
|
import exception
|
|||
|
exception.Abort("PointResetDialog.LoadWindow.BindObject")
|
|||
|
|
|||
|
self.GetChild("message1").SetText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><>ų <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ʱ<EFBFBD>ȭ<EFBFBD><C8AD><EFBFBD>ְڳ<D6B0>.")
|
|||
|
self.GetChild("message2").SetText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 500<30><30><EFBFBD>̾<EFBFBD>. <20>, <20>ʱ<EFBFBD>ȭ<EFBFBD><C8AD><EFBFBD>ٰ<EFBFBD>?")
|
|||
|
self.GetChild("accept").SetEvent(ui.__mem_func__(self.OpenConfirmDialog))
|
|||
|
self.GetChild("cancel").SetEvent(ui.__mem_func__(self.Close))
|
|||
|
|
|||
|
## Confirm Dialog
|
|||
|
self.ConfirmText.SetText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٳ<EFBFBD>.")
|
|||
|
self.ConfirmText.SetFontColor(1.0, 0.3, 0.3)
|
|||
|
self.ConfirmText2.SetText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʱ<EFBFBD>ȭ<EFBFBD>ϰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?")
|
|||
|
self.ConfirmAcceptButton.SetEvent(ui.__mem_func__(self.ResetPoint))
|
|||
|
self.ConfirmCancelButton.SetEvent(ui.__mem_func__(self.Close))
|
|||
|
|
|||
|
def Destroy(self):
|
|||
|
self.ClearDictionary()
|
|||
|
self.ConfirmDialog.ClearDictionary()
|
|||
|
self.ConfirmAcceptButton.SetEvent(0)
|
|||
|
self.ConfirmCancelButton.SetEvent(0)
|
|||
|
|
|||
|
self.ConfirmDialog = 0
|
|||
|
self.ConfirmText = 0
|
|||
|
self.ConfirmAcceptButton = 0
|
|||
|
self.ConfirmCancelButton = 0
|
|||
|
|
|||
|
def OpenDialog(self):
|
|||
|
self.Show()
|
|||
|
|
|||
|
def OpenConfirmDialog(self):
|
|||
|
self.ConfirmDialog.Show()
|
|||
|
self.ConfirmDialog.SetTop()
|
|||
|
|
|||
|
def ResetPoint(self):
|
|||
|
net.SendChatPacket("/pointreset")
|
|||
|
self.Close()
|
|||
|
|
|||
|
def Close(self):
|
|||
|
self.ConfirmDialog.Hide()
|
|||
|
self.Hide()
|
|||
|
return TRUE
|
|||
|
|
|||
|
def OnPressEscapeKey(self):
|
|||
|
self.Close()
|
|||
|
return TRUE
|