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
Posted (edited)
Spoiler

How about adding an option to the dialog text, to make a previously selected answer become greyed out - just so I know what I've clicked on before.

My quess is that there something with: “worldPlayerDialogChoicesList” ??

Using again print_r(text) i see that there are double answers: 

^0xFF81c6d99.^- ^0xffcecec7"Nothing, Morte. Just checking to see if you were still with me."^-
^0xFF81c6d99.^- ^0xffcecec7"Nothing, Morte. Just checking to see if you were still with me."^-

The `0xFF81c6d9` is color for 1. 2. 3., and 9. is the position in choices list. (0xffcecec7 is color for highlithing) The question is: what function is responsible for doubling answers ? 

Spoiler

Made some progress. it's working...

BUT, the rows color, not saving after reseting the game. SetINI, and GetINI is seems not enough or idk where to put GetINI?


	function setDlgResponsesColor(row)
		Infinity_SetINIValue('Graphics', 'Dlg Responses Color', 1)
		setSaveOption("Dlg Responses Color", tostring(dialogTable[row].text),1)
		return text	
		end

 

 

I managed, it was quite simple though, I was too combinatorial. Although it turns out that every txt string is saved in baldur.lua. So it can take a bit of weight. Will this affect the game itself? That's what I don't know.

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