feat(earth): cable state management, hover/lock visual separation, fix isSameCable undefined bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as THREE from 'three';
|
||||
|
||||
import { CONFIG, CABLE_COLORS, PATHS } from './constants.js';
|
||||
import { CONFIG, CABLE_COLORS, PATHS, CABLE_STATE } from './constants.js';
|
||||
import { latLonToVector3 } from './utils.js';
|
||||
import { updateEarthStats, showStatusMessage } from './ui.js';
|
||||
import { showInfoCard } from './info-card.js';
|
||||
@@ -340,3 +340,25 @@ export function getCablesById(cableId) {
|
||||
export function getLandingPoints() {
|
||||
return landingPoints;
|
||||
}
|
||||
|
||||
const cableStates = new Map();
|
||||
|
||||
export function getCableState(cableId) {
|
||||
return cableStates.get(cableId) || CABLE_STATE.NORMAL;
|
||||
}
|
||||
|
||||
export function setCableState(cableId, state) {
|
||||
cableStates.set(cableId, state);
|
||||
}
|
||||
|
||||
export function clearAllCableStates() {
|
||||
cableStates.clear();
|
||||
}
|
||||
|
||||
export function getCableStateInfo() {
|
||||
const states = {};
|
||||
cableStates.forEach((state, cableId) => {
|
||||
states[cableId] = state;
|
||||
});
|
||||
return states;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user