I added a little nice feature to see the track difficulty at Current Track inside the Challengewidget.
This works only if the track is uploaded on TMX otherwise the feature is disabled.
Code: Select all
Search in the plugin.records_eyepiece.php for the function "re_buildChallengeWidget" and add/replace the lines from start to end ... you maybe also need to adjust the coordinates ...
/*
#///////////////////////////////////////////////////////////////////////#
# #
#///////////////////////////////////////////////////////////////////////#
*/
function re_buildChallengeWidget ($state = 'race') {
global $aseco, $re_config;
if ($re_config['CHALLENGE_WIDGET'][0]['ENABLED'][0] == true) {
$xml = false;
if ($state == 'race') {
// Set the right Icon and Title position
$position = (($re_config['CHALLENGE_WIDGET'][0]['RACE'][0]['POS_X'][0] < 0) ? 'right' : 'left');
if ($position == 'right') {
$imagex = ($re_config['Positions'][$position]['image_open']['x'] + ($re_config['CHALLENGE_WIDGET'][0]['WIDTH'][0] - 15.5));
$iconx = ($re_config['Positions'][$position]['icon']['x'] + ($re_config['CHALLENGE_WIDGET'][0]['WIDTH'][0] - 15.5));
$titlex = ($re_config['Positions'][$position]['title']['x'] + ($re_config['CHALLENGE_WIDGET'][0]['WIDTH'][0] - 15.5));
}
else {
$imagex = $re_config['Positions'][$position]['image_open']['x'];
$iconx = $re_config['Positions'][$position]['icon']['x'];
$titlex = $re_config['Positions'][$position]['title']['x'];
}
// Create the ChallengeWidget at Race
$xml = str_replace(
array(
'%manialinkid%',
'%actionid%',
'%posx%',
'%posy%',
'%image_open_pos_x%',
'%image_open_pos_y%',
'%image_open%',
'%posx_icon%',
'%posy_icon%',
'%posx_title%',
'%posy_title%',
'%halign%',
'%trackname%',
'%authortime%',
'%author%'
),
array(
$re_config['ManialinkId'] .'05',
$re_config['ManialinkId'] .'02',
$re_config['CHALLENGE_WIDGET'][0]['RACE'][0]['POS_X'][0],
$re_config['CHALLENGE_WIDGET'][0]['RACE'][0]['POS_Y'][0],
$imagex,
-5.35,
$re_config['Positions'][$position]['image_open']['image'],
$iconx,
$re_config['Positions'][$position]['icon']['y'],
$titlex,
$re_config['Positions'][$position]['title']['y'],
$re_config['Positions'][$position]['title']['halign'],
$re_config['Challenge']['Current']['name'],
$re_config['Challenge']['Current']['authortime'],
$re_config['Challenge']['Current']['author']
),
$re_config['Templates']['CHALLENGE_DEFAULT']['HEADER']
);
$xml .= $re_config['Templates']['CHALLENGE_DEFAULT']['FOOTER'];
# START ADD ##############################################################################################################
if ($re_config['Challenge']['Current']['pageurl'] != false) {
if ($re_config['Challenge']['Current']['diffic'] == 'Beginner') {
$diffi = "http://i.imgur.com/aYN1adR.png";
} elseif ($re_config['Challenge']['Current']['diffic'] == 'Intermediate') {
$diffi = "http://i.imgur.com/4vo4fHe.png";
} else {
$diffi = "http://i.imgur.com/3TBYFId.png";
}
$xml .= '<manialink id="444444445555555555">
<frame posn="58.5 41.5 0">
<label scale="0.825" textsize="1" posn="0 0 0" sizen="6 2" halign="center" text="$z$FFFDifficulty:$z"/>
<quad posn="3.5 -0.5 0" sizen="2 1.5" halign="center" valign="center" image="'.$diffi.'" />
</frame>
</manialink>';
} else {
$xml .= '<manialink id="444444445555555555"></manialink>';
}
}
else if ($state == 'score') {
// Create the ChallengeWidget at Score
$xml = str_replace(
array(
'%manialinkid%',
'%posx%',
'%posy%',
'%nexttrackname%',
'%nextauthortime%',
'%nextauthor%',
'%nextenv%',
'%nextmood%',
'%nextgoldtime%',
'%nextsilvertime%',
'%nextbronzetime%'
),
array(
$re_config['ManialinkId'] .'05',
$re_config['CHALLENGE_WIDGET'][0]['SCORE'][0]['POS_X'][0],
$re_config['CHALLENGE_WIDGET'][0]['SCORE'][0]['POS_Y'][0],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['name'],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['authortime'],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['author'],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['env'],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['mood'],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['goldtime'],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['silvertime'],
$re_config['STYLE'][0]['WIDGET_SCORE'][0]['FORMATTING_CODES'][0] . $re_config['Challenge']['Next']['bronzetime']
),
$re_config['Templates']['CHALLENGE_SCORE']['HEADER']
);
$xml .= $re_config['Templates']['CHALLENGE_SCORE']['FOOTER'];
$xml .= '<manialink id="444444445555555555"></manialink>';
}
############################################################################################################### END ADD #
if ($xml != false) {
return $xml;
}
}
}
/*
#///////////////////////////////////////////////////////////////////////#
# #
#///////////////////////////////////////////////////////////////////////#
*/
Greetings L3cky