-
-
-
-
-
-
-
-
+
+
+
-
+ $res): ?>
+
+
-
+
+
+
+
?v=">
+
+ ">
+
+
+
+
+
+
+
+
-
- Connecté en tant que
- Profil
- Déconnexion
-
- Connexion
- S'inscrire
-
+
+ Galaxie
+ >
-
Navigation
- - -
-
-
- Vue Galaxie
-
-
-
+
-
-
-
+
+
+
+
-
+
-
+
@@ -342,7 +612,7 @@ function isStatusBlinking($status, $statuses_map) {
$dotColor = 'rgba(255,255,255,0.05)';
if (isset($sector_data[$s][$p])) { $dotColor = getStatusColor($sector_data[$s][$p]['status'], $statuses_map); }
?>
-
+
+
+
+
+
+
+ Faction:
+
+
+
+
+
+ Contrôle Orbital:
+
+
+
+
+
+
+ $lvl):
+ if ($lvl <= 0) continue;
+ $fName = $factions_map[$fid]['name'] ?? 'Inconnue';
+ $fColor = $factions_map[$fid]['color'] ?? '#88c0d0';
+ ?>
+
+
+
+ %
+
+
+
+
+
+ Établissements:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $lvl):
+ if ($lvl <= 0) continue;
+ $fName = $factions_map[$fid]['name'] ?? 'Inconnue';
+ $fColor = $factions_map[$fid]['color'] ?? '#88c0d0';
+ ?>
+
+
+
+
+ %
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SECTEUR
@@ -357,7 +627,7 @@ function isStatusBlinking($status, $statuses_map) {
-
+
@@ -415,118 +685,120 @@ function isStatusBlinking($status, $statuses_map) {
const statusesMap = ;
function openPlanetModal(data) {
- document.getElementById('m-planet-name').innerText = data.name;
- const typeInfo = typesMap[data.type] || {};
- document.getElementById('m-planet-type').innerText = typeInfo.name || data.type;
+ if (!data) return;
+ const typeInfo = typesMap[data.type] || {};
const statusInfo = statusesMap[data.status] || {};
- const statusBadge = document.getElementById('m-planet-status');
- statusBadge.innerText = statusInfo.name || data.status;
- statusBadge.style.background = statusInfo.color || '#4c566a';
- if (statusInfo.is_blinking == 1) statusBadge.classList.add('blink');
- else statusBadge.classList.remove('blink');
+ const factionInfo = factionsMap[data.faction_id] || { name: 'Aucune', color: '#8c92a3' };
- const img = document.getElementById('m-planet-img');
- img.src = typeInfo.image_url ? typeInfo.image_url + '?v=' + Date.now() : '';
- img.style.display = typeInfo.image_url ? 'block' : 'none';
-
- // Faction (Simple logic: majority control)
- let dominantFaction = 'Aucune';
- let maxOrb = 0;
- for (let fid in data.orbital_controls) {
- if (data.orbital_controls[fid] > maxOrb) {
- maxOrb = data.orbital_controls[fid];
- dominantFaction = factionsMap[fid] ? factionsMap[fid].name : 'Inconnue';
- }
- }
- document.getElementById('m-planet-faction').innerText = 'Faction dominante (Orbital): ' + dominantFaction;
-
- // Modifiers
+ document.getElementById('m-planet-name').innerText = data.name;
+ document.getElementById('m-planet-type').innerText = typeInfo.name || data.type;
+ document.getElementById('m-planet-img').src = typeInfo.image_url || '';
+ document.getElementById('m-planet-status').innerText = statusInfo.name || data.status;
+ document.getElementById('m-planet-status').style.background = statusInfo.color || 'rgba(255,255,255,0.1)';
+ document.getElementById('m-planet-faction').innerText = 'Faction dominante: ' + factionInfo.name;
+ document.getElementById('m-planet-faction').style.color = factionInfo.color || '#fff';
+
+ // Display modifiers instead of description
const modContainer = document.getElementById('m-planet-mods');
modContainer.innerHTML = '';
- if (typeInfo.modifiers) {
- typeInfo.modifiers.forEach(mod => {
- const span = document.createElement('span');
- span.className = 'mod-badge';
- span.innerText = mod.name;
- modContainer.appendChild(span);
- });
- }
-
- // Orbital Bar
- renderControlBar('m-orbital-bar', 'm-orbital-legend', data.orbital_controls);
- // Terrestrial Bar
- renderControlBar('m-terrestrial-bar', 'm-terrestrial-legend', data.terrestrial_controls);
-
- // Cities
- const cityContainer = document.getElementById('m-cities-container');
- cityContainer.innerHTML = '';
- if (data.cities && data.cities.length > 0) {
- data.cities.forEach(city => {
- const div = document.createElement('div');
- div.className = 'city-item';
- let controlDesc = '';
- for (let fid in city.controls) {
- if (factionsMap[fid]) {
- controlDesc += `${factionsMap[fid].name}: ${city.controls[fid]}% `;
- }
- }
- div.innerHTML = `
-
- ${city.name}
- ${city.type_name || 'Établissement'}
-
- ${controlDesc}
+ if (typeInfo.modifiers && typeInfo.modifiers.length > 0) {
+ typeInfo.modifiers.forEach(m => {
+ const modDiv = document.createElement('div');
+ modDiv.className = 'mod-item ' + (m.type === 'bonus' ? 'mod-bonus' : 'mod-malus');
+ modDiv.innerHTML = `
+
+ ${m.name}: ${m.description}
`;
- cityContainer.appendChild(div);
+ modContainer.appendChild(modDiv);
});
} else {
- cityContainer.innerHTML = 'Aucun établissement répertorié.
';
+ modContainer.innerHTML = 'Aucun modificateur particulier.
';
+ }
+
+ // Orbital Control
+ const orbitalBar = document.getElementById('m-orbital-bar');
+ const orbitalLegend = document.getElementById('m-orbital-legend');
+ orbitalBar.innerHTML = '';
+ orbitalLegend.innerHTML = '';
+
+ if (typeInfo.orbital_control_enabled == 1 && data.orbital_controls && Object.keys(data.orbital_controls).length > 0) {
+ document.getElementById('m-orbital-section').style.display = 'block';
+ renderMultiBar(data.orbital_controls, orbitalBar, orbitalLegend);
+ } else {
+ document.getElementById('m-orbital-section').style.display = 'none';
+ }
+
+ // Terrestrial Control (Summary)
+ const terrestrialBar = document.getElementById('m-terrestrial-bar');
+ const terrestrialLegend = document.getElementById('m-terrestrial-legend');
+ terrestrialBar.innerHTML = '';
+ terrestrialLegend.innerHTML = '';
+
+ if (typeInfo.terrestrial_control_enabled == 1 && data.terrestrial_controls && Object.keys(data.terrestrial_controls).length > 0) {
+ document.getElementById('m-terrestrial-section').style.display = 'block';
+ renderMultiBar(data.terrestrial_controls, terrestrialBar, terrestrialLegend);
+ } else {
+ document.getElementById('m-terrestrial-section').style.display = 'none';
+ }
+
+ // Cities
+ const citiesContainer = document.getElementById('m-cities-container');
+ citiesContainer.innerHTML = '';
+
+ if (typeInfo.terrestrial_control_enabled == 1 && data.cities && data.cities.length > 0) {
+ document.getElementById('m-cities-section').style.display = 'block';
+ data.cities.forEach(city => {
+ const card = document.createElement('div');
+ card.className = 'settlement-card';
+
+ const header = document.createElement('div');
+ header.className = 'settlement-header';
+ header.innerHTML = `${city.name}${city.type_name}`;
+ card.appendChild(header);
+
+ if (city.controls && Object.keys(city.controls).length > 0) {
+ const bar = document.createElement('div');
+ bar.className = 'multi-control-bar';
+ const legend = document.createElement('div');
+ legend.className = 'control-legend';
+
+ renderMultiBar(city.controls, bar, legend);
+
+ card.appendChild(bar);
+ card.appendChild(legend);
+ }
+
+ citiesContainer.appendChild(card);
+ });
+ } else {
+ document.getElementById('m-cities-section').style.display = 'none';
}
document.getElementById('planetModal').style.display = 'flex';
}
- function renderControlBar(barId, legendId, controls) {
- const bar = document.getElementById(barId);
- const legend = document.getElementById(legendId);
- bar.innerHTML = '';
- legend.innerHTML = '';
+ function renderMultiBar(controls, barElement, legendElement) {
+ Object.entries(controls).forEach(([fid, lvl]) => {
+ const level = parseInt(lvl);
+ const fac = factionsMap[fid] || { name: 'Inconnue', color: '#88c0d0' };
+
+ if (level <= 0) return;
- let total = 0;
- for (let fid in controls) {
- const val = parseInt(controls[fid]);
- if (val > 0) {
- total += val;
- const faction = factionsMap[fid] || { name: 'Inconnue', color: '#4c566a' };
- const segment = document.createElement('div');
- segment.className = 'control-segment';
- segment.style.width = val + '%';
- segment.style.backgroundColor = faction.color;
- segment.title = `${faction.name}: ${val}%`;
- bar.appendChild(segment);
-
- const tag = document.createElement('div');
- tag.className = 'legend-tag';
- tag.innerHTML = ` ${faction.name}: ${val}%`;
- legend.appendChild(tag);
- }
- }
-
- if (total < 100) {
- const remain = 100 - total;
+ // Segment
const segment = document.createElement('div');
segment.className = 'control-segment';
- segment.style.width = remain + '%';
- segment.style.backgroundColor = '#2e3440';
- segment.title = `Incontesté: ${remain}%`;
- bar.appendChild(segment);
+ segment.style.width = level + '%';
+ segment.style.backgroundColor = fac.color || '#88c0d0';
+ segment.title = `${fac.name}: ${level}%`;
+ barElement.appendChild(segment);
+ // Legend
const tag = document.createElement('div');
tag.className = 'legend-tag';
- tag.innerHTML = ` Incontesté: ${remain}%`;
- legend.appendChild(tag);
- }
+ tag.innerHTML = ` ${fac.name}: ${level}%`;
+ legendElement.appendChild(tag);
+ });
}
function closePlanetModal() {
@@ -534,4 +806,4 @@ function isStatusBlinking($status, $statuses_map) {
}
-