Jump to content

Change default color of local selection


Recommended Posts

  • Active Member

Hey guys,

 

someone know how to change default color of local button list?

 

Example:

 

Spoiler

local confirm_list = {"Yes. ", "No."} < - - - these are the buttons which will be shown in quest as selection buttons for which I need to change the default color.

 

 

Thanks for answers!

 

Sincerely, 

 

ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Developer

you could try by adding a color tag at the text:

#search
local confirm_list = {"Yes. ", "No."} 

#replace with
local confirm_list = {"|caaaaaaaaYes.|r", "|caaaaaaaaNo.|r"} 

 

 

how to make hexcolor?
aa - aa - aa - aa
r - g - b - a

 

red green blue alpha values
0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f  are the possible values for hex numbers
you can use an hex converter to choice your 0-255 range value

or basically a color picker online (commonly they have hex value of the color)

 

HEX CONVERTER:
spacer.png

 

Edited by Metin2 Dev
Core X - External 2 Internal

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • Developer

 

or if you need to change it only for "select" questions edit from root/uiquest.py:


	def MakeEachButton(self, i):
		if self.skin == 3:
			button = BarButton("TOP_MOST",0x50000000, 0x50404040, 0x50606060)
			button.SetParent(self.board)
			button.SetSize(106,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
			button.SetText("a")
			button.SetTextColor(0xff000000) #<---- change me
		else:
			i = i % 8
			button = BarButton("TOP_MOST")
			button.SetParent(self.board)
			button.SetSize(200,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
			button.SetText("a")
			button.SetTextColor(0xffffffff)  #<---- change me
		return button

 

Edited by Ikarus_

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • Active Member

@Ikarus_ Thanks that was almost everything what I've searched for, but is possible to change the color globally only for the locals? Because I want to preserve the almost white text and make only locals lighter, but globally to make it easier to change.

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Active Member

@Ikarus_ I'm not sure what is full white color... Can you tell me the hex? I have the lines like this:

 

Spoiler

def MakeEachButton(self, i):
		if self.skin == 3:
			button = BarButton("TOP_MOST",0x50000000, 0x50404040, 0x50606060)
			button.SetParent(self.board)
			button.SetSize(106,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
			#button.SetText("a")
			button.SetTextColor(0xff000000)
		else:
			i = i % 8
			button = BarButton("TOP_MOST")
			button.SetParent(self.board)
			button.SetSize(200,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
			#button.SetText("a")
			button.SetTextColor(0xffffffff)
		return button

 

I tried to change these hexes to another hexes but nothing was changed.

But I think this: 0xffffffff is full white, but if I changed it, nothing happened.

 

But when I use this function in server: function say_white(name) say(color256(255, 255, 255) it will show the text as full white text.

 

So I tried to change the client source side like you wrote before:

Spoiler

CTextLine::CTextLine(PyObject * ppyObject) : CWindow(ppyObject)
	{
		m_TextInstance.SetColor(1.0f, 1.0f, 1.0f);
		m_TextInstance.SetHorizonalAlign(CGraphicTextInstance::HORIZONTAL_ALIGN_LEFT);
		m_TextInstance.SetVerticalAlign(CGraphicTextInstance::VERTICAL_ALIGN_TOP);
	}

 

But it'll change color to white not only for the "select" bars. So there must be another way how to change the color of select text bars separately.

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.