Health & win/loss bars
In the function game_spacer_image - in game_shared_display.php, if it hasn't been rearranged - replace /images/layout/spacer.gif (which no longer exists) with /images/spacer.gif (which still does).
- Code: Select all
function game_spacer_image($w = 1, $h = 1, $alt = '')
{
$w = max(intval($w), 1);
$h = max(intval($h), 1);
$alt = htmlentities($alt);
return sprintf(
'<img src="/images/spacer.gif" width="%d" height="%d" border="0" alt="%s" />',
$w,
$h,
$alt
);
}
There may be other broken links to /images/layout/spacer.gif scattered around - I think I caught most of the hardcoded ones and replaced them with the game_spacer_image function, but I may not have got them all.
Colour picker palette
To make the palette show up correctly in the first place:
In character_edit.php, find the printf() call which draws the palette boxes. The template begins with:
- Code: Select all
<td style="padding-top: 10px; background-color: %s"
- Code: Select all
color_rgb2html($rgb)
Change 'background-color: %s' in the template to 'background-color: #%s'.
To fix the dynamic palette:
In the Javascript embedded in character_edit.php, add the following function:
- Code: Select all
function hexstring (rgb)
{
return '#' + int2base(rgb[0] * 255, 16) + int2base(rgb[1] * 255, 16) + int2base(rgb[2] * 255, 16);
}
Then, in the update_sat amd update_val functions:
- Code: Select all
function update_sat (hue)
{
curr_hue = hue;
failsafe = 50;
for (var i = 0; i < SAT_NUM_STEPS; i++) {
failsafe--;
if (failsafe <= 0) {
alert ('Failsafe kicked in at i=' + i + ', its=' + its + '!');
break;
}
rgb = hsv2rgb(hue, SAT_MIN + (i * SAT_STEP), VAL_MAX);
cell = document.getElementById('cp_sat' + i);
cell.style.backgroundColor = hex_string(rgb);
}
update_val (curr_sat);
}
function update_val (sat, new_val)
{
hue = curr_hue;
curr_sat = sat;
failsafe = 50;
for (var i = 0; i < VAL_NUM_STEPS; i++) {
failsafe--;
if (failsafe <= 0) {
alert ('Failsafe kicked in at i=' + i + ', its=' + its + '!');
break;
}
cell = document.getElementById('cp_val' + i);
rgb = hsv2rgb(hue, sat, VAL_MIN + (i * VAL_STEP));
cell.style.backgroundColor = hex_string(rgb);
}
}
Also, the 'failsafe' loop is junk debug code that should be safe to remove.
Also also, you may want to call update_sat and update_val on page load, to ensure they take account of any pre-selection in the hue row.
HTH