#9029 Added starmap 2

This commit is contained in:
Daniel Maya 2022-07-12 13:45:01 +02:00
parent a71c26b4a7
commit 4f7918114b
1 changed files with 6 additions and 13 deletions

View File

@ -4300,19 +4300,13 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
{ {
ui_require_css_file('heatmap'); ui_require_css_file('heatmap');
// $all_modules = agents_get_modules($id_agent); $all_modules = agents_get_modules($id_agent);
// if (empty($all_modules)) { if (empty($all_modules)) {
// return null; return null;
// }
// $total_modules = count($all_modules);
$all_modules = [];
$total_modules = 200;
$contador = 0;
while ($contador < $total_modules) {
$contador++;
$all_modules[$contador] = '';
} }
$total_modules = count($all_modules);
// Best square. // Best square.
$high = (float) max($width, $height); $high = (float) max($width, $height);
$low = 0.0; $low = 0.0;
@ -4345,8 +4339,7 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
$cont = 1; $cont = 1;
foreach ($all_modules as $key => $value) { foreach ($all_modules as $key => $value) {
// Colour by status. // Colour by status.
// $status = modules_get_agentmodule_status($key); $status = modules_get_agentmodule_status($key);
$status = random_int(0, 5);
switch ($status) { switch ($status) {
case 0: case 0:
case 4: case 4: