Skip to content

Commit 4ef7c1f

Browse files
authored
Add Shower Hot Water Quest (#6720)
1 parent b501158 commit 4ef7c1f

File tree

6 files changed

+110
-0
lines changed

6 files changed

+110
-0
lines changed

app/src/androidMain/kotlin/de/westnordost/streetcomplete/quests/QuestsModule.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import de.westnordost.streetcomplete.quests.address.AddHousenumber
1717
import de.westnordost.streetcomplete.quests.aerialway.AddAerialwayBicycleAccess
1818
import de.westnordost.streetcomplete.quests.air_conditioning.AddAirConditioning
1919
import de.westnordost.streetcomplete.quests.air_pump.AddAirCompressor
20+
import de.westnordost.streetcomplete.quests.amenities.AddHotWater
2021
import de.westnordost.streetcomplete.quests.amenity_cover.AddAmenityCover
2122
import de.westnordost.streetcomplete.quests.amenity_indoor.AddIsAmenityIndoor
2223
import de.westnordost.streetcomplete.quests.artwork.AddArtworkType
@@ -502,6 +503,8 @@ fun questTypeRegistry(
502503
117 to AddCampPower(),
503504
162 to AddSanitaryDumpStation(),
504505

506+
191 to AddHotWater(),
507+
505508
177 to AddShelterCapacity(),
506509

507510
// toilets
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package de.westnordost.streetcomplete.quests.amenities
2+
3+
import de.westnordost.streetcomplete.R
4+
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
5+
import de.westnordost.streetcomplete.data.osm.mapdata.Element
6+
import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry
7+
import de.westnordost.streetcomplete.data.osm.mapdata.filter
8+
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
9+
import de.westnordost.streetcomplete.data.quest.AndroidQuest
10+
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.OUTDOORS
11+
import de.westnordost.streetcomplete.osm.Tags
12+
import de.westnordost.streetcomplete.quests.YesNoQuestForm
13+
import de.westnordost.streetcomplete.util.ktx.toYesNo
14+
15+
class AddHotWater : OsmFilterQuestType<Boolean>(), AndroidQuest {
16+
17+
override val elementFilter = """
18+
nodes, ways with
19+
amenity = shower
20+
and fee = no
21+
and !hot_water
22+
and !shower:hot_water
23+
"""
24+
25+
override val changesetComment = "Specify whether a shower has hot water"
26+
override val wikiLink = "Key:hot_water"
27+
override val icon = R.drawable.quest_thermometer
28+
override val achievements = listOf(OUTDOORS)
29+
30+
override fun getTitle(tags: Map<String, String>) = R.string.quest_shower_hot_water_title
31+
32+
override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
33+
getMapData().filter("nodes, ways with amenity = shower")
34+
35+
override fun createForm() = YesNoQuestForm()
36+
37+
override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
38+
tags["hot_water"] = answer.toYesNo()
39+
}
40+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="128dp"
3+
android:height="128dp"
4+
android:viewportWidth="128"
5+
android:viewportHeight="128">
6+
<path
7+
android:pathData="M128,64c0,35.3 -28.7,64 -64,64S0,99.3 0,64 28.7,0 64,0s64,28.7 64,64"
8+
android:fillColor="#9bbe55"/>
9+
<path
10+
android:fillColor="#FF000000"
11+
android:pathData="m64,12c-8.79,0 -16,7.21 -16,16v44.88c-7.55,5.23 -12.17,13.83 -12.17,23.12 -0,15.51 12.66,28.17 28.17,28.17 15.51,0 28.17,-12.66 28.17,-28.17 0,-9.29 -4.62,-17.89 -12.17,-23.12v-44.88c0,-8.79 -7.21,-16 -16,-16z"
12+
android:fillAlpha="0.2"/>
13+
<path
14+
android:pathData="m64,8c-8.79,0 -16,7.21 -16,16v44.88c-7.55,5.23 -12.17,13.83 -12.17,23.12 -0,15.51 12.66,28.17 28.17,28.17 15.51,0 28.17,-12.66 28.17,-28.17 0,-9.29 -4.62,-17.89 -12.17,-23.12v-44.88c0,-8.79 -7.21,-16 -16,-16z"
15+
android:fillColor="#d4d4d4"/>
16+
<path
17+
android:pathData="m56,36v37.67c-7.29,3.18 -12,10.38 -12,18.33 0,11.05 8.95,20 20,20s20,-8.95 20,-20c-0,-7.95 -4.71,-15.15 -12,-18.33v-37.67z"
18+
android:fillColor="#f44336"/>
19+
<path
20+
android:pathData="m79.9,79.86a22,22 0,0 1,0.1 2.14,22 22,0 0,1 -22,22 22,22 0,0 1,-12.19 -3.69,20 20,0 0,0 18.19,11.69 20,20 0,0 0,20 -20,20 20,0 0,0 -4.1,-12.14z"
21+
android:fillColor="#c33"/>
22+
<path
23+
android:pathData="M58,86m-6,0a6,6 0,1 1,12 0a6,6 0,1 1,-12 0"
24+
android:fillColor="#ff7070"/>
25+
<path
26+
android:pathData="m64,16c-4.42,0 -8,3.58 -8,8v12h16v-12c0,-4.42 -3.58,-8 -8,-8z"
27+
android:fillColor="#fff"/>
28+
<path
29+
android:pathData="m52,62h8"
30+
android:strokeWidth="4"
31+
android:strokeColor="#7e7e7e"
32+
android:strokeLineCap="round"/>
33+
<path
34+
android:pathData="m52,50h8"
35+
android:strokeWidth="4"
36+
android:strokeColor="#7e7e7e"
37+
android:strokeLineCap="round"/>
38+
<path
39+
android:pathData="m52,38h8"
40+
android:strokeWidth="4"
41+
android:strokeColor="#7e7e7e"
42+
android:strokeLineCap="round"/>
43+
<path
44+
android:pathData="m52,26h8"
45+
android:strokeWidth="4"
46+
android:strokeColor="#7e7e7e"
47+
android:strokeLineCap="round"/>
48+
</vector>

app/src/androidMain/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,8 @@ If there are no signs along the whole street which apply for the highlighted sec
15471547
<string name="quest_shop_gone_replaced_answer">A(n)…</string>
15481548
<string name="quest_shop_gone_replaced_answer_hint">Type kind of place here</string>
15491549

1550+
<string name="quest_shower_hot_water_title">Is there hot water here?</string>
1551+
15501552
<string name="quest_sidewalk_surface_title">What’s the surface of the sidewalk here?</string>
15511553

15521554
<string name="quest_sidewalk_title">Does this street have a sidewalk?</string>

res/graphics/authors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ quest/
446446
surveillance.svg
447447
surveillance_camera.svg
448448
tent.svg
449+
thermometer.svg
449450
toilets.svg
450451
toilet_fee.svg
451452
toilets_wheelchair.svg

res/graphics/quest/thermometer.svg

Lines changed: 16 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)