Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added piste:lit quest #495

Merged
merged 2 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ import de.westnordost.streetcomplete.quests.parking_fee.AddBikeParkingFee
import de.westnordost.streetcomplete.quests.parking_fee.AddParkingFee
import de.westnordost.streetcomplete.quests.parking_type.AddParkingType
import de.westnordost.streetcomplete.quests.pharmacy.AddIsPharmacyDispensing
import de.westnordost.streetcomplete.quests.piste_lit.AddPisteLit
import de.westnordost.streetcomplete.quests.piste_difficulty.AddPisteDifficulty
import de.westnordost.streetcomplete.quests.piste_ref.AddPisteRef
import de.westnordost.streetcomplete.quests.pitch_lit.AddPitchLit
Expand Down Expand Up @@ -609,6 +610,7 @@ fun getQuestTypeList(
EE_QUEST_OFFSET + 37 to AddMapType(),
EE_QUEST_OFFSET + 38 to AddMapSize(),
EE_QUEST_OFFSET + 34 to AddBarrierHeight(arSupportChecker),
EE_QUEST_OFFSET + 40 to AddPisteLit(),
EE_QUEST_OFFSET + 35 to AddPisteRef(),
EE_QUEST_OFFSET + 36 to AddPisteDifficulty(),
EE_QUEST_OFFSET + 10 to OsmoseQuest(osmoseDao),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package de.westnordost.streetcomplete.quests.piste_lit

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.osm.Tags
import de.westnordost.streetcomplete.osm.updateWithCheckDate
import de.westnordost.streetcomplete.quests.YesNoQuestForm
import de.westnordost.streetcomplete.util.ktx.toYesNo

class AddPisteLit : OsmFilterQuestType<Boolean>() {

override val elementFilter = """
ways, relations with
piste:type ~ downhill|nordic|sled|ski_jump|ice_skate
and (
!piste:lit
or piste:lit = no and lit older today -8 years
or piste:lit older today -16 years
)
"""
override val changesetComment = "Specify whether pistes are lit"
override val wikiLink = "Key:piste:lit"
override val icon = R.drawable.ic_quest_piste_lit
override val defaultDisabledMessage = R.string.default_disabled_msg_ee

override fun getTitle(tags: Map<String, String>) = R.string.quest_piste_lit_title

override fun createForm() = YesNoQuestForm()

override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags.updateWithCheckDate("piste:lit", answer.toYesNo())
}
}
49 changes: 49 additions & 0 deletions app/src/main/res/drawable/ic_quest_piste_lit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="128dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
android:pathData="M128,64c0,35.3 -28.7,64 -64,64S0,99.3 0,64S28.7,0 64,0S128,28.7 128,64"
android:fillColor="#C8C4B7"/>
<path
android:fillColor="#FF000000"
android:pathData="m70.51,62.65l0,4.97l6.21,2.48l7.45,0l6.21,-2.48l0,-4.97z"
android:strokeWidth="0.12"
android:fillAlpha="0.2"/>
<path
android:pathData="m44.5,27.44c-2.43,5.15 -3.8,10.87 -3.8,16.95 0,9.69 3.5,18.63 9.31,25.52l22.98,-10.62l14.9,0l22.98,10.62c5.79,-6.89 9.31,-15.77 9.31,-25.52 0,-6.07 -1.37,-11.8 -3.8,-16.95l-18.57,2.06l-34.78,0z"
android:strokeWidth="0.12"
android:fillColor="#ffffdf"
android:fillAlpha="0.533"/>
<path
android:pathData="m65.54,29.49 l4.97,29.81l19.87,0l4.97,-29.81z"
android:strokeWidth="2.48"
android:fillColor="#ffffdf"
android:fillType="evenOdd"
android:strokeColor="#c1a551"/>
<path
android:pathData="m72.99,29.49 l2.48,29.81"
android:strokeWidth="2.48"
android:fillColor="#00000000"
android:strokeColor="#c1a551"/>
<path
android:pathData="m87.9,29.49 l-2.48,29.81"
android:strokeWidth="2.48"
android:fillColor="#00000000"
android:strokeColor="#c1a551"/>
<path
android:pathData="m80.44,12.1c-7.45,2.48 -12.42,12.42 -19.87,12.42l0,4.97l39.74,0l0,-4.97c-7.45,0 -12.42,-9.94 -19.87,-12.42zM70.51,59.3l0,4.97l6.21,2.48l0,47.2c1.23,0.11 2.47,0.18 3.73,0.18s2.5,-0.07 3.73,-0.18l0,-47.2l6.21,-2.48l0,-4.97z"
android:fillColor="#555"
android:fillType="evenOdd"/>
<path
android:fillColor="#FF000000"
android:pathData="m42.85,54.94l0.07,0c16.06,0 29.02,13.02 29.02,29.02 0,16.06 -13.02,29.02 -29.02,29.02l-0.07,0c-16,0.07 -29.02,-12.96 -29.02,-28.95 0,-16.06 13.02,-29.08 29.02,-29.08z"
android:fillAlpha="0.2"/>
<path
android:pathData="M43.25,80.58m-29.08,0a29.08,29.08 0,1 1,58.17 0a29.08,29.08 0,1 1,-58.17 0"
android:fillColor="#495AAD"/>
<path
android:pathData="m47.54,68.68l0,18.51c0,1.12 0.79,1.39 1.72,1.39l1.59,0l0,3.97l-13.22,0l0,-3.97l1.78,0c0.86,0 1.52,-0.4 1.52,-1.39l0,-11.9c0,1.32 -5.29,1.32 -5.29,1.32l0,-3.97c2.64,0 5.95,-1.32 5.95,-3.97z"
android:fillColor="#FFFFFF"/>
</vector>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings_ee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@
<!-- pharmacy dispensing -->
<string name="quest_is_pharmacy_dispensing_title">Is this pharmacy dispensing all prescription drugs?</string>

<!-- piste lit -->
<string name="quest_piste_lit_title">"Is this piste lit here?"</string>

<!-- poi quests -->
<string name="quest_poi_seating_title">POI: Seating</string>
<string name="default_disabled_msg_poi_bench">This \"quest\" shows POIs like benches or picnic tables as brown dots. Click the dot to show details and other answers.</string>
Expand Down
12 changes: 12 additions & 0 deletions res/graphics/quest/piste_lit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.