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

Add Sauna Availability Quest #653

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -219,6 +219,7 @@ import de.westnordost.streetcomplete.quests.traffic_signals_vibrate.AddTrafficSi
import de.westnordost.streetcomplete.quests.trail_visibility.AddTrailVisibility
import de.westnordost.streetcomplete.quests.tree.AddTreeGenus
import de.westnordost.streetcomplete.quests.sac_scale.AddSacScale
import de.westnordost.streetcomplete.quests.sauna_availability.AddSaunaAvailability
import de.westnordost.streetcomplete.quests.valves.AddValves
import de.westnordost.streetcomplete.quests.via_ferrata_scale.AddViaFerrataScale
import de.westnordost.streetcomplete.quests.way_lit.AddWayLit
Expand Down Expand Up @@ -633,6 +634,7 @@ fun getQuestTypeList(
EE_QUEST_OFFSET + 46 to AddDisabledParkingCapacity(),
EE_QUEST_OFFSET + 47 to AddParkingOrientation(),
EE_QUEST_OFFSET + 50 to AddCaravanSiteType(),
EE_QUEST_OFFSET + 52 to AddSaunaAvailability(),
EE_QUEST_OFFSET + 10 to OsmoseQuest(osmoseDao),
EE_QUEST_OFFSET + 11 to CustomQuest(customQuestList),
// POI quests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package de.westnordost.streetcomplete.quests.sauna_availability

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.quests.YesNoQuestForm
import de.westnordost.streetcomplete.util.ktx.toYesNo

class AddSaunaAvailability : OsmFilterQuestType<Boolean>() {

override val elementFilter = """
nodes, ways with
(
leisure ~ fitness_centre|resort|sports_centre|water_park
mcliquid marked this conversation as resolved.
Show resolved Hide resolved
or leisure = sports_hall and sport = swimming
or tourism ~ camp_site|hotel
)
and !sauna
"""
override val changesetComment = "Survey sauna availabilities"
override val wikiLink = "Key:sauna"
override val icon = R.drawable.ic_quest_sauna
override val defaultDisabledMessage: Int = R.string.default_disabled_msg_ee

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

override fun createForm() = YesNoQuestForm()

override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags["sauna"] = answer.toYesNo()
}
}
43 changes: 43 additions & 0 deletions app/src/main/res/drawable/ic_quest_sauna.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<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,64 28.7,0 64,0s64,28.7 64,64"
android:fillColor="#9bbe55"/>
<path
android:pathData="M24.9,83.2h21.2l-2.8,24.4h-16l-2.4,-24.4Z"
android:fillColor="#fff"/>
<path
android:pathData="M28.3,20.6c-25.1,16.2 20.2,18.9 -7.6,38.1h5.5c26.1,-20.6 -19.4,-22.1 8.2,-38.3l-6.1,0.2Z"
android:strokeWidth="0"
android:fillColor="#fff"
android:strokeColor="#fff"/>
<path
android:pathData="M47.3,20.6c-25.1,16.2 20.2,18.9 -7.6,38.1h5.5c26.1,-20.6 -19.4,-22.1 8.2,-38.3l-6.1,0.2Z"
android:strokeWidth="0"
android:fillColor="#fff"
android:strokeColor="#fff"/>
<path
android:pathData="M75.1,34a8.7,8.7 0,1 0,17.4 0a8.7,8.7 0,1 0,-17.4 0z"
android:fillColor="#fff"/>
<path
android:pathData="M59.6,100.1l15.7,-18.9c1.5,-1.8 4.1,-2 5.8,-0.3h0c1.7,1.7 1.8,4.5 0.3,6.3l-15.7,18.9c-1.5,1.8 -4.1,2 -5.8,0.3h0c-1.7,-1.7 -1.8,-4.5 -0.3,-6.3Z"
android:fillColor="#fff"/>
<path
android:pathData="M64.1,68.2l16.6,-5.6c1.6,-0.5 3.3,0.3 3.8,1.9h0c0.5,1.6 -0.3,3.3 -1.9,3.8l-16.6,5.6c-1.6,0.5 -3.3,-0.3 -3.8,-1.9h0c-0.5,-1.6 0.3,-3.3 1.9,-3.8Z"
android:fillColor="#fff"/>
<path
android:pathData="M92.5,50.8l-7.8,15.3c-0.7,1.5 -2.5,2 -4,1.3h0c-1.5,-0.8 -2,-2.5 -1.3,-4l7.8,-15.3c0.7,-1.5 2.5,-2 4,-1.3h0c1.5,0.8 2,2.5 1.3,4Z"
android:fillColor="#fff"/>
<path
android:pathData="M78.4,79.5h25.1c2.2,0 4,1.8 4,4.1h0c0,2.2 -1.8,4 -4,4h-25.1c-2.2,0 -4,-1.8 -4,-4.1h0c0,-2.2 1.8,-4 4,-4Z"
android:fillColor="#fff"/>
<path
android:pathData="M86.2,95.7h21.4v4.6h-21.4z"
android:fillColor="#fff"/>
<path
android:pathData="M95.1,48.2l12.2,33.8c0.8,2.1 -0.3,4.5 -2.5,5.3h0c-2.2,0.8 -4.5,-0.3 -5.3,-2.5l-12.2,-33.8c-0.8,-2.1 0.3,-4.5 2.5,-5.3h0c2.2,-0.8 4.5,0.3 5.3,2.5Z"
android:fillColor="#fff"/>
</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 @@ -322,6 +322,9 @@
<string name="quest_utility_sewerage">Sewerage</string>
<string name="quest_utility_telecom">Telecommunication</string>

<!-- sauna availability quest -->
<string name="quest_saunaAvailability_title">Is there a sauna here?</string>

<!-- service building type -->
<string name="quest_service_building_type_title">What kind of service building is this?</string>
<string name="quest_service_building_type_substation">Electrical substation</string>
Expand Down
1 change: 1 addition & 0 deletions res/graphics/authors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ quest/
restaurant_vegetarian.svg parts taken from Twemoji: U+1F37D and U+1F955
road_construction.svg
roof_shape.svg
sauna.svg modified by mcliquid based on Geozeisig CC0 1.0 from https://wiki.openstreetmap.org/wiki/File:Sauna-14.svg
seating.svg
shelter_type.svg modified from https://wiki.openstreetmap.org/wiki/File:Shelter-14.svg
shower.svg
Expand Down
37 changes: 37 additions & 0 deletions res/graphics/quest/sauna.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.