Changing the looks on verbs and exists with verb links disabled?

Good morning?

I have disabled the verb menu links thingamobobs ‘cause I want the player to type, not click.

However, when that function is enabled the exits and verbs are in bold and underlined. I kind of want them to look the same with the function disabled (except for the underline.)
And, if possible, I want to be able to change the colour of (some of!) the objects listed to make it easier for the player. Is this possible?

Sorry for possibly being vague. I'm on the subway in my pre coffee state.


You could override GetDisplayName, maybe?

  <function name="GetDisplayName" type="string" parameters="obj">
    if (game.enablehyperlinks) {
      return (GetDisplayNameLink(obj, ""))
    }
    else {
      return (GetDisplayNameNoLink(obj))
    }
  </function>

  <function name="GetDisplayNameNoLink" type="string" parameters="obj">
  <![CDATA[
    result = "{b:"+GetDisplayAlias(obj)+"}"
    if (HasString(obj, "linkcolour") and GetUIOption("UseGameColours") = "true") {
      result = "{colour:"+obj.linkcolour+":"+result+"}"
    }

    if (not GetBoolean(obj, "usedefaultprefix")) {
      if (obj.prefix = null) {
        prefix = ""
      }
      else {
        prefix = obj.prefix
      }
    }
    else {
      prefix = GetDefaultPrefix(obj)
    }
    if (LengthOf(prefix) > 0) prefix = prefix + " "
    result = prefix + result
    if (not GetBoolean(obj, "usedefaultprefix") and HasString(obj, "suffix")) {
      if (LengthOf(obj.suffix) > 0) {
        result = result + " " + obj.suffix
      }
    }
    return (result)
  ]]>
  </function>

Is that what you're after?


It probably is. Haven't had time to try it yet but it looks like it.
Thanks man!


No, I couldn't quite get it to work. But that's most likely me and has got nothing to do with the code.

I can't quite figure out where, and what, to change to make the objects listed change colour or style?


No, I couldn't quite get it to work. But that's most likely me and has got nothing to do with the code.

Could be an error in there; I've not actually tested the code. Does it not highlight them at all?

I can't quite figure out where, and what, to change to make the objects listed change colour or style?

Ah. There's a "Link colour" field on the object tab in the editor, but disabling hyperlinks hides it. So you'd either have to set an object's linkcolour attribute in a script, or enable hyperlinks so that the colour selector shows up in the editor, and then put game.enablehyperlinks = false in your start script.


Ah, then I think I can sort it out. Many thanks!


Log in to post a reply.

Support

Forums