Custom text on "Current song" widget

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
khriss_boreas
highway camper
highway camper
Posts: 2
Joined: 07 Mar 2018 18:01
Owned TM-games: TM, TM2, TMU, TMT

Custom text on "Current song" widget

Post by khriss_boreas » 07 Mar 2018 18:14

Here's the situation: I want to replace default text strings on Records-Eyepiece widgets. For example, default "Current track" widget prints:
%title%
by %author%
And I want to replace 'by' with 'Author:'. So, I open plugin.records_eyepiece.php, and looking for code responsible for drawing "Current track" widget:

Code: Select all

	$header .= '<label posn="1 -2.7 0.04" sizen="13.55 2" scale="1" text="%trackname%"/>';
	$header .= '<label posn="1 -4.5 0.04" sizen="14.85 2" scale="0.9" text="by %author%"/>';
Just need to replace 'by' with 'Author:', and it works like a charm. But when I'm looking at code with "Current song", I can't find the line where 'by' string is located:

Code: Select all

	//--------------------------------------------------------------//
	// BEGIN: Widget for MusicInfo					//
	//--------------------------------------------------------------//
	// %posx%, %posy%
	// %widgetwidth%
	// %title_background_width%
	// %actionid%
	// %image_open_pos_x%, %image_open_pos_y%, %image_open%
	// %posx_icon%, %posy_icon%
	// %posx_title%, %posy_title%
	// %halign%, %title%
	$header  = '<frame posn="%posx% %posy% 0">';
	$header .= '<quad posn="0 0 0.001" sizen="%widgetwidth% 8.65" action="%actionid%" style="'. $re_config['STYLE'][0]['WIDGET_RACE'][0]['BACKGROUND_STYLE'][0] .'" substyle="'. $re_config['STYLE'][0]['WIDGET_RACE'][0]['BACKGROUND_SUBSTYLE'][0] .'"/>';
	$header .= '<quad posn="%image_open_pos_x% %image_open_pos_y% 0.05" sizen="3.5 3.5" image="%image_open%"/>';

	// Icon and Title
	$header .= '<quad posn="0.4 -0.36 0.002" sizen="%title_background_width% 2" style="'. $re_config['STYLE'][0]['WIDGET_RACE'][0]['TITLE_STYLE'][0] .'" substyle="'. $re_config['STYLE'][0]['WIDGET_RACE'][0]['TITLE_SUBSTYLE'][0] .'"/>';
	$header .= '<quad posn="%posx_icon% %posy_icon% 0.004" sizen="2.5 2.5" style="'. $re_config['MUSIC_WIDGET'][0]['ICON_STYLE'][0] .'" substyle="'. $re_config['MUSIC_WIDGET'][0]['ICON_SUBSTYLE'][0] .'"/>';
	$header .= '<label posn="%posx_title% %posy_title% 0.004" sizen="10.2 0" halign="%halign%" textsize="1" text="%title%"/>';
	$header .= '<format textsize="1" textcolor="'. $re_config['STYLE'][0]['WIDGET_RACE'][0]['COLORS'][0]['DEFAULT'][0] .'"/>';

	$footer  = '</frame>';

	$templates['MUSICINFO']['HEADER'] = $header;
	$templates['MUSICINFO']['FOOTER'] = $footer;

	unset($header, $footer);
	//--------------------------------------------------------------//
	// END: Widget for MusicInfo					//
	//--------------------------------------------------------------//
Am I searching in a right place? Where do I need to replace that string? Thanks!

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 151
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Location: Berlin
Contact:

Re: Custom text on "Current song" widget

Post by L3cKy » 15 Mar 2018 07:55

Look for "re_buildMusicWidget" ;)

Code: Select all

$xml .= '<label posn="1 -2.7 0.04" sizen="13.55 2" scale="1" text="'. $re_config['CurrentMusicInfos']['Title'] .'"/>';
$xml .= '<label posn="1 -4.5 0.04" sizen="14.85 2" scale="0.9" text="by '. $re_config['CurrentMusicInfos']['Artist'] .'"/>';

khriss_boreas
highway camper
highway camper
Posts: 2
Joined: 07 Mar 2018 18:01
Owned TM-games: TM, TM2, TMU, TMT

Re: Custom text on "Current song" widget

Post by khriss_boreas » 21 Mar 2018 09:06

Thanks mate! It worked!

Post Reply