function draw_minimap() { global $map_info; global $uid; $systems = $map_info->get_stars_info(); $scans = $map_info->get_scanned_systems(); $SVG_scanradien = "<g class=\"minimapScancircles\">\n"; foreach ($systems as $sid => $info) { $SVG_systems .= draw_system($info); // mop: system zeichnen // Alle Systeme zeichnen if (in_array($sid, $scans) || $map_info->fleet_in_sid($uid, $sid)) { add_system_ownership($sid, $info); if ($map_info->is_own_star($sid)) { $SVG_scanradien .= draw_scancircles($info["x"], $info["y"], $map_info->get_systemscanradius($sid)); } // mop: irgendwie suboptimal $fleets = $map_info->get_fids_by_sid($sid); $SVG_fleets .= draw_fleets($info["x"], $info["y"], $fleets); $SVG_scanradien .= draw_scancircles($info["x"], $info["y"], $map_info->get_fleet_scan_radius($sid)); } } $SVG_systems .= draw_colonized_stars(); $SVG_scanradien .= "</g>"; $SVG_output = $SVG_scanradien . $SVG_systems . $SVG_fleets; return $SVG_output; }
/** * holt alle sterne zu gegebenen constellationen * * @param $cids * @return */ function get_svg_stars_of_cids($cids, &$fleet_symbols, &$fleet_routes, &$scans, &$systems) { global $uid; global $map_info; $closest_stars = get_stars($cids); $system_user_type_defs = "<defs>"; $system_user_type = "<g pointer-events=\"none\">"; if (is_array($closest_stars)) { $scans = "<g pointer-events=\"none\" id=\"scanradien\">"; $system_names = "<g style=\"font-size:7pt;fill:#A5D9FF;stroke:none;font-family:verdana,arial;letter-spacing:1pt;\" pointer-events=\"none\">"; $systems = "<g onclick=\"clickOnStar(evt);\" onmouseover=\"mouseoverStar(evt);\" onmouseout=\"mouseoutStar(evt);\">"; foreach ($closest_stars as $sid => $its_star) { if ($its_star["userstypes"]) { $system_user_type_defs .= $its_star["userstypes"]; $system_user_type .= "<use xlink:href=\"#user_in_system_" . $sid . "\" x=\"" . $its_star[x] . "\" y=\"" . ($its_star[y] + 25) . "\"/>"; // scanradien, wenn ein system ein system_user_type hat, ist jemand in dem system, können also scanradien vorhanden sein if ($map_info->is_own_star($sid)) { $scanrange = $map_info->get_systemscanradius($sid); $scans .= draw_scancircles($its_star[x], $its_star[y], $scanrange); } } $systems .= draw_star($its_star["x"], $its_star["y"], $sid, $its_star["scan"]); $system_names .= draw_system_name($sid, $its_star["scan"], $its_star["name"], $its_star["x"], $its_star["y"]); //___________________________ System Flotten if ($its_star["scan"] == SYSTEM_VISIBLE) { $system_fleets = $map_info->get_fids_by_sid($sid); if (is_array($system_fleets)) { $fleet_symbols .= draw_fleets($its_star[x], $its_star[y], $system_fleets, $sid); $fleet_routes .= get_fleet_routes($system_fleets); } $fleet_scans .= draw_fleet_scancircles($its_star[x], $its_star[y], $sid); } //___________________________ Spezial Symbole $special_symbols = $map_info->get_special_buildings_by_sid($sid, 1); if (is_array($special_symbols)) { $specials .= "<g id=\"specialSymbols_" . $sid . "\" pointer-events=\"none\">"; $specials .= draw_special_symbols($its_star[x], $its_star[y], $special_symbols, $sid); $specials .= "<set attributeType=\"XML\" attributeName=\"display\" to=\"none\" begin=\"s" . $sid . ".mouseover\"/>"; $specials .= "<set attributeType=\"XML\" attributeName=\"display\" to=\"inherit\" begin=\"s" . $sid . ".mouseout\"/>"; $specials .= "</g>"; } } } $system_user_type_defs .= "</defs>"; $system_user_type .= "</g>"; $system_names .= "</g>"; $systems .= "</g>"; $scans .= $fleet_scans; $scans .= "</g>"; $systems = $system_user_type_defs . $system_user_type . $systems . $system_names . $specials; }