Jump to content
  • We need you!

    You must register to discover all the features of our community!

  • 0

Change default color of local selection


ReFresh

Question

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

Link to post

10 answers to this question

Recommended Posts

  • 0
Posted (edited)

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 Ikarus_ (see edit history)

My youtube channel  on which you can see my works here

Link to post
  • 0
Posted (edited)

 

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_ (see edit history)

My youtube channel  on which you can see my works here

Link to post
  • 0
Posted (edited)

@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 (see edit history)
Link to post
  • 0

yeah i ve added it to the previous message, i didn't understood your question at the beginning of my first answer :)

My youtube channel  on which you can see my works here

Link to post
  • 0
Posted (edited)

@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 (see edit history)
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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.