\r\n");
$x = (int)$chunkx_min;
while ($x <= $chunkx_max) {
$this_zoomed_w = $zoomed_w;
$this_zoomed_h = $zoomed_h;
$chunk_yaml_name = $x_opener.$x.$z_opener.$z.$dot_yaml;
$chunk_yaml_path = $chunkymapdata_path.'/'.$chunk_yaml_name;
//$chunk_genresult_name = $x_opener.$x.$z_opener.$z.$genresult_suffix_then_dot_then_ext;
//$chunk_genresult_path = $chunkymapdata_path.'/'.$chunk_img_name;
$td_style_suffix="";
$element_align_style_suffix="";
$alignment_comment="";
//if (is_file($chunk_genresult_path)) {
// contains lines such as:
// Result image (w=80 h=64) will be written to chunk_x0z1.png
// ('PNG Region: ', [0, 64, 80, 128])
// ('Pixels PerNode: ', 1)
// where PNG Region's list value is an exclusive rect ordered as x1, y1, x2, y2
//$found_original_w = null;
//$found_original_h = null;
//$this_zoomed_w=(int)((float)$found_original_w*$scale+.5);
//this_zoomed_h=(int)((float)$found_original_h*$scale+.5);
//}
if (is_file($chunk_yaml_path)) {
// contains lines such as:
//is_marked_empty:False
//is_marked:True
//image_w:80
//image_h:80
//image_left:0
//image_top:64
//image_right:-80
//image_bottom:-16
// where if is_marked_empty, the remaining values don't exist
$expected_left = (int)$x * (int)$chunkymap_tile_original_w;
$expected_top = (int)$z * (int)$chunkymap_tile_original_h;
$expected_right = (int)$x + (int)$chunkymap_tile_original_w;
$expected_bottom = (int)$z + (int)$chunkymap_tile_original_h;
$chunk_dict = get_dict_from_conf($chunk_yaml_path,":");
if (isset($chunk_dict["image_w"])) {
$this_zoomed_w=(int)((float)$chunk_dict["image_w"]*$scale+.5);
}
if (isset($chunk_dict["image_h"])) {
$this_zoomed_h=(int)((float)$chunk_dict["image_h"]*$scale+.5);
}
//TODO: use image_* to determine (if the doesn't touch certain sides of image_w x image_h rect, change the following accordingly)
if (isset($chunk_dict["image_left"])) {
if (isset($chunk_dict["image_right"])) {
if ( (int)$chunk_dict["image_left"] > $expected_left ) {
$td_style_suffix.="text-align:right;";
$alignment_comment.="";
}
//elseif ( (int)$chunk_dict["image_right"] < $expected_right ) {
// $td_style_suffix.="text-align:left;";
//}
else {
$td_style_suffix.="text-align:left;";
$alignment_comment.="";
}
}
}
//if (isset($chunk_dict["image_right"])) {
// if ( (int)$chunk_dict["image_right"] != $expected_right ) {
// $td_style_suffix.="text-align:left;";
// }
// //else {
// // $td_style_suffix.="text-align:left;";
// //}
//}
if (isset($chunk_dict["image_top"])) {
if (isset($chunk_dict["image_bottom"])) {
if ( (int)$chunk_dict["image_top"] > $expected_top) {
$element_align_style_suffix.="vertical-align:bottom;";
$alignment_comment.="";
}
//elseif ( (int)$chunk_dict["image_bottom"] < $expected_bottom) {
// $element_align_style_suffix.="vertical-align:top;";
//}
else {
$element_align_style_suffix.="vertical-align:top;";
$alignment_comment.="";
}
}
}
//if (isset($chunk_dict["image_bottom"])) {
// if ( (int)$chunk_dict["image_bottom"] != $expected_bottom) {
// $element_align_style_suffix.="vertical-align:top;";
// }
// //else {
// // $element_align_style_suffix.="vertical-align:bottom;";
// //}
//}
//$element_align_style_suffix.="vertical-align:left;";
}
echo_hold( " ");
$chunk_luid = "x".$x."z".$z;
$chunk_img_name = $x_opener.$x.$z_opener.$z."$dot_and_ext";
$chunk_img_path = $chunkymapdata_path.'/'.$chunk_img_name;
if (is_file($chunk_img_path)) {
echo_hold( "");
}
else {
//echo_hold( " ");
}
if (isset($chunk_assoc[$chunk_luid]["players_count"])) {
$nonprivate_name_beginning_char_count = 2;
for ($player_count=0; $player_count<$chunk_assoc[$chunk_luid]["players_count"]; $player_count++) {
$rel_x = $chunk_assoc[$chunk_luid][ "players" ][ $player_count ]["rel_x"];
$rel_z = $chunk_assoc[$chunk_luid][ "players" ][ $player_count ]["rel_z"];
$player_name = $chunk_assoc[$chunk_luid]["players"][$player_count]["name"];
if (strlen($chunk_assoc[$chunk_luid]["players"][$player_count]["name"])>$nonprivate_name_beginning_char_count) {
$player_name = substr($player_name, 0, $nonprivate_name_beginning_char_count)."*";
}
//show head full size (not zoomed):
$zoomed_head_w=$character_icon_w;//(int)((float)$character_icon_w*$scale+.5);
$zoomed_head_h=$character_icon_h;//(int)((float)$character_icon_h*$scale+.5);
$rel_x -= (int)($zoomed_head_w/2);
$rel_z -= (int)($zoomed_head_h/2);
echo_hold( "$player_name " );
//$position_offset_x+=$character_icon_w;
}
}
//echo " ".$x.",0,".$z;
echo_hold($alignment_comment);
echo_hold( " | \r\n");
$x++;
}
echo_hold( "
\r\n");
echo_release();
$z--;
}
echo "