Author Topic: Current display name WITHOUT using magic token?  (Read 138 times)

JC10001

  • Newbie
  • *
  • Posts: 6
    • View Profile
Current display name WITHOUT using magic token?
« on: April 01, 2017, 10:17:54 AM »
I'm trying to uppercase the first letter of [DisplayName] and I keep getting all lower case letters.  The issue seems to be when AttractMode is evaluating the magic token.

I found another thread about it here but I can't get the solution posted to work.  I think because he is using fe.game_info and that's not a magic token.

I've tried fe.list.name - but it doesn't dynamically update and it always holds the same value.

As a workaround, I'm trying to see if there is there a way to get the currently selected display name WITHOUT using a magic token?  Is this possible?  If so, how?

Favdeacon

  • Full Member
  • ***
  • Posts: 41
    • View Profile
Re: Current display name WITHOUT using magic token?
« Reply #1 on: June 18, 2017, 05:31:08 AM »
In case you or others still need this:

Code: [Select]
function dname()
 {
    local current_display = fe.displays[fe.list.display_index];
return current_display.name;
 }

You can use this function as a Magic Token so it will be updated like one:

Code: [Select]
local print_display = fe.add_text( "Display: [!dname]", x, y, w, h );

Mind the "!" before the function's name. It marks custom Magic Tokens.