Skip to content

Commit

Permalink
fix: fully remove leaflet support (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Aug 16, 2023
1 parent 360ca03 commit 51aed21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ export default class InitiativeTracker extends Plugin {
return this.statblocks?.settings?.version ?? { major: 0 };
}
get canUseLeaflet() {
return (
return false;
/* return (
this.app.plugins.getPlugin("obsidian-leaflet-plugin") != null &&
Number(
this.app.plugins.getPlugin("obsidian-leaflet-plugin").data
?.version?.major >= 4
)
);
); */
}

get leaflet() {
Expand Down
33 changes: 0 additions & 33 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1186,39 +1186,6 @@ class NewPlayerModal extends Modal {
});
});

if (this.plugin.canUseLeaflet) {
const markerSetting = new Setting(contentEl)
.setName("Leaflet Marker")
.addDropdown((drop) => {
for (let marker of this.plugin.leaflet.markerIcons) {
drop.addOption(marker.type, marker.type);
}
drop.setValue(
this.player.marker ??
this.plugin.data.playerMarker ??
"default"
);
drop.onChange(async (v) => {
this.player.marker = v;
this.display();
});
});

if (this.player.marker) {
const div = createDiv("marker-type-display");
const inner = div.createDiv("marker-icon-display");

const marker = this.plugin.leaflet.markerIcons.find(
(icon) => icon.type == this.player.marker
);
if (marker) {
inner.innerHTML = marker.html;

markerSetting.descEl.appendChild(div);
}
}
}

let footerEl = contentEl.createDiv();
let footerButtons = new Setting(footerEl);
footerButtons.addButton((b) => {
Expand Down

0 comments on commit 51aed21

Please sign in to comment.