Skip to content

Commit

Permalink
Merge pull request #4754 from FloEdelmann/seasonal-grit-bins
Browse files Browse the repository at this point in the history
Add seasonal grit bin quest
  • Loading branch information
westnordost committed Jan 17, 2023
2 parents b1124f6 + 8a80006 commit 5875c3b
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 2 deletions.
Expand Up @@ -76,6 +76,7 @@ import de.westnordost.streetcomplete.quests.fire_hydrant_ref.AddFireHydrantRef
import de.westnordost.streetcomplete.quests.foot.AddProhibitedForPedestrians
import de.westnordost.streetcomplete.quests.fuel_service.AddFuelSelfService
import de.westnordost.streetcomplete.quests.general_fee.AddGeneralFee
import de.westnordost.streetcomplete.quests.grit_bin_seasonal.AddGritBinSeasonal
import de.westnordost.streetcomplete.quests.handrail.AddHandrail
import de.westnordost.streetcomplete.quests.incline_direction.AddBicycleIncline
import de.westnordost.streetcomplete.quests.incline_direction.AddStepsIncline
Expand Down Expand Up @@ -316,6 +317,7 @@ fun questTypeRegistry(
whether the postbox is still there in countries in which it is enabled */
48 to AddPostboxCollectionTimes(),
49 to CheckExistence(featureDictionaryFuture),
155 to AddGritBinSeasonal(),

50 to AddBoardType(),

Expand Down
Expand Up @@ -36,6 +36,7 @@ class CheckExistence(
or leisure = picnic_table
or amenity = bbq
or leisure = firepit
or amenity = grit_bin and seasonal = no
or amenity = vending_machine and vending ~ parking_tickets|public_transport_tickets
or amenity = ticket_validator
or tourism = information and information ~ board|terminal|map
Expand Down
@@ -0,0 +1,31 @@
package de.westnordost.streetcomplete.quests.grit_bin_seasonal

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.data.user.achievements.EditTypeAchievement.CITIZEN
import de.westnordost.streetcomplete.osm.Tags
import de.westnordost.streetcomplete.osm.updateWithCheckDate
import de.westnordost.streetcomplete.quests.YesNoQuestForm

class AddGritBinSeasonal : OsmFilterQuestType<Boolean>() {

override val elementFilter = """
nodes with
amenity = grit_bin
and !seasonal
"""
override val changesetComment = "Specify whether grit bins are seasonal"
override val wikiLink = "Key:seasonal"
override val icon = R.drawable.calendar
override val achievements = listOf(CITIZEN)
override val defaultDisabledMessage = R.string.default_disabled_msg_seasonal

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

override fun createForm() = YesNoQuestForm()

override fun applyAnswerTo(answer: Boolean, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags.updateWithCheckDate("seasonal", if (answer) "no" else "winter")
}
}
Expand Up @@ -27,7 +27,7 @@ class AddSeating : OsmFilterQuestType<Seating>() {
override val icon = R.drawable.ic_quest_seating
override val isReplaceShopEnabled = true
override val achievements = listOf(CITIZEN)
override val defaultDisabledMessage = R.string.default_disabled_msg_summer_outdoor_seating
override val defaultDisabledMessage = R.string.default_disabled_msg_seasonal

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

Expand Down
68 changes: 68 additions & 0 deletions app/src/main/res/drawable/calendar.xml
@@ -0,0 +1,68 @@
<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.35 -28.65,64 -64,64s-64,-28.65 -64,-64 28.65,-64 64,-64 64,28.65 64,64"
android:fillColor="#9bbe55"/>
<path
android:fillColor="#FF000000"
android:pathData="m25,90v9c0,5.54 4.46,10 10,10h60c5.54,0 10,-4.46 10,-10v-9h-80z"
android:strokeAlpha="0.2"
android:fillAlpha="0.2"/>
<path
android:pathData="M35,35L95,35A10,10 0,0 1,105 45L105,95A10,10 0,0 1,95 105L35,105A10,10 0,0 1,25 95L25,45A10,10 0,0 1,35 35z"
android:fillColor="#fff"/>
<path
android:pathData="M35,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M51.67,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M68.33,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M85,85h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M85,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M68.33,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M51.67,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M35,70h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M35,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M51.67,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M68.33,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="M85,55h10v10h-10z"
android:fillColor="#b9b9b9"/>
<path
android:pathData="m35,30h60c5.54,0 10,4.46 10,10v10h-80v-10c0,-5.54 4.46,-10 10,-10z"
android:fillColor="#c84747"/>
<path
android:pathData="M86,38m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#9e3d33"/>
<path
android:pathData="M86,20L86,20A4,4 0,0 1,90 24L90,36A4,4 0,0 1,86 40L86,40A4,4 0,0 1,82 36L82,24A4,4 0,0 1,86 20z"
android:fillColor="#444"/>
<path
android:pathData="M44,38m-5,0a5,5 0,1 1,10 0a5,5 0,1 1,-10 0"
android:fillColor="#9e3d33"/>
<path
android:pathData="M44,20L44,20A4,4 0,0 1,48 24L48,36A4,4 0,0 1,44 40L44,40A4,4 0,0 1,40 36L40,24A4,4 0,0 1,44 20z"
android:fillColor="#444"/>
</vector>
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Expand Up @@ -108,6 +108,7 @@ The info you enter is directly added to OpenStreetMap in your name, without the
<string name="default_disabled_msg_no_ar">You need a tape measure to solve this quest because measuring with the camera is not supported on this device.</string>
<string name="default_disabled_msg_difficult_and_time_consuming">This quest type is disabled by default because it is either time-consuming or difficult to make the right choice. Only enable this quest type if you are really committed to adding this kind of data.</string>
<string name="default_disabled_msg_overlay">This quest type is disabled by default because there is already an overlay with which it is more effective and efficient to enter and update this data.</string>
<string name="default_disabled_msg_seasonal">"This quest type is disabled by default because it may require re-checking the situation at a specific part of the year."</string>


<!-- Quest interface -->
Expand Down Expand Up @@ -1014,6 +1015,8 @@ Before uploading your changes, the app checks with a &lt;a href=\"https://www.we
<string name="quest_generalFee_title2">Do you need to pay to enter here?</string>
<string name="quest_genericRef_title">What’s the identification number here?</string>

<string name="quest_gritBinSeasonal_title">Is this also here outside of winter?</string>

<string name="quest_handrail_title">Do these steps have a handrail?</string>

<string name="quest_internet_access_title">What kind of internet connection does this place offer?</string>
Expand Down Expand Up @@ -1321,7 +1324,6 @@ If there are no signs along the whole street which apply for the highlighted sec
<string name="quest_seating_indoor_only">Indoor seating only</string>
<string name="quest_seating_outdoor_only">Outdoor seating only</string>
<string name="quest_seating_indoor_and_outdoor">Both indoor and outdoor seating</string>
<string name="default_disabled_msg_summer_outdoor_seating">"This quest type is disabled by default because it may require checking during specific part of the year in order to verify outdoor seating."</string>

<string name="quest_segregated_title">How are the footpath and bicycle path laid out here?</string>
<string name="quest_segregated_separated">Segregated from one another</string>
Expand Down
1 change: 1 addition & 0 deletions res/graphics/authors.txt
Expand Up @@ -304,6 +304,7 @@ quest/
bus_stop_lit.svg parts taken from Twemoji: U+1F68D
bus_stop_shelter.svg parts taken from Twemoji: U+1F68D
bus_stop_name.svg parts taken from Twemoji: U+1F68D
calendar.svg Flo Edelmann (CC0)
camp_power.svg
car.svg modified from Twemoji: U+1F698
car_bumpy.svg modified from Twemoji: U+1F698
Expand Down
23 changes: 23 additions & 0 deletions res/graphics/quest/calendar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5875c3b

Please sign in to comment.