Problema butoate laterale pe inventar Problemă rezolvată

În cazul în care aveţi o nelămurire postaţi aici, de asemenea este locul unde puteţi găsi posibile rezolvări la problemele dvs.
Avatar utilizator
xAlin
Nou Venit

Nou Venit
Mesaje: 41
Membru din: 05 Feb 2015, 16:22
Server: In curand
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 0
  Rezolvări prob.: 2
Medalii

*Problemă/Întrebare: Am incercat sa adaug systemul de butoane laterale inventar, poate sa-mi explice cineva cum adaug o functie pe buton, precum depozit sau orice alt exemplu
Tipologie server:
*Resursă folosită: Adalet-CsWork-Fast Menu System(Hızlı Menü Sistemi)
*ServerFiles utilizat: tmp4
*Syserr:

Cod: Selectaţi tot

1217 21:18:14697 :: 
uiPickMoney.py(line:20) LoadDialog
ui.py(line:3290) LoadScriptFile
ui.py(line:3409) LoadChildren
ui.py(line:2145) __init__

MoneyDialog.LoadDialog.LoadScript - <type 'exceptions.AttributeError'>:'BoardWithTitleBar' object has no attribute 'SetCloseEvent'

1217 21:18:14697 :: ============================================================================================================
1217 21:18:14697 :: Abort!!!!
Poză:
*Detalii suplimentare: Cineva mi-a spus sa modific codul original

Cod: Selectaţi tot

		def __LoadWindow(self):
			if self.isLoaded == 1:
				return
			self.isLoaded = 1
			try:
				pyScrLoader = ui.PythonScriptLoader()
				pyScrLoader.LoadScriptFile(self, "UIScript/FastInventoryWindow.py")
			except:
				import exception
				exception.Abort("FastInventoryWindow.LoadWindow.LoadObject")
			try:
				self.wndFastInventoryLayer = self.GetChild("FastInventoryLayer")
				self.GetChild("Menu_1").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_2").SetEvent(ui.__mem_func__(self.ToggleSwitchbotClick))
				self.GetChild("Menu_3").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_4").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_5").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_6").SetEvent(ui.__mem_func__(self.ClickMenu1))
			except:
				import exception
				exception.Abort("FastInventoryWindow.LoadWindow.BindObject")
			try:
				import uiSwitchbot
				self.wndSwitchbot = uiSwitchbot.SwitchbotWindow()
			except:
				import exception
				exception.Abort("FastInventoryWindow.LoadWindow.BindObject")
		def ToggleOfflineShopClick(self):
			return True
		def ToggleSwitchbotClick(self):
			if self.wndSwitchbot.IsShow(): self.wndSwitchbot.Close()
			else: self.wndSwitchbot.Open()
		def ClickMenu1(self):
			if self.wndInventory.interface:
				self.wndInventory.interface.ToggleSwitchbotWindow()
			return True

In acest cod,daca las codul asa primesc eroare pentru ClickMeniu1 pentru ca nu este definit si nu are functie.

Cod: Selectaţi tot

		def __LoadWindow(self):
			if self.isLoaded == 1:
				return
			self.isLoaded = 1
			try:
				pyScrLoader = ui.PythonScriptLoader()
				pyScrLoader.LoadScriptFile(self, "UIScript/FastInventoryWindow.py")
			except:
				import exception
				exception.Abort("FastInventoryWindow.LoadWindow.LoadObject")
			try:
				self.wndFastInventoryLayer = self.GetChild("FastInventoryLayer")
				self.GetChild("Menu_1").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_2").SetEvent(ui.__mem_func__(self.ClickMenu2))
				self.GetChild("Menu_3").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_4").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_5").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_6").SetEvent(ui.__mem_func__(self.ClickMenu1))
			except:
				import exception
				exception.Abort("FastInventoryWindow.LoadWindow.BindObject")
pentru ca aveam eroare pe switchbot, eu neavand functia de switchbot pe server,dupa modificare primesc acea eroare in syser
Eu am mai incercat sa fac in acest fel dar primesc tot aceiasi eroare. Am incercat sa fac mai multe functii dar tot nu merge.

Cod: Selectaţi tot

		def __LoadWindow(self):
			if self.isLoaded == 1:
				return
			self.isLoaded = 1
			try:
				pyScrLoader = ui.PythonScriptLoader()
				pyScrLoader.LoadScriptFile(self, "UIScript/FastInventoryWindow.py")
			except:
				import exception
				exception.Abort("FastInventoryWindow.LoadWindow.LoadObject")
			try:
				self.wndFastInventoryLayer = self.GetChild("FastInventoryLayer")
				self.GetChild("Menu_1").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_2").SetEvent(ui.__mem_func__(self.ClickMenu2))
				self.GetChild("Menu_3").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_4").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_5").SetEvent(ui.__mem_func__(self.ClickMenu1))
				self.GetChild("Menu_6").SetEvent(ui.__mem_func__(self.ClickMenu1))
			except:
				import exception
				exception.Abort("FastInventoryWindow.LoadWindow.BindObject")
		def ClickMenu1(self):
			return True
		def ClickMenu2(self):
			if self.wndInventory.interface:
				self.wndInventory.interface()
			return True
Avatar utilizator
NoNNeX
Nivel 2

Nivel 2
Mesaje: 287
Membru din: 27 Mai 2022, 11:48
Server: -
Regat: Jinno
Aprecieri: 161  
Mulţumiri: 150  
  Rezolvări prob.: 4
Discord: Copiază ID
Medalii

in ui.py functia class BoardWithTitleBar trebuie sa ai def SetCloseEvent
Pentru acest mesaj, NoNNeX for the post:
xAlin
Avatar utilizator
xAlin
Nou Venit

Nou Venit
Mesaje: 41
Membru din: 05 Feb 2015, 16:22
Server: In curand
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 0
  Rezolvări prob.: 2
Medalii

NoNNeX scrie: ↑18 Dec 2023, 18:13 in ui.py functia class BoardWithTitleBar trebuie sa ai def SetCloseEvent
Am facut asta , testez si revin cu un edit

Cod: Selectaţi tot

class BoardWithTitleBar(Board):
	def __init__(self):
		Board.__init__(self)

		titleBar = TitleBar()
		titleBar.SetParent(self)
		titleBar.MakeTitleBar(0, "red")
		titleBar.SetPosition(8, 7)
		titleBar.Show()

		titleName = TextLine()
		titleName.SetParent(titleBar)
		titleName.SetPosition(0, 4)
		titleName.SetWindowHorizontalAlignCenter()
		titleName.SetHorizontalAlignCenter()
		titleName.Show()

		self.titleBar = titleBar
		self.titleName = titleName

		self.SetCloseEvent(self.Hide)

	def __del__(self):
		Board.__del__(self)
		self.titleBar = None
		self.titleName = None

	def SetSize(self, width, height):
		self.titleBar.SetWidth(width - 15)
		#self.pickRestrictWindow.SetSize(width, height - 30)
		Board.SetSize(self, width, height)
		self.titleName.UpdateRect()

	def SetCloseEvent(self, event):
		self.btnClose.SetEvent(event)


EDIT:
Am acest syser acum

Cod: Selectaţi tot

1218 18:51:48599 :: 
uiPickMoney.py(line:20) LoadDialog
ui.py(line:3293) LoadScriptFile
ui.py(line:3412) LoadChildren
ui.py(line:2145) __init__
ui.py(line:2159) SetCloseEvent

MoneyDialog.LoadDialog.LoadScript - <type 'exceptions.AttributeError'>:'BoardWithTitleBar' object has no attribute 'btnClose'

1218 18:51:48599 :: ============================================================================================================
1218 18:51:48600 :: Abort!!!!


EDIT x2
REZOLVAT
Răspunde

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

  • Informaţie
  • Cine este conectat

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