Problema la Chest info

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Avatar utilizator
R8Sentinel
Nivel 2

Nivel 2
Mesaje: 224
Membru din: 23 Iul 2017, 01:17
Server: In lucru
Regat: Chunjo
Aprecieri: 14  
Mulţumiri: 248  
Medalii

*Problemă: Am incercat sa bag sistemul Chest info. La partea de sursa client si server nu am avut probleme.
La partea de client am probleme
*Resursă folosită: C++ Chest View Drop
Download: Mega.nz
*ServerFiles utilizat: propiu
*Syserr:

Cod: Selectaţi tot

uiChestDrop.py(line:37) __LoadWindow
ui.py(line:3153) GetChild

GemShopWindow.__LoadWindow.BindObject - <type 'exceptions.KeyError'>:'currentPageBack'
Poză:
*Detalii suplimentare:

Cod: Selectaţi tot

import uiCommon, snd, chat, app, net, player, item, wndMgr, mouseModule, localeInfo, constInfo, ui

class ChestDropWindow(ui.ScriptWindow):
	def __init__(self):
		ui.ScriptWindow.__init__(self)
		
		self.tooltipItem = None

		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1

		self.__LoadWindow()

	def __del__(self):
		ui.ScriptWindow.__del__(self)
		
	def __LoadWindow(self):
		try:
			PythonScriptLoader = ui.PythonScriptLoader()
			PythonScriptLoader.LoadScriptFile(self, "UIScript/chestdropwindow.py")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.LoadObject")

		try:
			self.titleBar = self.GetChild("TitleBar")

			self.openItemSlot = self.GetChild("OpenItemSlot")
			self.openCountController = self.GetChild("OpenCountController")
			self.openChestButtonSingle = self.GetChild("OpenChestButtonSingle")
			self.openChestButtonMultiple = self.GetChild("OpenChestButtonMultiple")
			
			self.prevButton = self.GetChild("prev_button")
			self.nextButton = self.GetChild("next_button")
			self.currentPageBack = self.GetChild("currentPageBack")
			self.currentPageText = self.GetChild("currentPageText")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.BindObject")
			
		self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
		self.openCountController.SetEvent(ui.__mem_func__(self.OnChangeOpenAmount))
		
		self.openChestButtonSingle.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		self.openChestButtonMultiple.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)
		
		self.prevButton.SetEvent(ui.__mem_func__(self.OnClickPrevPage))
		self.nextButton.SetEvent(ui.__mem_func__(self.OnClickNextPage))
		
		self.currentPageText.SetText(str(self.currentPage))

		wndItem = ui.GridSlotWindow()
		wndItem.SetParent(self)
		wndItem.SetPosition(8, 35)
		wndItem.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
		wndItem.ArrangeSlot(0, 15, 5, 32, 32, 0, 0)
		wndItem.RefreshSlot()
		wndItem.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0)
		wndItem.Show()
		
		self.wndItem = wndItem
		
	def Close(self):
		self.Hide()
		
	def Destroy(self):
		self.ClearDictionary()
		
		self.tooltipItem = None
		self.wndItem = None
		
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1
		
	def Open(self, invItemPos = -1):
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		
		self.SetInvItemSlot(invItemPos)
	
		self.SetTop()
		self.SetCenterPosition()
		self.Show()

	def SetItemToolTip(self, tooltip):
		self.tooltipItem = tooltip
		
	def OnChangeOpenAmount(self):
		openTemp = int(self.openCountController.GetSliderPos() * 10)
		if openTemp == 0:
			self.openAmount = 1
		else:
			self.openAmount = openTemp
			
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)

	def OnClickOpenChest(self):
		if self.invItemPos == -1:
			return
			
		itemCount = player.GetItemCount(self.invItemPos)

		if itemCount >= self.openAmount:
			for i in xrange(self.openAmount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
		else:
			for i in xrange(itemCount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
					
	def OnClickPrevPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage - 1):
			self.currentPage = self.currentPage - 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
		
	def OnClickNextPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage + 1):
			self.currentPage = self.currentPage + 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
			
	def EnableMultiPage(self):
		self.openChestButtonSingle.Hide()
		self.openChestButtonMultiple.Show()
		
		self.prevButton.Show()
		self.nextButton.Show()
		self.currentPageBack.Show()
		
	def EnableSinglePage(self):
		self.openChestButtonSingle.Show()
		self.openChestButtonMultiple.Hide()
		
		self.prevButton.Hide()
		self.nextButton.Hide()
		self.currentPageBack.Hide()	
		
	def SetInvItemSlot(self, invItemPos):
		self.invItemPos = invItemPos
		
		itemVnum = player.GetItemIndex(invItemPos)
		itemCount = player.GetItemCount(invItemPos)
		if itemVnum:
			self.openItemSlot.SetItemSlot(0, itemVnum, itemCount)
			
	def RefreshItems(self, chestVnum):
		if chestVnum:
			self.currentChest = chestVnum
			
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(2):
			self.EnableMultiPage()
		else:
			self.EnableSinglePage()
			
		self.RefreshItemSlot()

	def RefreshItemSlot(self):
		for i in xrange(15 * 5):
			self.wndItem.ClearSlot(i)
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
			
		for key, value in constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage].iteritems():
			itemVnum = value[0]
			itemCount = value[1]

			if itemCount <= 1:
				itemCount = 0
			
			self.wndItem.SetItemSlot(key, itemVnum, itemCount)
			
		wndMgr.RefreshSlot(self.wndItem.GetWindowHandle())
			
	def OverInItem(self, slotIndex):
		if mouseModule.mouseController.isAttached():
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
    
		if 0 != self.tooltipItem:
			self.tooltipItem.SetItemToolTip(constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage][slotIndex][0])
    
	def OverOutItem(self):
		if 0 != self.tooltipItem:
			self.tooltipItem.HideToolTip()
								
	def OnPressEscapeKey(self):
		self.Close()
		return True

Skype: ytrid8r
Afișează semnătura
Avatar utilizator
Rimex
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 182
Membru din: 31 Ian 2018, 12:23
Server: BraveS
Regat: Chunjo
Aprecieri: 3  
Mulţumiri: 354  
Discord: Copiază ID
Medalii

R8Sentinel scrie:*Problemă: Am incercat sa bag sistemul Chest info. La partea de sursa client si server nu am avut probleme.
La partea de client am probleme
*Resursă folosită: C++ Chest View Drop
Download: Mega.nz
*ServerFiles utilizat: propiu
*Syserr:

Cod: Selectaţi tot

uiChestDrop.py(line:37) __LoadWindow
ui.py(line:3153) GetChild

GemShopWindow.__LoadWindow.BindObject - <type 'exceptions.KeyError'>:'currentPageBack'
Poză:
*Detalii suplimentare:

Cod: Selectaţi tot

import uiCommon, snd, chat, app, net, player, item, wndMgr, mouseModule, localeInfo, constInfo, ui

class ChestDropWindow(ui.ScriptWindow):
	def __init__(self):
		ui.ScriptWindow.__init__(self)
		
		self.tooltipItem = None

		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1

		self.__LoadWindow()

	def __del__(self):
		ui.ScriptWindow.__del__(self)
		
	def __LoadWindow(self):
		try:
			PythonScriptLoader = ui.PythonScriptLoader()
			PythonScriptLoader.LoadScriptFile(self, "UIScript/chestdropwindow.py")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.LoadObject")

		try:
			self.titleBar = self.GetChild("TitleBar")

			self.openItemSlot = self.GetChild("OpenItemSlot")
			self.openCountController = self.GetChild("OpenCountController")
			self.openChestButtonSingle = self.GetChild("OpenChestButtonSingle")
			self.openChestButtonMultiple = self.GetChild("OpenChestButtonMultiple")
			
			self.prevButton = self.GetChild("prev_button")
			self.nextButton = self.GetChild("next_button")
			self.currentPageBack = self.GetChild("currentPageBack")
			self.currentPageText = self.GetChild("currentPageText")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.BindObject")
			
		self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
		self.openCountController.SetEvent(ui.__mem_func__(self.OnChangeOpenAmount))
		
		self.openChestButtonSingle.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		self.openChestButtonMultiple.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)
		
		self.prevButton.SetEvent(ui.__mem_func__(self.OnClickPrevPage))
		self.nextButton.SetEvent(ui.__mem_func__(self.OnClickNextPage))
		
		self.currentPageText.SetText(str(self.currentPage))

		wndItem = ui.GridSlotWindow()
		wndItem.SetParent(self)
		wndItem.SetPosition(8, 35)
		wndItem.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
		wndItem.ArrangeSlot(0, 15, 5, 32, 32, 0, 0)
		wndItem.RefreshSlot()
		wndItem.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0)
		wndItem.Show()
		
		self.wndItem = wndItem
		
	def Close(self):
		self.Hide()
		
	def Destroy(self):
		self.ClearDictionary()
		
		self.tooltipItem = None
		self.wndItem = None
		
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1
		
	def Open(self, invItemPos = -1):
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		
		self.SetInvItemSlot(invItemPos)
	
		self.SetTop()
		self.SetCenterPosition()
		self.Show()

	def SetItemToolTip(self, tooltip):
		self.tooltipItem = tooltip
		
	def OnChangeOpenAmount(self):
		openTemp = int(self.openCountController.GetSliderPos() * 10)
		if openTemp == 0:
			self.openAmount = 1
		else:
			self.openAmount = openTemp
			
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)

	def OnClickOpenChest(self):
		if self.invItemPos == -1:
			return
			
		itemCount = player.GetItemCount(self.invItemPos)

		if itemCount >= self.openAmount:
			for i in xrange(self.openAmount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
		else:
			for i in xrange(itemCount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
					
	def OnClickPrevPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage - 1):
			self.currentPage = self.currentPage - 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
		
	def OnClickNextPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage + 1):
			self.currentPage = self.currentPage + 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
			
	def EnableMultiPage(self):
		self.openChestButtonSingle.Hide()
		self.openChestButtonMultiple.Show()
		
		self.prevButton.Show()
		self.nextButton.Show()
		self.currentPageBack.Show()
		
	def EnableSinglePage(self):
		self.openChestButtonSingle.Show()
		self.openChestButtonMultiple.Hide()
		
		self.prevButton.Hide()
		self.nextButton.Hide()
		self.currentPageBack.Hide()	
		
	def SetInvItemSlot(self, invItemPos):
		self.invItemPos = invItemPos
		
		itemVnum = player.GetItemIndex(invItemPos)
		itemCount = player.GetItemCount(invItemPos)
		if itemVnum:
			self.openItemSlot.SetItemSlot(0, itemVnum, itemCount)
			
	def RefreshItems(self, chestVnum):
		if chestVnum:
			self.currentChest = chestVnum
			
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(2):
			self.EnableMultiPage()
		else:
			self.EnableSinglePage()
			
		self.RefreshItemSlot()

	def RefreshItemSlot(self):
		for i in xrange(15 * 5):
			self.wndItem.ClearSlot(i)
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
			
		for key, value in constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage].iteritems():
			itemVnum = value[0]
			itemCount = value[1]

			if itemCount <= 1:
				itemCount = 0
			
			self.wndItem.SetItemSlot(key, itemVnum, itemCount)
			
		wndMgr.RefreshSlot(self.wndItem.GetWindowHandle())
			
	def OverInItem(self, slotIndex):
		if mouseModule.mouseController.isAttached():
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
    
		if 0 != self.tooltipItem:
			self.tooltipItem.SetItemToolTip(constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage][slotIndex][0])
    
	def OverOutItem(self):
		if 0 != self.tooltipItem:
			self.tooltipItem.HideToolTip()
								
	def OnPressEscapeKey(self):
		self.Close()
		return True
Poți te rog să-mi lași fișierul acela uiChestDrop.py ?Pentru ca să văd linile corect și tab-urile .
Imagine
Afișează semnătura
Avatar utilizator
R8Sentinel
Nivel 2

Nivel 2
Mesaje: 224
Membru din: 23 Iul 2017, 01:17
Server: In lucru
Regat: Chunjo
Aprecieri: 14  
Mulţumiri: 248  
Medalii

Rimex scrie: Poți te rog să-mi lași fișierul acela uiChestDrop.py ?Pentru ca să văd linile corect și tab-urile .
https://pastebin.com/L9zfCmWL
https://ufile.io/00m2s

Skype: ytrid8r
Afișează semnătura
Avatar utilizator
Rimex
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 182
Membru din: 31 Ian 2018, 12:23
Server: BraveS
Regat: Chunjo
Aprecieri: 3  
Mulţumiri: 354  
Discord: Copiază ID
Medalii

R8Sentinel scrie:*Problemă: Am incercat sa bag sistemul Chest info. La partea de sursa client si server nu am avut probleme.
La partea de client am probleme
*Resursă folosită: C++ Chest View Drop
Download: Mega.nz
*ServerFiles utilizat: propiu
*Syserr:

Cod: Selectaţi tot

uiChestDrop.py(line:37) __LoadWindow
ui.py(line:3153) GetChild

GemShopWindow.__LoadWindow.BindObject - <type 'exceptions.KeyError'>:'currentPageBack'
Poză:
*Detalii suplimentare:

Cod: Selectaţi tot

import uiCommon, snd, chat, app, net, player, item, wndMgr, mouseModule, localeInfo, constInfo, ui

class ChestDropWindow(ui.ScriptWindow):
	def __init__(self):
		ui.ScriptWindow.__init__(self)
		
		self.tooltipItem = None

		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1

		self.__LoadWindow()

	def __del__(self):
		ui.ScriptWindow.__del__(self)
		
	def __LoadWindow(self):
		try:
			PythonScriptLoader = ui.PythonScriptLoader()
			PythonScriptLoader.LoadScriptFile(self, "UIScript/chestdropwindow.py")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.LoadObject")

		try:
			self.titleBar = self.GetChild("TitleBar")

			self.openItemSlot = self.GetChild("OpenItemSlot")
			self.openCountController = self.GetChild("OpenCountController")
			self.openChestButtonSingle = self.GetChild("OpenChestButtonSingle")
			self.openChestButtonMultiple = self.GetChild("OpenChestButtonMultiple")
			
			self.prevButton = self.GetChild("prev_button")
			self.nextButton = self.GetChild("next_button")
			self.currentPageBack = self.GetChild("currentPageBack")
			self.currentPageText = self.GetChild("currentPageText")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.BindObject")
			
		self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
		self.openCountController.SetEvent(ui.__mem_func__(self.OnChangeOpenAmount))
		
		self.openChestButtonSingle.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		self.openChestButtonMultiple.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)
		
		self.prevButton.SetEvent(ui.__mem_func__(self.OnClickPrevPage))
		self.nextButton.SetEvent(ui.__mem_func__(self.OnClickNextPage))
		
		self.currentPageText.SetText(str(self.currentPage))

		wndItem = ui.GridSlotWindow()
		wndItem.SetParent(self)
		wndItem.SetPosition(8, 35)
		wndItem.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
		wndItem.ArrangeSlot(0, 15, 5, 32, 32, 0, 0)
		wndItem.RefreshSlot()
		wndItem.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0)
		wndItem.Show()
		
		self.wndItem = wndItem
		
	def Close(self):
		self.Hide()
		
	def Destroy(self):
		self.ClearDictionary()
		
		self.tooltipItem = None
		self.wndItem = None
		
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1
		
	def Open(self, invItemPos = -1):
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		
		self.SetInvItemSlot(invItemPos)
	
		self.SetTop()
		self.SetCenterPosition()
		self.Show()

	def SetItemToolTip(self, tooltip):
		self.tooltipItem = tooltip
		
	def OnChangeOpenAmount(self):
		openTemp = int(self.openCountController.GetSliderPos() * 10)
		if openTemp == 0:
			self.openAmount = 1
		else:
			self.openAmount = openTemp
			
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)

	def OnClickOpenChest(self):
		if self.invItemPos == -1:
			return
			
		itemCount = player.GetItemCount(self.invItemPos)

		if itemCount >= self.openAmount:
			for i in xrange(self.openAmount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
		else:
			for i in xrange(itemCount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
					
	def OnClickPrevPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage - 1):
			self.currentPage = self.currentPage - 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
		
	def OnClickNextPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage + 1):
			self.currentPage = self.currentPage + 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
			
	def EnableMultiPage(self):
		self.openChestButtonSingle.Hide()
		self.openChestButtonMultiple.Show()
		
		self.prevButton.Show()
		self.nextButton.Show()
		self.currentPageBack.Show()
		
	def EnableSinglePage(self):
		self.openChestButtonSingle.Show()
		self.openChestButtonMultiple.Hide()
		
		self.prevButton.Hide()
		self.nextButton.Hide()
		self.currentPageBack.Hide()	
		
	def SetInvItemSlot(self, invItemPos):
		self.invItemPos = invItemPos
		
		itemVnum = player.GetItemIndex(invItemPos)
		itemCount = player.GetItemCount(invItemPos)
		if itemVnum:
			self.openItemSlot.SetItemSlot(0, itemVnum, itemCount)
			
	def RefreshItems(self, chestVnum):
		if chestVnum:
			self.currentChest = chestVnum
			
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(2):
			self.EnableMultiPage()
		else:
			self.EnableSinglePage()
			
		self.RefreshItemSlot()

	def RefreshItemSlot(self):
		for i in xrange(15 * 5):
			self.wndItem.ClearSlot(i)
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
			
		for key, value in constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage].iteritems():
			itemVnum = value[0]
			itemCount = value[1]

			if itemCount <= 1:
				itemCount = 0
			
			self.wndItem.SetItemSlot(key, itemVnum, itemCount)
			
		wndMgr.RefreshSlot(self.wndItem.GetWindowHandle())
			
	def OverInItem(self, slotIndex):
		if mouseModule.mouseController.isAttached():
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
    
		if 0 != self.tooltipItem:
			self.tooltipItem.SetItemToolTip(constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage][slotIndex][0])
    
	def OverOutItem(self):
		if 0 != self.tooltipItem:
			self.tooltipItem.HideToolTip()
								
	def OnPressEscapeKey(self):
		self.Close()
		return True
https://mega.nz/#!FjgzgYAZ!DjXYOtVPjmo8 ... Cm7LCzxdSc
Încearcă cu ăsta .
Imagine
Afișează semnătura
Avatar utilizator
R8Sentinel
Nivel 2

Nivel 2
Mesaje: 224
Membru din: 23 Iul 2017, 01:17
Server: In lucru
Regat: Chunjo
Aprecieri: 14  
Mulţumiri: 248  
Medalii

Rimex scrie:
R8Sentinel scrie:*Problemă: Am incercat sa bag sistemul Chest info. La partea de sursa client si server nu am avut probleme.
La partea de client am probleme
*Resursă folosită: C++ Chest View Drop
Download: Mega.nz
*ServerFiles utilizat: propiu
*Syserr:

Cod: Selectaţi tot

uiChestDrop.py(line:37) __LoadWindow
ui.py(line:3153) GetChild

GemShopWindow.__LoadWindow.BindObject - <type 'exceptions.KeyError'>:'currentPageBack'
Poză:
*Detalii suplimentare:

Cod: Selectaţi tot

import uiCommon, snd, chat, app, net, player, item, wndMgr, mouseModule, localeInfo, constInfo, ui

class ChestDropWindow(ui.ScriptWindow):
	def __init__(self):
		ui.ScriptWindow.__init__(self)
		
		self.tooltipItem = None

		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1

		self.__LoadWindow()

	def __del__(self):
		ui.ScriptWindow.__del__(self)
		
	def __LoadWindow(self):
		try:
			PythonScriptLoader = ui.PythonScriptLoader()
			PythonScriptLoader.LoadScriptFile(self, "UIScript/chestdropwindow.py")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.LoadObject")

		try:
			self.titleBar = self.GetChild("TitleBar")

			self.openItemSlot = self.GetChild("OpenItemSlot")
			self.openCountController = self.GetChild("OpenCountController")
			self.openChestButtonSingle = self.GetChild("OpenChestButtonSingle")
			self.openChestButtonMultiple = self.GetChild("OpenChestButtonMultiple")
			
			self.prevButton = self.GetChild("prev_button")
			self.nextButton = self.GetChild("next_button")
			self.currentPageBack = self.GetChild("currentPageBack")
			self.currentPageText = self.GetChild("currentPageText")
		except:
			import exception
			exception.Abort("GemShopWindow.__LoadWindow.BindObject")
			
		self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))
		self.openCountController.SetEvent(ui.__mem_func__(self.OnChangeOpenAmount))
		
		self.openChestButtonSingle.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		self.openChestButtonMultiple.SetEvent(ui.__mem_func__(self.OnClickOpenChest))
		
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)
		
		self.prevButton.SetEvent(ui.__mem_func__(self.OnClickPrevPage))
		self.nextButton.SetEvent(ui.__mem_func__(self.OnClickNextPage))
		
		self.currentPageText.SetText(str(self.currentPage))

		wndItem = ui.GridSlotWindow()
		wndItem.SetParent(self)
		wndItem.SetPosition(8, 35)
		wndItem.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
		wndItem.ArrangeSlot(0, 15, 5, 32, 32, 0, 0)
		wndItem.RefreshSlot()
		wndItem.SetSlotBaseImage("d:/ymir work/ui/public/Slot_Base.sub", 1.0, 1.0, 1.0, 1.0)
		wndItem.Show()
		
		self.wndItem = wndItem
		
	def Close(self):
		self.Hide()
		
	def Destroy(self):
		self.ClearDictionary()
		
		self.tooltipItem = None
		self.wndItem = None
		
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		self.invItemPos = -1
		
	def Open(self, invItemPos = -1):
		self.currentChest = 0
		self.currentPage = 1
		self.openAmount = 1
		
		self.SetInvItemSlot(invItemPos)
	
		self.SetTop()
		self.SetCenterPosition()
		self.Show()

	def SetItemToolTip(self, tooltip):
		self.tooltipItem = tooltip
		
	def OnChangeOpenAmount(self):
		openTemp = int(self.openCountController.GetSliderPos() * 10)
		if openTemp == 0:
			self.openAmount = 1
		else:
			self.openAmount = openTemp
			
		self.openChestButtonSingle.SetText("Deschide %d cufere" % self.openAmount)
		self.openChestButtonMultiple.SetText("Deschide %d cufere" % self.openAmount)

	def OnClickOpenChest(self):
		if self.invItemPos == -1:
			return
			
		itemCount = player.GetItemCount(self.invItemPos)

		if itemCount >= self.openAmount:
			for i in xrange(self.openAmount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
		else:
			for i in xrange(itemCount):
				if itemCount == 1:
					net.SendItemUsePacket(self.invItemPos)
					self.OnPressEscapeKey()
					break
					
				net.SendItemUsePacket(self.invItemPos)
				itemCount = itemCount - 1
					
	def OnClickPrevPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage - 1):
			self.currentPage = self.currentPage - 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
		
	def OnClickNextPage(self):
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage + 1):
			self.currentPage = self.currentPage + 1
			self.currentPageText.SetText(str(self.currentPage))
			self.RefreshItemSlot()
			
	def EnableMultiPage(self):
		self.openChestButtonSingle.Hide()
		self.openChestButtonMultiple.Show()
		
		self.prevButton.Show()
		self.nextButton.Show()
		self.currentPageBack.Show()
		
	def EnableSinglePage(self):
		self.openChestButtonSingle.Show()
		self.openChestButtonMultiple.Hide()
		
		self.prevButton.Hide()
		self.nextButton.Hide()
		self.currentPageBack.Hide()	
		
	def SetInvItemSlot(self, invItemPos):
		self.invItemPos = invItemPos
		
		itemVnum = player.GetItemIndex(invItemPos)
		itemCount = player.GetItemCount(invItemPos)
		if itemVnum:
			self.openItemSlot.SetItemSlot(0, itemVnum, itemCount)
			
	def RefreshItems(self, chestVnum):
		if chestVnum:
			self.currentChest = chestVnum
			
		if constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(2):
			self.EnableMultiPage()
		else:
			self.EnableSinglePage()
			
		self.RefreshItemSlot()

	def RefreshItemSlot(self):
		for i in xrange(15 * 5):
			self.wndItem.ClearSlot(i)
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
			
		for key, value in constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage].iteritems():
			itemVnum = value[0]
			itemCount = value[1]

			if itemCount <= 1:
				itemCount = 0
			
			self.wndItem.SetItemSlot(key, itemVnum, itemCount)
			
		wndMgr.RefreshSlot(self.wndItem.GetWindowHandle())
			
	def OverInItem(self, slotIndex):
		if mouseModule.mouseController.isAttached():
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA.has_key(self.currentChest):
			return
			
		if not constInfo.CHEST_DROP_INFO_DATA[self.currentChest].has_key(self.currentPage):
			return
    
		if 0 != self.tooltipItem:
			self.tooltipItem.SetItemToolTip(constInfo.CHEST_DROP_INFO_DATA[self.currentChest][self.currentPage][slotIndex][0])
    
	def OverOutItem(self):
		if 0 != self.tooltipItem:
			self.tooltipItem.HideToolTip()
								
	def OnPressEscapeKey(self):
		self.Close()
		return True
https://mega.nz/#!FjgzgYAZ!DjXYOtVPjmo8 ... Cm7LCzxdSc
Încearcă cu ăsta .

Cod: Selectaţi tot

networkModule.py(line:209) SetSelectCharacterPhase
system.py(line:147) __pack_import
system.py(line:127) _process_result
introSelect.py(line:31) <module>
system.py(line:147) __pack_import
system.py(line:127) _process_result
interfaceModule.py(line:61) <module>
system.py(line:147) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.SyntaxError'>:invalid syntax (uiChestDrop.py, line 19)

Skype: ytrid8r
Afișează semnătura
Avatar utilizator
jumyta
Nivel 2

Nivel 2
Mesaje: 299
Membru din: 06 Ian 2014, 20:41
Regat: Jinno
Aprecieri: 185  
Mulţumiri: 2  
  Rezolvări prob.: 1
Medalii

UP!
Avatar utilizator
jumyta
Nivel 2

Nivel 2
Mesaje: 299
Membru din: 06 Ian 2014, 20:41
Regat: Jinno
Aprecieri: 185  
Mulţumiri: 2  
  Rezolvări prob.: 1
Medalii

up!
Avatar utilizator
R8Sentinel
Nivel 2

Nivel 2
Mesaje: 224
Membru din: 23 Iul 2017, 01:17
Server: In lucru
Regat: Chunjo
Aprecieri: 14  
Mulţumiri: 248  
Medalii

UP

Skype: ytrid8r
Afișează semnătura
Avatar utilizator
jumyta
Nivel 2

Nivel 2
Mesaje: 299
Membru din: 06 Ian 2014, 20:41
Regat: Jinno
Aprecieri: 185  
Mulţumiri: 2  
  Rezolvări prob.: 1
Medalii

Up

[ Postat de pe Android ] Imagine
Avatar utilizator
R8Sentinel
Nivel 2

Nivel 2
Mesaje: 224
Membru din: 23 Iul 2017, 01:17
Server: In lucru
Regat: Chunjo
Aprecieri: 14  
Mulţumiri: 248  
Medalii

UP

Skype: ytrid8r
Afișează semnătura
Închis
Răspunsuri
7
Vizualizări
439
Răspunsuri
12
Vizualizări
1196
Răspunsuri
3
Vizualizări
196
Răspunsuri
5
Vizualizări
573

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 46 vizitatori