diff --git a/src/ts/ui/currentMissionDisplay.ts b/src/ts/ui/currentMissionDisplay.ts index bac1f4cb3..a56e42c04 100644 --- a/src/ts/ui/currentMissionDisplay.ts +++ b/src/ts/ui/currentMissionDisplay.ts @@ -6,21 +6,29 @@ export class CurrentMissionDisplay { private activeMissionIndex: number | null = null; - private readonly defaultPanel: HTMLElement; - - private missionToPanel: Map = new Map(); - constructor(player: Player) { this.rootNode = document.createElement("div"); this.rootNode.classList.add("currentMissionDisplay"); - this.defaultPanel = document.createElement("div"); - this.defaultPanel.classList.add("missionPanel"); + this.setNoMissionActive(); + } + + private setMissionActive(mission: Mission) { + const panelRoot = document.createElement("div"); + + this.rootNode.innerHTML = ""; + this.rootNode.appendChild(panelRoot); + } + + private setNoMissionActive() { + const defaultPanel = document.createElement("div"); + defaultPanel.classList.add("missionPanel"); const defaultPanelH2 = document.createElement("h2"); defaultPanelH2.innerText = "You don't have any active missions"; - this.defaultPanel.appendChild(defaultPanelH2); + defaultPanel.appendChild(defaultPanelH2); - this.rootNode.appendChild(this.defaultPanel); + this.rootNode.innerHTML = ""; + this.rootNode.appendChild(defaultPanel); } } \ No newline at end of file