Jump to content

Planescape ee - how to change the font color in dialog box?


szef

Recommended Posts

@lefreut

I'am trying to changing this color  ^0xff7da58c (i assume most of the dialog texts) for let's say #DADADA.

And other colors. I need piece of code, or answer how it may look like, or where to find/learn about ;).

(In websearch... yes yes i know - searching for 4h)

To be more specific, few questions is mayby, this new post-process has to be in the same function as in the code below?

function getDialogEntryText(row)
		local text = dialogTable[row].text
		if (row == worldPlayerDialogSelection) then
			--Color the text white when selected
			text = string.gsub(text, "%^0xff212eff", "^0xFFFFFFFF")
		end
		return text
	end	

 

Something must be instead worldPlayerDialogSelection ...

i'am clueless. Oh, well :D.

Edited by szef
Link to comment

The easiest is probably to add the change in this function yes.

string.gsub is used to replace a substring by another one. The first argument is the string, the second the pattern and the third the replacement.

For example,

this to change all occurrences of '^0xff7da58c' (you have to escape the ^ with a % as otherwise it has a special meaning in regex) into '^0xFFC0CBFF':

text = string.gsub(text, "%^0xff7da58c", "^0xFFC0CBFF")

or this to replace all colors (^0x followed by 8 hex character) with '^0xFFC0CBFF':

text = string.gsub(text, "%^0x%x%x%x%x%x%x%x%x", "^0xFFC0CBFF")

 

Link to comment

Okay, thanks, something's starting clearing up for me (i think).
But what about worldPlayerDialogSelection because this is for... select the choises lines (?).

What, I need enter for "text in the dialogue" - speaking the easiest.

Do you know this?

(Tomorrow will be next round of trying :) ).

Link to comment

It is done. Full code:

function getDialogEntryText(row)
		local text = dialogTable[row].text
		if (not getDialogRowClickable(row)) then
			--Change color font for Characters name
			text = string.gsub(text, "%^0xff75a1b8", "^0xFF81c6d9")
		end
		if (not getDialogRowClickable(row)) then
			--For dialogue lines
			text = string.gsub(text, "%^0xff7da58c", "^0xFFcad3d2")
		end
		if (not getDialogHistory) then
			--For TNO name
			text = string.gsub(text, "%^0xffd5c885", "^0xFF5d6966")
		end
		if (not getDialogHistory) then
			--For the lines said by TNO
			text = string.gsub(text, "%^0xffd7c8a0", "^0xFF5d6966")
		end
		if (not getDialogResponses) then
			--For 1. 2. etc.
			text = string.gsub(text, "%^0xffcec471", "^0xFF111dd8")	
		end
		if (not getDialogClickable) then
			--For list of answers
			text = string.gsub(text, "%^0xff212eff", "^0xFF111dd8")
		end
		if (row == worldPlayerDialogSelection) then
			--For text when selected
			text = string.gsub(text, "%^0xFF111dd8", "^0xFFacacad")
		end
		return text
	end	

 

Thank you lefreut for your help!!

Edited by szef
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...