How do i grey out a Dialog option

Started by AndreasBlack, Fri 15/04/2022 16:23:29

Previous topic - Next topic

AndreasBlack

But still having it be selectable. I'm using Thumbleweed template, thanks!

Cassiebsg

I don't know if the Thumbleweed template has that built in, but AGS has an option for it:

From the manual:

game.read_dialog_option_color


"By default, -1. You can set this to a color number, in which case dialog options that the player has selected before will be displayed in this color."
There are those who believe that life here began out there...

AndreasBlack

Quote from: Cassiebsg on Fri 15/04/2022 16:43:21
I don't know if the Thumbleweed template has that built in, but AGS has an option for it:

From the manual:

game.read_dialog_option_color


"By default, -1. You can set this to a color number, in which case dialog options that the player has selected before will be displayed in this color."

Thanks, it's a custom Gui it seems so i didn't get that to work but i did change the "value" inside of the Script and that turned the white colour of all the dialogs to another color so that's one step in the right direction, i guess.

To clarify if i've spoken one option before that option should show up again but be a bit gray/grey looking so the player knows he/she have clicked it before.

Khris

In the long run someone should probably add an option for that to the script, but for now you can do this:


  • open the main script of the CustomDialogGui
  • find lines 558-559 (they set the text color)
  • replace them with
Code: ags
      if (info.ActiveOptionID == current_option) info.Surface.DrawingColor = CDG_options.text_color_active;
      else if (!info.DialogToRender.HasOptionBeenChosen(current_option)) info.Surface.DrawingColor = CDG_options.text_color;
      else info.Surface.DrawingColor = game.read_dialog_option_color;


It's also possible to rewrite this so chosen and fresh lines use a different highlight color.

AndreasBlack

#4
Quote from: Khris on Fri 15/04/2022 20:24:09
In the long run someone should probably add an option for that to the script, but for now you can do this:


  • open the main script of the CustomDialogGui
  • find lines 558-559 (they set the text color)
  • replace them with
Code: ags
      if (info.ActiveOptionID == current_option) info.Surface.DrawingColor = CDG_options.text_color_active;
      else if (!info.DialogToRender.HasOptionBeenChosen(current_option)) info.Surface.DrawingColor = CDG_options.text_color;
      else info.Surface.DrawingColor = game.read_dialog_option_color;


It's also possible to rewrite this so chosen and fresh lines use a different highlight color.

Thanks, not getting it to work tho. I think it might be that i've replaced the bakground with nothing maybe that confuses the code, cause all i get is "no dialog" when i enter your code, hmm...The dialog tree does not show up at all. Any idea? Should i have added something? I'm too tired to try anything now, been drawing rooms all night (laugh)
I mean what i mean is the bakground "borders" or whatever i replaced that image with nothing, i didn't like the look of it, maybe that made your code "not work", perhaps.I mean i don't get a "error" the code runs, it's just making all the dialog tree dissappear. Edit: It's unclickable too, it seems

Edit: This is what i've "done" to the template. Just a test room no final art, please don't judge. :-[ But with your code, the dialog just disappears completely.
Spoiler

[imgzoom]https://i.imgur.com/xQK1qq0.png0[/imgzoom]
[close]

AndreasBlack

#5
Tried in a "normal template" same result, so me deleting the BG had nothing to do with it. The only different is the bakground is still there, but no options are seen or selectable

Khris

The original lines you were supposed to replace are
Code: ags
      if (info.ActiveOptionID == current_option) info.Surface.DrawingColor = CDG_options.text_color_active;
      else info.Surface.DrawingColor = CDG_options.text_color;


I don't see how that change can make the options disappear completely. I assume you also a) reversed your own change and b) set  game.read_dialog_option_color  to a suitable color?
I tested the code change before posting it and it works fine for me.

(also please don't quote the entire previous post, there's a "reply" button after the last post)

AndreasBlack

Quote from: Khris on Sat 16/04/2022 12:00:29

(also please don't quote the entire previous post, there's a "reply" button after the last post)

Ahh, it worked now! Maybe i was just tired. Thanks! and yes somebody should fix that in the template. It's not "gray" now, but this will do, and yes i shouldn't quote the entire post, i'm lazy :-D

SMF spam blocked by CleanTalk