Change the font of room title/player input

I figure this is probably an easy fix, but I'm just blind and can't find the option. How can you change the font/color of the room title so that it pops from the description? I'm using Quest 5 and looked all through the interface, but I can't find it. I'd also like to change the color of the player's input, so that it, too pops from the room description.


This makes everything red colour:
Go to game object, Display tab.
The first text bar have option of choice colour: Red (Or choose your colour.)

I guess your description refers to long text in room: (Edited, I add in msg room77.)
At room, Scripts tab, After entering the room, press </> or code view and insert
msg ("Room77.")
SetForegroundColour ("Black")
msg ("place your text here.")
SetForegroundColour ("Red")

Obviously, I do not know much about quest or computer, so this solution is bad, because you can see many automated room descriptions in red, so my quick fix would be to disable it.
Go to game object, at Room Descriptions tab, unclick Automatically generate room descriptions.


I've looked into this one before, and was surprised that there are no options for automatically formatting the different parts of the auto description.

One thing I could imagine would be giving every room a prefix and suffix. By default, the prefix for an object (or room) is an auto-generated "a " or "an " - but there's nothing to stop you setting a prefix of {colour:red: and a suffix }.

If you want to do this automatically (maybe not the best option), you could add a script like this as part of your 'start' script:

foreach (room, AllRooms ()) {
  if (GetBoolean (room, "usedefaultprefix")) {
    prefix = GetDefaultPrefix (room)
  }
  else if (HasString (room, "prefix")) {
    prefix = room.prefix
  }
  else {
    prefix = ""
  }
  room.prefix = prefix + "{colour:red:"
  if (HasString (room, "suffix")) {
    room.suffix = "}" + room.suffix
  }
  else {
    room.suffix = "}"
  }
  room.usedefaultprefix = false
}

Off the top of my head, I think that should turn the room names red in the autodescription. This method has some flaws; but doesn't require JS shenanigans or modifying the core functions.


As far as highlighting the player's command… that's going to be harder. You could do it in a turnscript, but that might not work neatly if turnscripts are suppressed. In any case, you would be using Javascript to look at the text that has already been output.

You could use the currentturnoutputsection to find output for the current turn, and then use javascript to find the first like starting with a >, like this:

if (HasString (game, "currentturnoutputsection")) {
  JS.eval("$('."+game.currentturnoutputsection+" span:contains(\"&gt;\"').first().css({color: 'red'});")
}

(this assumes that you have it set to print a > before the echoed command rather than bolding it; which I believe are the only two options by default)


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums