Add custom generator link in morescreen, fix #95
This commit is contained in:
parent
1625b21138
commit
5d1754bcd6
10 changed files with 147 additions and 30 deletions
|
@ -395,6 +395,18 @@ class LayerGenerator extends UIElement {
|
|||
});
|
||||
self.CreateElements(fullConfig, layerConfig);
|
||||
self.Update();
|
||||
}),
|
||||
|
||||
new Button("Remove this layer", () => {
|
||||
const layers = fullConfig.data.layers;
|
||||
for (let i = 0; i < layers.length; i++) {
|
||||
if(layers[i] === layerConfig){
|
||||
layers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.Update();
|
||||
pingThemeObject();
|
||||
})
|
||||
|
||||
]
|
||||
|
@ -469,7 +481,7 @@ class AllLayerComponent extends UIElement {
|
|||
minzoom: 12,
|
||||
overpassTags: "",
|
||||
wayHandling: LayerDefinition.WAYHANDLING_CENTER_AND_WAY,
|
||||
presets: [{}],
|
||||
presets: [],
|
||||
tagRenderings: []
|
||||
});
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import Combine from "./Base/Combine";
|
|||
import {SubtleButton} from "./Base/SubtleButton";
|
||||
import {State} from "../State";
|
||||
import {CustomLayout} from "../Logic/CustomLayers";
|
||||
import {VariableUiElement} from "./Base/VariableUIElement";
|
||||
|
||||
|
||||
export class MoreScreen extends UIElement {
|
||||
|
@ -16,10 +17,23 @@ export class MoreScreen extends UIElement {
|
|||
}
|
||||
|
||||
InnerRender(): string {
|
||||
|
||||
|
||||
const tr = Translations.t.general.morescreen;
|
||||
|
||||
const els: UIElement[] = []
|
||||
|
||||
els.push(new VariableUiElement(
|
||||
State.state.osmConnection.userDetails.map(userDetails => {
|
||||
if (userDetails.csCount < State.userJourney.themeGeneratorUnlock) {
|
||||
return tr.requestATheme.Render();
|
||||
}
|
||||
return new SubtleButton("./assets/pencil.svg", tr.createYourOwnTheme, {
|
||||
url: "https://pietervdvn.github.io/MapComplete/customGenerator.html",
|
||||
newTab: false
|
||||
}).Render();
|
||||
})
|
||||
));
|
||||
|
||||
for (const k in AllKnownLayouts.allSets) {
|
||||
const layout = AllKnownLayouts.allSets[k]
|
||||
if (layout.hideFromOverview && State.state.osmConnection.userDetails.data.name !== "Pieter Vander Vennet") {
|
||||
|
@ -28,6 +42,7 @@ export class MoreScreen extends UIElement {
|
|||
if (layout.name === State.state.layoutToUse.data.name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (layout.name === CustomLayout.NAME) {
|
||||
if (!State.state.osmConnection.userDetails.data.loggedIn) {
|
||||
continue;
|
||||
|
@ -60,7 +75,6 @@ export class MoreScreen extends UIElement {
|
|||
|
||||
return new VerticalCombine([
|
||||
tr.intro,
|
||||
tr.requestATheme,
|
||||
new VerticalCombine(els),
|
||||
tr.streetcomplete
|
||||
]).Render();
|
||||
|
|
|
@ -901,6 +901,9 @@ export default class Translations {
|
|||
en: "Another, similar application is <a href='https://play.google.com/store/apps/details?id=de.westnordost.streetcomplete' target='_blank'>StreetComplete</a>",
|
||||
fr: "Une autre application similaire est <a href='https://play.google.com/store/apps/details?id=de.westnordost.streetcomplete' target='_blank'>StreetComplete</a>",
|
||||
nl: "Een andere, gelijkaardige Android-applicatie is <a href='https://play.google.com/store/apps/details?id=de.westnordost.streetcomplete' target='_blank'>StreetComplete</a>"
|
||||
}),
|
||||
createYourOwnTheme: new T({
|
||||
en: "Create your own MapComplete theme from scratch"
|
||||
})
|
||||
},
|
||||
readYourMessages: new T({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue