예제 #1
0
	def __LoadWindow(self):
		if self.isLoaded == 1:
			return

		self.isLoaded = 1

		pyScrLoader = ui.PythonScriptLoader()
		pyScrLoader.LoadScriptFile(self, "UIScript/SafeboxWindow.py")

		from _weakref import proxy

		## Item
		wndItem = ui.GridSlotWindow()
		wndItem.SetParent(self)
		wndItem.SetPosition(8, 35)
		wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
		wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
		wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
		wndItem.Show()

		## PickMoneyDialog
		import uiPickMoney
		dlgPickMoney = uiPickMoney.PickMoneyDialog()
		dlgPickMoney.LoadDialog()
		dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
		dlgPickMoney.Hide()

		## ChangePasswrod
		dlgChangePassword = ChangePasswordDialog()
		dlgChangePassword.LoadDialog()
		dlgChangePassword.Hide()

		## Close Button
		self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
		self.GetChild("ChangePasswordButton").SetEvent(ui.__mem_func__(self.OnChangePassword))
		self.GetChild("ExitButton").SetEvent(ui.__mem_func__(self.Close))

		if app.ENABLE_OFFLINE_SHOP:
			self.GetChild("CollectButton").SetEvent(ui.__mem_func__(self.OnCollect))
			self.GetChild("MyShopsButton").SetEvent(ui.__mem_func__(self.MyShops))

		self.wndItem = wndItem
		self.dlgPickMoney = dlgPickMoney
		self.dlgChangePassword = dlgChangePassword
		self.wndBoard = self.GetChild("board")
		if app.ENABLE_OFFLINE_SHOP:
			self.wndMoney = self.GetChild("Money")
			self.wndMoneySlot = self.GetChild("MoneySlot")
			self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))

		## Initialize
		self.SetTableSize(3)
		self.RefreshSafeboxMoney()
예제 #2
0
    def LoadDialog(self):
        PythonScriptLoader = ui.PythonScriptLoader()
        PythonScriptLoader.LoadScriptFile(self, "UIScript/exchangedialog.py")

        ## Owner
        self.OwnerSlot = self.GetChild("Owner_Slot")
        self.OwnerSlot.SetSelectEmptySlotEvent(
            ui.__mem_func__(self.SelectOwnerEmptySlot))
        self.OwnerSlot.SetSelectItemSlotEvent(
            ui.__mem_func__(self.SelectOwnerItemSlot))
        self.OwnerSlot.SetOverInItemEvent(ui.__mem_func__(
            self.OverInOwnerItem))
        self.OwnerSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
        self.OwnerMoney = self.GetChild("Owner_Money_Value")
        self.OwnerAcceptLight = self.GetChild("Owner_Accept_Light")
        self.OwnerAcceptLight.Disable()
        self.OwnerMoneyButton = self.GetChild("Owner_Money")
        self.OwnerMoneyButton.SetEvent(
            ui.__mem_func__(self.OpenPickMoneyDialog))

        ## Target
        self.TargetSlot = self.GetChild("Target_Slot")
        self.TargetSlot.SetOverInItemEvent(
            ui.__mem_func__(self.OverInTargetItem))
        self.TargetSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
        self.TargetMoney = self.GetChild("Target_Money_Value")
        self.TargetAcceptLight = self.GetChild("Target_Accept_Light")
        self.TargetAcceptLight.Disable()

        ## PickMoneyDialog
        dlgPickMoney = uiPickMoney.PickMoneyDialog()
        dlgPickMoney.LoadDialog()
        dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
        dlgPickMoney.SetTitleName(localeInfo.EXCHANGE_MONEY)
        dlgPickMoney.SetMax(7)
        dlgPickMoney.Hide()
        self.dlgPickMoney = dlgPickMoney

        ## Button
        self.AcceptButton = self.GetChild("Owner_Accept_Button")
        self.AcceptButton.SetToggleDownEvent(
            ui.__mem_func__(self.AcceptExchange))

        self.TitleName = self.GetChild("TitleName")
        self.GetChild("TitleBar").SetCloseEvent(net.SendExchangeExitPacket)
예제 #3
0
	def __LoadWindow(self):
		if self.isLoaded == 1:
			return

		self.isLoaded = 1

		try:
			pyScrLoader = ui.PythonScriptLoader()

			if ITEM_MALL_BUTTON_ENABLE:
				pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "InventoryWindow.py")
			else:
				pyScrLoader.LoadScriptFile(self, "UIScript/InventoryWindow.py")
		except:
			import exception
			exception.Abort("InventoryWindow.LoadWindow.LoadObject")

		try:
			wndItem = self.GetChild("ItemSlot")
			wndEquip = self.GetChild("EquipmentSlot")
			self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
			self.wndMoney = self.GetChild("Money")
			self.wndMoneySlot = self.GetChild("Money_Slot")
			self.mallButton = self.GetChild2("MallButton")
			self.DSSButton = self.GetChild2("DSSButton")
			self.costumeButton = self.GetChild2("CostumeButton")
			
			self.inventoryTab = []
			self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))

			self.equipmentTab = []
			self.equipmentTab.append(self.GetChild("Equipment_Tab_01"))
			self.equipmentTab.append(self.GetChild("Equipment_Tab_02"))

			if self.costumeButton and not app.ENABLE_COSTUME_SYSTEM:
				self.costumeButton.Hide()
				self.costumeButton.Destroy()
				self.costumeButton = 0

			# Belt Inventory Window
			self.wndBelt = None
			
			if app.ENABLE_NEW_EQUIPMENT_SYSTEM:
				self.wndBelt = BeltInventoryWindow(self)
			
		except:
			import exception
			exception.Abort("InventoryWindow.LoadWindow.BindObject")

		## Item
		wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
		wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
		wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

		## Equipment
		wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
		wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
		wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

		## PickMoneyDialog
		dlgPickMoney = uiPickMoney.PickMoneyDialog()
		dlgPickMoney.LoadDialog()
		dlgPickMoney.Hide()

		## RefineDialog
		self.refineDialog = uiRefine.RefineDialog()
		self.refineDialog.Hide()

		## AttachMetinDialog
		self.attachMetinDialog = uiAttachMetin.AttachMetinDialog()
		self.attachMetinDialog.Hide()

		## MoneySlot
		self.wndMoneySlot.SetEvent(ui.__mem_func__(self.OpenPickMoneyDialog))

		self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg))
		self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg))
		self.inventoryTab[0].Down()

		self.equipmentTab[0].SetEvent(lambda arg=0: self.SetEquipmentPage(arg))
		self.equipmentTab[1].SetEvent(lambda arg=1: self.SetEquipmentPage(arg))
		self.equipmentTab[0].Down()
		self.equipmentTab[0].Hide()
		self.equipmentTab[1].Hide()

		self.wndItem = wndItem
		self.wndEquip = wndEquip
		self.dlgPickMoney = dlgPickMoney

		# MallButton
		if self.mallButton:
			self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))

		if self.DSSButton:
			self.DSSButton.SetEvent(ui.__mem_func__(self.ClickDSSButton)) 
		
		# Costume Button
		if self.costumeButton:
			self.costumeButton.SetEvent(ui.__mem_func__(self.ClickCostumeButton))

		self.wndCostume = None
		
 		#####

		## Refresh
		self.SetInventoryPage(0)
		self.SetEquipmentPage(0)
		self.RefreshItemSlot()
		self.RefreshStatus()
예제 #4
0
    def LoadDialog(self):
        PythonScriptLoader = ui.PythonScriptLoader()
        if app.ENABLE_NEW_EXCHANGE_WINDOW:
            PythonScriptLoader.LoadScriptFile(
                self, "UIScript/exchangedialog_new.py")
        else:
            PythonScriptLoader.LoadScriptFile(self,
                                              "UIScript/exchangedialog.py")

        self.OwnerSlot = self.GetChild("Owner_Slot")
        self.OwnerSlot.SetSelectEmptySlotEvent(
            ui.__mem_func__(self.SelectOwnerEmptySlot))
        self.OwnerSlot.SetSelectItemSlotEvent(
            ui.__mem_func__(self.SelectOwnerItemSlot))
        self.OwnerSlot.SetOverInItemEvent(ui.__mem_func__(
            self.OverInOwnerItem))
        self.OwnerSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
        self.OwnerMoney = self.GetChild("Owner_Money_Value")
        if not app.ENABLE_NEW_EXCHANGE_WINDOW:
            self.OwnerAcceptLight = self.GetChild("Owner_Accept_Light")
            self.OwnerAcceptLight.Disable()
        self.OwnerMoneyButton = self.GetChild("Owner_Money")
        self.OwnerMoneyButton.SetEvent(
            ui.__mem_func__(self.OpenPickMoneyDialog))

        self.TargetSlot = self.GetChild("Target_Slot")
        self.TargetSlot.SetOverInItemEvent(
            ui.__mem_func__(self.OverInTargetItem))
        self.TargetSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
        self.TargetMoney = self.GetChild("Target_Money_Value")
        if not app.ENABLE_NEW_EXCHANGE_WINDOW:
            self.TargetAcceptLight = self.GetChild("Target_Accept_Light")
            self.TargetAcceptLight.Disable()

        dlgPickMoney = uiPickMoney.PickMoneyDialog()
        dlgPickMoney.LoadDialog()
        dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickMoney))
        dlgPickMoney.SetTitleName(localeInfo.EXCHANGE_MONEY)
        if not app.ENABLE_NEW_EXCHANGE_WINDOW:
            dlgPickMoney.SetMax(6)
        else:
            dlgPickMoney.SetMax(20)
        dlgPickMoney.Hide()
        self.dlgPickMoney = dlgPickMoney

        self.AcceptButton = self.GetChild("Owner_Accept_Button")
        self.AcceptButton.SetToggleDownEvent(
            ui.__mem_func__(self.AcceptExchange))

        if app.ENABLE_NEW_EXCHANGE_WINDOW:
            self.TargetAcceptButton = self.GetChild("Target_Accept_Button")

        self.TitleName = self.GetChild("TitleName")
        self.GetChild("TitleBar").SetCloseEvent(
            GFHhg54GHGhh45GHGH.SendExchangeExitPacket)
        if app.ENABLE_NEW_EXCHANGE_WINDOW:
            self.FaceOwnerImage = self.GetChild("FaceOwner_Image")
            self.FaceTargetImage = self.GetChild("FaceTarget_Image")
            self.TargetName = self.GetChild("target_NameText")
            self.TargetLevel = self.GetChild("target_LvText")
            self.ExchangeLogs = self.GetChild("ExchangeLogs")
            self.LogsScrollBar = ui.ThinScrollBar()
            self.LogsScrollBar.SetParent(self.ExchangeLogs)
            self.LogsScrollBar.SetPosition(442 - 75, 17)
            self.LogsScrollBar.SetScrollBarSize(50)
            self.LogsScrollBar.Show()
            self.LogsDropList = ui.ListBoxEx()
            self.LogsDropList.SetParent(self.ExchangeLogs)
            self.LogsDropList.itemHeight = 12
            self.LogsDropList.itemStep = 13
            self.LogsDropList.SetPosition(35, 27)
            self.LogsDropList.SetSize(0, 45)
            self.LogsDropList.SetScrollBar(self.LogsScrollBar)
            self.LogsDropList.SetViewItemCount(2)
            self.LogsDropList.Show()
            self.LogsScrollBar.Show()
            self.listOwnerSlot = []
            self.listTargetSlot = []