Problema Interfata Illumina

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
SkyLine
Membru Club

Membru Club
Mesaje: 2655
Membru din: 12 Dec 2013, 23:37
Server: Miraj2-Online
Regat: Jinno
Aprecieri: 520  
Mulţumiri: 987  
Discord: Copiază ID
 Contact:
Medalii

*Problemă/Întrebare:
Tipologie server(PvM / PvP):
*Resursă folosită: mape-interfete/client-interface-illumin ... 46019.html
*ServerFiles utilizat:
*Syserr:
Poză:
*Detalii suplimentare: Am incercat sa bag si eu aceasta interfata pe care de foarte mult timp o vreau in server. Am urmarit acest tutorial, care vad ca este pe bucati, pentru fiecare chestie in parte, nu unul singur pentru absolut tot. Ideea este ca dupa ce l-am bagat, mi-au aparut pe rand niste erori pe care le-am rezolvat .... dar la ultima m-am blocat. Imi da eroare "self" is not defined. Ok, am pus backup-ul de la fisiere si am luat tutorialul de la capat. Am zis sa le pun si sa le aplic pe rand sa vad de unde provine eroarea. Surpriza, provine chiar de la inceput *facepalm*.

Ideea este ca interfata merge, ca ma baga in client, se vad modificarile, dar ma scoate cand ma loghez si imi apareau erorile alea, ultima fiind asta

Cod: Selectaţi tot

Cu acest cod:
[python]class Board(Window):

	CORNER_WIDTH = 55
	CORNER_HEIGHT = 55
	LINE_WIDTH = 128
	LINE_HEIGHT = 128
	
	UT = 0
	UB = 1
	UR = 2
	UL = 3
	ULT = 0
	ULB = 1
	URT = 2
	URB = 3
	D = 0
	LT = 0
	LB = 1
	RT = 2
	RB = 3
	L = 0
	R = 1
	T = 2
	B = 3
	

	def __init__(self):
		Window.__init__(self)

		self.MakeBoard("kanort_work/images/controls/common/board/shadow_bar_", "kanort_work/images/controls/common/board/shadow_corner_", "kanort_work/images/controls/common/board/corner_", "kanort_work/images/controls/common/board/bar_", "kanort_work/images/controls/common/board/decoration_" )
		self.MakeBase()
		self.MakeShadow()

	def MakeBoard(self, shadowbarPath, shadowcornerPath, cornerPath, linePath, decorPath):

		ShadowbarFileNames = [ shadowbarPath+dir+".tga" for dir in ("top", "bottom", "right", "left", ) ]
		ShadowcornerFileNames = [ shadowcornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		CornerFileNames = [ cornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		LineFileNames = [ linePath+dir+".tga" for dir in ("left", "right", "top", "bottom", ) ]
		DecorFileNames = [ decorPath+dir+".tga" for dir in ("leftbottom", ) ]

		self.Shadowbar = []
		for fileName in ShadowbarFileNames:
			Shadowbar = ExpandedImageBox()
			Shadowbar.AddFlag("not_pick")
			Shadowbar.LoadImage(fileName)
			Shadowbar.SetParent(self)
			Shadowbar.SetPosition(0, 0)
			Shadowbar.Show()
			self.Shadowbar.append(Shadowbar)
			
		self.Shadowcorner = []
		for fileName in ShadowcornerFileNames:
			Shadowcorner = ExpandedImageBox()
			Shadowcorner.AddFlag("not_pick")
			Shadowcorner.LoadImage(fileName)
			Shadowcorner.SetParent(self)
			Shadowcorner.SetPosition(0, 0)
			Shadowcorner.Show()
			self.Shadowcorner.append(Shadowcorner)

		self.Corners = []
		for fileName in CornerFileNames:
			Corner = ExpandedImageBox()
			Corner.AddFlag("not_pick")
			Corner.LoadImage(fileName)
			Corner.SetParent(self)
			Corner.SetPosition(0, 0)
			Corner.Show()
			self.Corners.append(Corner)

		self.Lines = []
		for fileName in LineFileNames:
			Line = ExpandedImageBox()
			Line.AddFlag("not_pick")
			Line.LoadImage(fileName)
			Line.SetParent(self)
			Line.SetPosition(0, 0)
			Line.Show()
			self.Lines.append(Line)
		
		self.Decor = []
		for fileName in DecorFileNames:
			Decor = ExpandedImageBox()
			Decor.AddFlag("not_pick")
			Decor.LoadImage(fileName)
			Decor.SetParent(self)
			Decor.SetPosition(0, 0)
			Decor.Show()
			self.Decor.append(Decor)

		self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT)
		self.Shadowbar[self.UL].SetPosition(-18, self.CORNER_HEIGHT)
		self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0)
		self.Shadowbar[self.UT].SetPosition(self.CORNER_WIDTH, -18)

	def MakeBase(self):
		self.Base = ExpandedImageBox()
		self.Base.AddFlag("not_pick")
		self.Base.LoadImage("kanort_work/images/controls/common/board/fill.tga")
		self.Base.SetParent(self)
		self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Base.Show()
		
	def MakeShadow(self):
		self.Shadow = ExpandedImageBox()
		self.Shadow.AddFlag("not_pick")
		self.Shadow.LoadImage("kanort_work/images/controls/common/board/shadow_fill.tga")
		self.Shadow.SetParent(self)
		self.Shadow.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadow.Show()

	def __del__(self):
		Window.__del__(self)

	def SetSize(self, width, height):

		width = max(self.CORNER_WIDTH*2, width)
		height = max(self.CORNER_HEIGHT*2, height)
		Window.SetSize(self, width, height)

		self.Shadowcorner[self.ULT].SetPosition(-18,-18)
		self.Shadowcorner[self.ULB].SetPosition(-18, height - self.CORNER_HEIGHT)
		self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT)
		self.Shadowcorner[self.URT].SetPosition(width - self.CORNER_WIDTH, -18)
		self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0)
		self.Shadowcorner[self.URB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Decor[self.D].SetPosition(0 - 5, height - self.CORNER_HEIGHT)
		self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadowbar[self.UR].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)
		self.Shadowbar[self.UB].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)

		verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
		horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH
		self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Shadowbar[self.UL].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UR].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UT].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)
		self.Shadowbar[self.UB].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)

		if self.Base:
			self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)

		if self.Shadow:
			self.Shadow.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)[/python] 
		
Cand bag codul asta, imi spune " "self" is not defined" . Care naiba din toate self-urile astea? :))
Avatar utilizator
midaseon
Utilizator interzis !

Utilizator interzis !
Mesaje: 326
Membru din: 27 Iun 2018, 19:24
Server: Lucru
Regat: Jinno
Aprecieri: 179  
Mulţumiri: 287  
Medalii

KrYpToNNN scrie: ↑29 Noi 2019, 13:40 *Problemă/Întrebare:
Tipologie server(PvM / PvP):
*Resursă folosită: mape-interfete/client-interface-illumin ... 46019.html
*ServerFiles utilizat:
*Syserr:
Poză:
*Detalii suplimentare: Am incercat sa bag si eu aceasta interfata pe care de foarte mult timp o vreau in server. Am urmarit acest tutorial, care vad ca este pe bucati, pentru fiecare chestie in parte, nu unul singur pentru absolut tot. Ideea este ca dupa ce l-am bagat, mi-au aparut pe rand niste erori pe care le-am rezolvat .... dar la ultima m-am blocat. Imi da eroare "self" is not defined. Ok, am pus backup-ul de la fisiere si am luat tutorialul de la capat. Am zis sa le pun si sa le aplic pe rand sa vad de unde provine eroarea. Surpriza, provine chiar de la inceput *facepalm*.

Ideea este ca interfata merge, ca ma baga in client, se vad modificarile, dar ma scoate cand ma loghez si imi apareau erorile alea, ultima fiind asta

Cod: Selectaţi tot

Cu acest cod:
[python]class Board(Window):

	CORNER_WIDTH = 55
	CORNER_HEIGHT = 55
	LINE_WIDTH = 128
	LINE_HEIGHT = 128
	
	UT = 0
	UB = 1
	UR = 2
	UL = 3
	ULT = 0
	ULB = 1
	URT = 2
	URB = 3
	D = 0
	LT = 0
	LB = 1
	RT = 2
	RB = 3
	L = 0
	R = 1
	T = 2
	B = 3
	

	def __init__(self):
		Window.__init__(self)

		self.MakeBoard("kanort_work/images/controls/common/board/shadow_bar_", "kanort_work/images/controls/common/board/shadow_corner_", "kanort_work/images/controls/common/board/corner_", "kanort_work/images/controls/common/board/bar_", "kanort_work/images/controls/common/board/decoration_" )
		self.MakeBase()
		self.MakeShadow()

	def MakeBoard(self, shadowbarPath, shadowcornerPath, cornerPath, linePath, decorPath):

		ShadowbarFileNames = [ shadowbarPath+dir+".tga" for dir in ("top", "bottom", "right", "left", ) ]
		ShadowcornerFileNames = [ shadowcornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		CornerFileNames = [ cornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		LineFileNames = [ linePath+dir+".tga" for dir in ("left", "right", "top", "bottom", ) ]
		DecorFileNames = [ decorPath+dir+".tga" for dir in ("leftbottom", ) ]

		self.Shadowbar = []
		for fileName in ShadowbarFileNames:
			Shadowbar = ExpandedImageBox()
			Shadowbar.AddFlag("not_pick")
			Shadowbar.LoadImage(fileName)
			Shadowbar.SetParent(self)
			Shadowbar.SetPosition(0, 0)
			Shadowbar.Show()
			self.Shadowbar.append(Shadowbar)
			
		self.Shadowcorner = []
		for fileName in ShadowcornerFileNames:
			Shadowcorner = ExpandedImageBox()
			Shadowcorner.AddFlag("not_pick")
			Shadowcorner.LoadImage(fileName)
			Shadowcorner.SetParent(self)
			Shadowcorner.SetPosition(0, 0)
			Shadowcorner.Show()
			self.Shadowcorner.append(Shadowcorner)

		self.Corners = []
		for fileName in CornerFileNames:
			Corner = ExpandedImageBox()
			Corner.AddFlag("not_pick")
			Corner.LoadImage(fileName)
			Corner.SetParent(self)
			Corner.SetPosition(0, 0)
			Corner.Show()
			self.Corners.append(Corner)

		self.Lines = []
		for fileName in LineFileNames:
			Line = ExpandedImageBox()
			Line.AddFlag("not_pick")
			Line.LoadImage(fileName)
			Line.SetParent(self)
			Line.SetPosition(0, 0)
			Line.Show()
			self.Lines.append(Line)
		
		self.Decor = []
		for fileName in DecorFileNames:
			Decor = ExpandedImageBox()
			Decor.AddFlag("not_pick")
			Decor.LoadImage(fileName)
			Decor.SetParent(self)
			Decor.SetPosition(0, 0)
			Decor.Show()
			self.Decor.append(Decor)

		self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT)
		self.Shadowbar[self.UL].SetPosition(-18, self.CORNER_HEIGHT)
		self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0)
		self.Shadowbar[self.UT].SetPosition(self.CORNER_WIDTH, -18)

	def MakeBase(self):
		self.Base = ExpandedImageBox()
		self.Base.AddFlag("not_pick")
		self.Base.LoadImage("kanort_work/images/controls/common/board/fill.tga")
		self.Base.SetParent(self)
		self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Base.Show()
		
	def MakeShadow(self):
		self.Shadow = ExpandedImageBox()
		self.Shadow.AddFlag("not_pick")
		self.Shadow.LoadImage("kanort_work/images/controls/common/board/shadow_fill.tga")
		self.Shadow.SetParent(self)
		self.Shadow.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadow.Show()

	def __del__(self):
		Window.__del__(self)

	def SetSize(self, width, height):

		width = max(self.CORNER_WIDTH*2, width)
		height = max(self.CORNER_HEIGHT*2, height)
		Window.SetSize(self, width, height)

		self.Shadowcorner[self.ULT].SetPosition(-18,-18)
		self.Shadowcorner[self.ULB].SetPosition(-18, height - self.CORNER_HEIGHT)
		self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT)
		self.Shadowcorner[self.URT].SetPosition(width - self.CORNER_WIDTH, -18)
		self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0)
		self.Shadowcorner[self.URB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Decor[self.D].SetPosition(0 - 5, height - self.CORNER_HEIGHT)
		self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadowbar[self.UR].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)
		self.Shadowbar[self.UB].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)

		verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
		horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH
		self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Shadowbar[self.UL].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UR].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UT].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)
		self.Shadowbar[self.UB].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)

		if self.Base:
			self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)

		if self.Shadow:
			self.Shadow.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)[/python] 
		
Cand bag codul asta, imi spune " "self" is not defined" . Care naiba din toate self-urile astea? :))
eu zic să lași sysser nu codul ;)


off cred ca de aici este:

Cod: Selectaţi tot

		verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
		horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH

Cod: Selectaţi tot

		self.verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
		self.horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH
Ultima oară modificat 29 Noi 2019, 13:45 de către midaseon, modificat 1 dată în total.
Avatar utilizator
SkyLine
Membru Club

Membru Club
Mesaje: 2655
Membru din: 12 Dec 2013, 23:37
Server: Miraj2-Online
Regat: Jinno
Aprecieri: 520  
Mulţumiri: 987  
Discord: Copiază ID
 Contact:
Medalii

midaseon scrie: ↑29 Noi 2019, 13:42
KrYpToNNN scrie: ↑29 Noi 2019, 13:40 *Problemă/Întrebare:
Tipologie server(PvM / PvP):
*Resursă folosită: mape-interfete/client-interface-illumin ... 46019.html
*ServerFiles utilizat:
*Syserr:
Poză:
*Detalii suplimentare: Am incercat sa bag si eu aceasta interfata pe care de foarte mult timp o vreau in server. Am urmarit acest tutorial, care vad ca este pe bucati, pentru fiecare chestie in parte, nu unul singur pentru absolut tot. Ideea este ca dupa ce l-am bagat, mi-au aparut pe rand niste erori pe care le-am rezolvat .... dar la ultima m-am blocat. Imi da eroare "self" is not defined. Ok, am pus backup-ul de la fisiere si am luat tutorialul de la capat. Am zis sa le pun si sa le aplic pe rand sa vad de unde provine eroarea. Surpriza, provine chiar de la inceput *facepalm*.

Ideea este ca interfata merge, ca ma baga in client, se vad modificarile, dar ma scoate cand ma loghez si imi apareau erorile alea, ultima fiind asta

Cod: Selectaţi tot

Cu acest cod:
[python]class Board(Window):

	CORNER_WIDTH = 55
	CORNER_HEIGHT = 55
	LINE_WIDTH = 128
	LINE_HEIGHT = 128
	
	UT = 0
	UB = 1
	UR = 2
	UL = 3
	ULT = 0
	ULB = 1
	URT = 2
	URB = 3
	D = 0
	LT = 0
	LB = 1
	RT = 2
	RB = 3
	L = 0
	R = 1
	T = 2
	B = 3
	

	def __init__(self):
		Window.__init__(self)

		self.MakeBoard("kanort_work/images/controls/common/board/shadow_bar_", "kanort_work/images/controls/common/board/shadow_corner_", "kanort_work/images/controls/common/board/corner_", "kanort_work/images/controls/common/board/bar_", "kanort_work/images/controls/common/board/decoration_" )
		self.MakeBase()
		self.MakeShadow()

	def MakeBoard(self, shadowbarPath, shadowcornerPath, cornerPath, linePath, decorPath):

		ShadowbarFileNames = [ shadowbarPath+dir+".tga" for dir in ("top", "bottom", "right", "left", ) ]
		ShadowcornerFileNames = [ shadowcornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		CornerFileNames = [ cornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		LineFileNames = [ linePath+dir+".tga" for dir in ("left", "right", "top", "bottom", ) ]
		DecorFileNames = [ decorPath+dir+".tga" for dir in ("leftbottom", ) ]

		self.Shadowbar = []
		for fileName in ShadowbarFileNames:
			Shadowbar = ExpandedImageBox()
			Shadowbar.AddFlag("not_pick")
			Shadowbar.LoadImage(fileName)
			Shadowbar.SetParent(self)
			Shadowbar.SetPosition(0, 0)
			Shadowbar.Show()
			self.Shadowbar.append(Shadowbar)
			
		self.Shadowcorner = []
		for fileName in ShadowcornerFileNames:
			Shadowcorner = ExpandedImageBox()
			Shadowcorner.AddFlag("not_pick")
			Shadowcorner.LoadImage(fileName)
			Shadowcorner.SetParent(self)
			Shadowcorner.SetPosition(0, 0)
			Shadowcorner.Show()
			self.Shadowcorner.append(Shadowcorner)

		self.Corners = []
		for fileName in CornerFileNames:
			Corner = ExpandedImageBox()
			Corner.AddFlag("not_pick")
			Corner.LoadImage(fileName)
			Corner.SetParent(self)
			Corner.SetPosition(0, 0)
			Corner.Show()
			self.Corners.append(Corner)

		self.Lines = []
		for fileName in LineFileNames:
			Line = ExpandedImageBox()
			Line.AddFlag("not_pick")
			Line.LoadImage(fileName)
			Line.SetParent(self)
			Line.SetPosition(0, 0)
			Line.Show()
			self.Lines.append(Line)
		
		self.Decor = []
		for fileName in DecorFileNames:
			Decor = ExpandedImageBox()
			Decor.AddFlag("not_pick")
			Decor.LoadImage(fileName)
			Decor.SetParent(self)
			Decor.SetPosition(0, 0)
			Decor.Show()
			self.Decor.append(Decor)

		self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT)
		self.Shadowbar[self.UL].SetPosition(-18, self.CORNER_HEIGHT)
		self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0)
		self.Shadowbar[self.UT].SetPosition(self.CORNER_WIDTH, -18)

	def MakeBase(self):
		self.Base = ExpandedImageBox()
		self.Base.AddFlag("not_pick")
		self.Base.LoadImage("kanort_work/images/controls/common/board/fill.tga")
		self.Base.SetParent(self)
		self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Base.Show()
		
	def MakeShadow(self):
		self.Shadow = ExpandedImageBox()
		self.Shadow.AddFlag("not_pick")
		self.Shadow.LoadImage("kanort_work/images/controls/common/board/shadow_fill.tga")
		self.Shadow.SetParent(self)
		self.Shadow.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadow.Show()

	def __del__(self):
		Window.__del__(self)

	def SetSize(self, width, height):

		width = max(self.CORNER_WIDTH*2, width)
		height = max(self.CORNER_HEIGHT*2, height)
		Window.SetSize(self, width, height)

		self.Shadowcorner[self.ULT].SetPosition(-18,-18)
		self.Shadowcorner[self.ULB].SetPosition(-18, height - self.CORNER_HEIGHT)
		self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT)
		self.Shadowcorner[self.URT].SetPosition(width - self.CORNER_WIDTH, -18)
		self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0)
		self.Shadowcorner[self.URB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Decor[self.D].SetPosition(0 - 5, height - self.CORNER_HEIGHT)
		self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadowbar[self.UR].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)
		self.Shadowbar[self.UB].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)

		verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
		horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH
		self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Shadowbar[self.UL].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UR].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UT].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)
		self.Shadowbar[self.UB].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)

		if self.Base:
			self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)

		if self.Shadow:
			self.Shadow.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)[/python] 
		
Cand bag codul asta, imi spune " "self" is not defined" . Care naiba din toate self-urile astea? :))
eu zic să lași sysser nu codul ;)
-_- ....

Cod: Selectaţi tot

1129 13:26:06976 :: 
networkModule.py(line:193) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:28) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:14) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiInventory.py(line:40) <module>
uiInventory.py(line:115) CostumeWindow

networkModule.SetSelectCharacterPhase - <type 'exceptions.NameError'>:name 'self' is not defined

1129 13:26:06977 :: ============================================================================================================
1129 13:26:06977 :: Abort!!!!


Am si specificat ce eroare e si cand apare...dar ok, ti-am lasat syserr aici
Avatar utilizator
midaseon
Utilizator interzis !

Utilizator interzis !
Mesaje: 326
Membru din: 27 Iun 2018, 19:24
Server: Lucru
Regat: Jinno
Aprecieri: 179  
Mulţumiri: 287  
Medalii

KrYpToNNN scrie: ↑29 Noi 2019, 13:44
midaseon scrie: ↑29 Noi 2019, 13:42
KrYpToNNN scrie: ↑29 Noi 2019, 13:40 *Problemă/Întrebare:
Tipologie server(PvM / PvP):
*Resursă folosită: mape-interfete/client-interface-illumin ... 46019.html
*ServerFiles utilizat:
*Syserr:
Poză:
*Detalii suplimentare: Am incercat sa bag si eu aceasta interfata pe care de foarte mult timp o vreau in server. Am urmarit acest tutorial, care vad ca este pe bucati, pentru fiecare chestie in parte, nu unul singur pentru absolut tot. Ideea este ca dupa ce l-am bagat, mi-au aparut pe rand niste erori pe care le-am rezolvat .... dar la ultima m-am blocat. Imi da eroare "self" is not defined. Ok, am pus backup-ul de la fisiere si am luat tutorialul de la capat. Am zis sa le pun si sa le aplic pe rand sa vad de unde provine eroarea. Surpriza, provine chiar de la inceput *facepalm*.

Ideea este ca interfata merge, ca ma baga in client, se vad modificarile, dar ma scoate cand ma loghez si imi apareau erorile alea, ultima fiind asta

Cod: Selectaţi tot

Cu acest cod:
[python]class Board(Window):

	CORNER_WIDTH = 55
	CORNER_HEIGHT = 55
	LINE_WIDTH = 128
	LINE_HEIGHT = 128
	
	UT = 0
	UB = 1
	UR = 2
	UL = 3
	ULT = 0
	ULB = 1
	URT = 2
	URB = 3
	D = 0
	LT = 0
	LB = 1
	RT = 2
	RB = 3
	L = 0
	R = 1
	T = 2
	B = 3
	

	def __init__(self):
		Window.__init__(self)

		self.MakeBoard("kanort_work/images/controls/common/board/shadow_bar_", "kanort_work/images/controls/common/board/shadow_corner_", "kanort_work/images/controls/common/board/corner_", "kanort_work/images/controls/common/board/bar_", "kanort_work/images/controls/common/board/decoration_" )
		self.MakeBase()
		self.MakeShadow()

	def MakeBoard(self, shadowbarPath, shadowcornerPath, cornerPath, linePath, decorPath):

		ShadowbarFileNames = [ shadowbarPath+dir+".tga" for dir in ("top", "bottom", "right", "left", ) ]
		ShadowcornerFileNames = [ shadowcornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		CornerFileNames = [ cornerPath+dir+".tga" for dir in ("lefttop", "leftbottom", "righttop", "rightbottom", ) ]
		LineFileNames = [ linePath+dir+".tga" for dir in ("left", "right", "top", "bottom", ) ]
		DecorFileNames = [ decorPath+dir+".tga" for dir in ("leftbottom", ) ]

		self.Shadowbar = []
		for fileName in ShadowbarFileNames:
			Shadowbar = ExpandedImageBox()
			Shadowbar.AddFlag("not_pick")
			Shadowbar.LoadImage(fileName)
			Shadowbar.SetParent(self)
			Shadowbar.SetPosition(0, 0)
			Shadowbar.Show()
			self.Shadowbar.append(Shadowbar)
			
		self.Shadowcorner = []
		for fileName in ShadowcornerFileNames:
			Shadowcorner = ExpandedImageBox()
			Shadowcorner.AddFlag("not_pick")
			Shadowcorner.LoadImage(fileName)
			Shadowcorner.SetParent(self)
			Shadowcorner.SetPosition(0, 0)
			Shadowcorner.Show()
			self.Shadowcorner.append(Shadowcorner)

		self.Corners = []
		for fileName in CornerFileNames:
			Corner = ExpandedImageBox()
			Corner.AddFlag("not_pick")
			Corner.LoadImage(fileName)
			Corner.SetParent(self)
			Corner.SetPosition(0, 0)
			Corner.Show()
			self.Corners.append(Corner)

		self.Lines = []
		for fileName in LineFileNames:
			Line = ExpandedImageBox()
			Line.AddFlag("not_pick")
			Line.LoadImage(fileName)
			Line.SetParent(self)
			Line.SetPosition(0, 0)
			Line.Show()
			self.Lines.append(Line)
		
		self.Decor = []
		for fileName in DecorFileNames:
			Decor = ExpandedImageBox()
			Decor.AddFlag("not_pick")
			Decor.LoadImage(fileName)
			Decor.SetParent(self)
			Decor.SetPosition(0, 0)
			Decor.Show()
			self.Decor.append(Decor)

		self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT)
		self.Shadowbar[self.UL].SetPosition(-18, self.CORNER_HEIGHT)
		self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0)
		self.Shadowbar[self.UT].SetPosition(self.CORNER_WIDTH, -18)

	def MakeBase(self):
		self.Base = ExpandedImageBox()
		self.Base.AddFlag("not_pick")
		self.Base.LoadImage("kanort_work/images/controls/common/board/fill.tga")
		self.Base.SetParent(self)
		self.Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Base.Show()
		
	def MakeShadow(self):
		self.Shadow = ExpandedImageBox()
		self.Shadow.AddFlag("not_pick")
		self.Shadow.LoadImage("kanort_work/images/controls/common/board/shadow_fill.tga")
		self.Shadow.SetParent(self)
		self.Shadow.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadow.Show()

	def __del__(self):
		Window.__del__(self)

	def SetSize(self, width, height):

		width = max(self.CORNER_WIDTH*2, width)
		height = max(self.CORNER_HEIGHT*2, height)
		Window.SetSize(self, width, height)

		self.Shadowcorner[self.ULT].SetPosition(-18,-18)
		self.Shadowcorner[self.ULB].SetPosition(-18, height - self.CORNER_HEIGHT)
		self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT)
		self.Shadowcorner[self.URT].SetPosition(width - self.CORNER_WIDTH, -18)
		self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0)
		self.Shadowcorner[self.URB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Decor[self.D].SetPosition(0 - 5, height - self.CORNER_HEIGHT)
		self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Shadowbar[self.UR].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)
		self.Shadowbar[self.UB].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)

		verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
		horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH
		self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Shadowbar[self.UL].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UR].SetRenderingRect(0, 0, 0, height - self.CORNER_HEIGHT*2 - 1)
		self.Shadowbar[self.UT].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)
		self.Shadowbar[self.UB].SetRenderingRect(0, 0, width - self.CORNER_WIDTH*2 - 1, 0)

		if self.Base:
			self.Base.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)

		if self.Shadow:
			self.Shadow.SetRenderingRect(0, 0, horizontalShowingPercentage, verticalShowingPercentage)[/python] 
		
Cand bag codul asta, imi spune " "self" is not defined" . Care naiba din toate self-urile astea? :))
eu zic să lași sysser nu codul ;)
-_- ....

Cod: Selectaţi tot

1129 13:26:06976 :: 
networkModule.py(line:193) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:28) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:14) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiInventory.py(line:40) <module>
uiInventory.py(line:115) CostumeWindow

networkModule.SetSelectCharacterPhase - <type 'exceptions.NameError'>:name 'self' is not defined

1129 13:26:06977 :: ============================================================================================================
1129 13:26:06977 :: Abort!!!!


Am si specificat ce eroare e si cand apare...dar ok, ti-am lasat syserr aici
vezi mai sus că am dat edit
Avatar utilizator
SkyLine
Membru Club

Membru Club
Mesaje: 2655
Membru din: 12 Dec 2013, 23:37
Server: Miraj2-Online
Regat: Jinno
Aprecieri: 520  
Mulţumiri: 987  
Discord: Copiază ID
 Contact:
Medalii

midaseon scrie: ↑29 Noi 2019, 13:48
KrYpToNNN scrie: ↑29 Noi 2019, 13:44
midaseon scrie: ↑29 Noi 2019, 13:42

eu zic să lași sysser nu codul ;)
-_- ....

Cod: Selectaţi tot

1129 13:26:06976 :: 
networkModule.py(line:193) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:28) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:14) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiInventory.py(line:40) <module>
uiInventory.py(line:115) CostumeWindow

networkModule.SetSelectCharacterPhase - <type 'exceptions.NameError'>:name 'self' is not defined

1129 13:26:06977 :: ============================================================================================================
1129 13:26:06977 :: Abort!!!!


Am si specificat ce eroare e si cand apare...dar ok, ti-am lasat syserr aici
vezi mai sus că am dat edit
se pare ca nu era de la aia, am pus "self." in fata si-mi da asta
Imagine
Avatar utilizator
FRANCIS
Administrator Adjunct

Administrator Adjunct
Mesaje: 7879
Membru din: 06 Noi 2015, 19:52
Regat: Chunjo
Aprecieri: 334  
Mulţumiri: 54528  
Discord: Copiază ID
Medalii

sus de tot import verticalShowingPercentage

[ Postat de pe iPhone ] Imagine
If you talk to a man in a language he understands, that goes to his head. If you talk to him in his own language, that goes to his heart.
Imagine
ENJOY
Imagine
Afișează semnătura
Avatar utilizator
SkyLine
Membru Club

Membru Club
Mesaje: 2655
Membru din: 12 Dec 2013, 23:37
Server: Miraj2-Online
Regat: Jinno
Aprecieri: 520  
Mulţumiri: 987  
Discord: Copiază ID
 Contact:
Medalii

Moș tatakuly scrie: ↑29 Noi 2019, 14:34 sus de tot import verticalShowingPercentage

[ Postat de pe iPhone ] Imagine
Imagine
Avatar utilizator
Ley
Nivel 9

Nivel 9
Mesaje: 1934
Membru din: 09 Feb 2017, 22:30
Server: Colossus2
Regat: Jinno
Aprecieri: 221  
Mulţumiri: 1338  
Medalii

Subiect inactiv.
Imagine
Afișează semnătura
Închis
Răspunsuri
4
Vizualizări
588
Răspunsuri
2
Vizualizări
546

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

  • Informaţie