Cerere pagina bonusuri modificata

Închis
Avatar utilizator
alinjuve23
Nivel 2

Nivel 2
Mesaje: 239
Membru din: 23 Apr 2015, 17:10
Aprecieri: 451  
Mulţumiri: 21  
Medalii

Salut, are cineva aceasta pagina de bonusuri modificata? (cea cu bonusurile aproapiate, de se vad aproape toate bonusuri fara a dat scroll in jos).
Am incercat sa o modific, dar nu reusesc, nu se alineaza cum trebuie..
Multumesc!
Imagine
Avatar utilizator
alinjuve23
Nivel 2

Nivel 2
Mesaje: 239
Membru din: 23 Apr 2015, 17:10
Aprecieri: 451  
Mulţumiri: 21  
Medalii

Careva?
Multumesc!
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

cauta bonus board metin2dev
da la imagini
si ai acolo topic :mindblown:
Pentru acest mesaj, [HF]White for the post:
alinjuve23
Avatar utilizator
alinjuve23
Nivel 2

Nivel 2
Mesaje: 239
Membru din: 23 Apr 2015, 17:10
Aprecieri: 451  
Mulţumiri: 21  
Medalii

Multumesc!
https://metin2.dev/topic/22682-bonus-page/

EDIT:
Ai idee cum pot alinia textul cu denumirea bonusuri la stanga? sa nu fie center ...
Am incercat sa modific peste tot, dar ramane tot pe center ...
Imagine
Acesta este numele bonusului, degeaba adaug "all_align" : "left" ca il muta mai la stanga, dar ramane tot centrat !

Cod: Selectaţi tot

				{ 
							"name" : "labelname0", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*0,
				},
Tot fisierul UI:

Cod: Selectaţi tot

import localeInfo
import uiScriptLocale

LOCALE_PATH = uiScriptLocale.WINDOWS_PATH

MAINBOARD_WIDTH = 200
MAINBOARD_HEIGHT = 364

LABEL_START_X = 120
LABEL_START_Y = 39
LABEL_START_Y_FIX = 46
LABEL_WIDTH = 50
LABEL_HEIGHT = 17
LABEL_GAP = LABEL_HEIGHT+7
LABEL_NAME_POS_X = 70
TITLE_BAR_POS_X = 10
TITLE_BAR_WIDTH = 163

window = {
	"name" : "CharacterDetailsWindow",
	"style" : ("float",),
	
	"x" : 274,
	"y" : (SCREEN_HEIGHT - 398) / 2,

	"width" : MAINBOARD_WIDTH,
	"height" : MAINBOARD_HEIGHT,
	
	"children" :
	(
		{
			"name" : "MainBoard",
			"type" : "board",
			"style" : ("attach","ltr"),
			
			"x" : 0,
			"y" : 0,

			"width" : MAINBOARD_WIDTH,
			"height" : MAINBOARD_HEIGHT,			

			"children" :	
			(
				{
					"name" : "TitleBar",
					"type" : "titlebar",
					"style" : ("attach",),

					"x" : 6,
					"y" : 7,

					"width" : MAINBOARD_WIDTH - 13,
					
					"children" :
					(
						{ "name" : "TitleName", "type" : "text", "x" : 0, "y" : 0, "text": localeInfo.DETAILS_TITLE, "all_align" : "center",},
					),
				},
							
				{
					"name" : "ScrollBar",
					"type" : "scrollbar",

					"x" : 24,
					"y" : 31,
					"size" : MAINBOARD_HEIGHT - 40,

					"horizontal_align" : "right",
				},

				{ 
					"name" : "horizontalbar0", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*0, "width":TITLE_BAR_WIDTH, 
					"children" : ( { "name" : "horizontalbarName0", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar1", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*1, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName1", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar2", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*2, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName2", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar3", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*3, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName3", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar4", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*4, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName4", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar5", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*5, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName5", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar6", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*6, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName6", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar7", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*7, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName7", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar8", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*8, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName8", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar9", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*9, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName9", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar10", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*10, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName10", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar11", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*11, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName11", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				{ 
					"name" : "horizontalbar12", "type":"horizontalbar", "x":TITLE_BAR_POS_X, "y":LABEL_START_Y+LABEL_GAP*12, "width":TITLE_BAR_WIDTH,
					"children" : ( { "name" : "horizontalbarName12", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", }, ),
				},
				
				{
					"name" : "label0", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*0, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue0", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label1", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*1, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue1", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label2", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*2, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue2", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label3", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*3, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue3", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label4", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*4, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue4", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label5", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*5, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue5", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label6", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*6, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue6", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label7", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*7, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue7", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label8", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*8, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue8", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label9", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*9, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue9", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label10", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*10, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue10", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label11", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*11, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue11", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				{
					"name" : "label12", "type" : "thinboard_circle", "x" : LABEL_START_X, "y" : LABEL_START_Y+LABEL_GAP*12, "width" : LABEL_WIDTH, "height" : LABEL_HEIGHT,
					"children" : ( 
						{ "name" : "labelvalue12", "type" : "text", "x" : 0, "y" : 0, "text" : "", "all_align" : "center", },
					),
				},
				
				{ 
							"name" : "labelname0", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*0,
				},
				{ 
							"name" : "labelname1", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*1, 
				},
				{ 
							"name" : "labelname2", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*2, 
				},
				{ 
							"name" : "labelname3", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*3, 
				},
				{ 
							"name" : "labelname4", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*4, 
				},
				{ 
							"name" : "labelname5", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*5, 
				},	
				{ 
							"name" : "labelname6", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*6, 
				},	
				{ 
							"name" : "labelname7", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*7, 
				},	
				{ 
							"name" : "labelname8", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*8, 
				},	
				{ 
							"name" : "labelname9", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*9, 
				},	
				{ 
							"name" : "labelname10", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*10, 
				},	
				{ 
							"name" : "labelname11", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*11, 
				},	
				{ 
							"name" : "labelname12", "type" : "button",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*12,
				},
			),
		},
	),
}
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

nu am reusit nici eu sa fac, este din ui problema deorece in uicharacter.py se foloseste SetText din clasa Button care este setata pe center, iar daca scoti center din ui class button, textu de la butoane nu se mai centreaza. daca rezolvi, anunta ma si pe mine

in class Button cauta:

Cod: Selectaţi tot

	def SetText(self, text, height = 4):

		if not self.ButtonText:
			textLine = TextLine()
			textLine.SetParent(self)
			textLine.SetPosition(self.GetWidth()/2, self.GetHeight()/2)
			textLine.SetVerticalAlignCenter()
			textLine.SetHorizontalAlignCenter()
			textLine.Show()
			self.ButtonText = textLine

		self.ButtonText.SetText(text)
sterge sau comenteaza textLine.SetHorizontalAlignCenter() si ai sa vezi ca se aliniaza la stanga, dar se aliniaza la toate butoanele din joc.
Avatar utilizator
alinjuve23
Nivel 2

Nivel 2
Mesaje: 239
Membru din: 23 Apr 2015, 17:10
Aprecieri: 451  
Mulţumiri: 21  
Medalii

Am inteles !
Problema e ca folosim type : "button".

Modifica tot in type text, asa:

Cod: Selectaţi tot

				{ 
							"name" : "labelname0", "type" : "text",
							"x" : LABEL_NAME_POS_X, "y" : LABEL_START_Y_FIX+LABEL_GAP*0,
				},
Acum in uicharacterdetails.py, comenteaza:

Cod: Selectaţi tot

#self.labelTextList[i].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), i )
#self.labelTextList[i].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), i )

Cod: Selectaţi tot

	#def __ButtonOverIn(self, i):
		#idx = i + self.ScollPos
		#tooltip = self.InfoList[idx][self.INFO_TOOLTIP]
		
		#arglen = len(str(tooltip))
		#pos_x, pos_y = wndMgr.GetMousePosition()
		
		#self.toolTip.ClearToolTip()
		#self.toolTip.SetThinBoardSize(11 * arglen)
		#self.toolTip.SetToolTipPosition(pos_x + 50, pos_y + 50)
		#self.toolTip.AppendTextLine(tooltip, 0xffffff00)
		#self.toolTip.Show()		
		
	#def __ButtonOverOut(self, idx):
		#self.toolTip.Hide()
Si functioneaza:
Imagine
Se poate da TC. Multumesc!
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

Intr-adevar rezolva, dar nu mai merge dupa tooltip-ul la bonusuri..

Edit: Am rezolvat, mersi de idee alinjuve23




Cauta in ui:

Cod: Selectaţi tot

			elif Type == "button":
				parent.Children[Index] = Button()
				parent.Children[Index].SetParent(parent)
				self.LoadElementButton(parent.Children[Index], ElementValue, parent)

sub adauga:

Cod: Selectaţi tot

			elif Type == "button2":
				parent.Children[Index] = Button2()
				parent.Children[Index].SetParent(parent)
				self.LoadElementButton(parent.Children[Index], ElementValue, parent)
acum cauta class Button

si copiaz-o toata, dupa care ii dai paste si schimbi numele in class Button2.

cauta

Cod: Selectaţi tot

	def SetText(self, text, height = 4):

		if not self.ButtonText:
			textLine = TextLine()
			textLine.SetParent(self)
			textLine.SetPosition(self.GetWidth()/2, self.GetHeight()/2)
			textLine.SetVerticalAlignCenter()
			textLine.SetHorizontalAlignCenter()
			textLine.Show()
			self.ButtonText = textLine

		self.ButtonText.SetText(text)
Modifica:

Cod: Selectaţi tot

 textLine.SetHorizontalAlignCenter()


In:

Cod: Selectaţi tot

textLine.SetHorizontalAlignLeft()
Dupa te duci in characterdetailswindow.py, cauta toate "type" : "button"

si schimba in "type" : "button2"

Dupa cauta LABEL_NAME_POS_X = 24 si schimba 24 in -13
Pentru acest mesaj, [HF]White for the post:
alinjuve23
Avatar utilizator
[RaKu]
Membru Club

Membru Club
Mesaje: 2137
Membru din: 30 Noi 2016, 21:49
Regat: Jinno
Aprecieri: 202  
Mulţumiri: 424  
Discord: Copiază ID
Medalii

Rezolvat.
Închis
Răspunsuri
6
Vizualizări
841
Răspunsuri
1
Vizualizări
237
Răspunsuri
1
Vizualizări
1168

Înapoi la “Cereri Rezolvate”

  • Informaţie
  • Cine este conectat

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