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

Bbq fuel quest (Issue #4832) #5211

Merged
merged 8 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -23,6 +23,7 @@ import de.westnordost.streetcomplete.quests.barrier_type.AddBarrierOnPath
import de.westnordost.streetcomplete.quests.barrier_type.AddBarrierOnRoad
import de.westnordost.streetcomplete.quests.barrier_type.AddBarrierType
import de.westnordost.streetcomplete.quests.barrier_type.AddStileType
import de.westnordost.streetcomplete.quests.bbq_fuel.AddBbqFuel
import de.westnordost.streetcomplete.quests.bench_backrest.AddBenchBackrest
import de.westnordost.streetcomplete.quests.bike_parking_capacity.AddBikeParkingCapacity
import de.westnordost.streetcomplete.quests.bike_parking_cover.AddBikeParkingCover
Expand Down Expand Up @@ -353,6 +354,7 @@ fun questTypeRegistry(
66 to AddFireHydrantDiameter(),
67 to AddFireHydrantRef(),

160 to AddBbqFuel(),
/* ↓ 2.solvable when right in front of it but takes longer to input --------------------- */

// bike parking/rental: would be higher up if not for bike parking/rental capacity which is usually not solvable when moving past
Expand Down
@@ -0,0 +1,37 @@
package de.westnordost.streetcomplete.quests.bbq_fuel

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
import de.westnordost.streetcomplete.data.osm.mapdata.Element
import de.westnordost.streetcomplete.data.osm.mapdata.MapDataWithGeometry
import de.westnordost.streetcomplete.data.osm.mapdata.filter
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.OUTDOORS
import de.westnordost.streetcomplete.osm.Tags

class AddBbqFuel : OsmFilterQuestType<BbqFuel>() {

override val elementFilter = """
nodes, ways with
amenity = bbq
and !fuel
and access !~ no|private
"""


override val changesetComment = "Specify barbecue fuel"
override val wikiLink = "Key:amenity=bbq"
override val icon = R.drawable.ic_quest_bbq_fuel
override val achievements = listOf(OUTDOORS)

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

override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
getMapData().filter("nodes with amenity = bbq")

override fun createForm() = AddBbqFuelForm()

override fun applyAnswerTo(answer: BbqFuel, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags["fuel"] = answer.osmValue
}
}
@@ -0,0 +1,15 @@
package de.westnordost.streetcomplete.quests.bbq_fuel

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AListQuestForm
import de.westnordost.streetcomplete.quests.TextItem

class AddBbqFuelForm : AListQuestForm<BbqFuel>() {

override val items = listOf(
TextItem(BbqFuel.WOOD, R.string.quest_bbq_fuel_wood),
TextItem(BbqFuel.ELECTRIC, R.string.quest_bbq_fuel_electric),
TextItem(BbqFuel.CHARCOAL, R.string.quest_bbq_fuel_charcoal),
)

}
@@ -0,0 +1,7 @@
package de.westnordost.streetcomplete.quests.bbq_fuel

enum class BbqFuel(val osmValue: String) {
WOOD("wood"),
ELECTRIC("electric"),
CHARCOAL("charcoal")
}
Expand Up @@ -8,6 +8,7 @@ import de.westnordost.streetcomplete.util.getShortHouseNumber
@DrawableRes fun getPinIcon(map: Map<String, String>): Int? {
when (map["amenity"]) {
"atm" -> return R.drawable.ic_pin_money
"bbq" -> return R.drawable.ic_pin_bbq
"bench" -> return R.drawable.ic_pin_bench
"bicycle_parking" -> return R.drawable.ic_pin_bicycle_parking
"bicycle_rental" -> return R.drawable.ic_pin_bicycle_rental
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/ic_pin_bbq.xml
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="m12,4.088c-2.667,1.143 -5.333,1.143 -5.333,3.429 0,2.286 4,3.429 4,4.571 0,1.143 -1.778,2.286 -2.667,3.429 4,-1.143 5.333,-1.143 5.333,-3.429 0,-2.286 -2.667,-3.429 -4,-4.571 0,-1.143 2.222,-1.905 2.667,-3.429zM22,4.088c-2.667,1.143 -5.333,1.143 -5.333,3.429 0,2.286 4,3.429 4,4.571 0,1.143 -1.778,2.286 -2.667,3.429 4,-1.143 5.333,-1.143 5.333,-3.429 0,-2.286 -2.667,-3.429 -4,-4.571 0,-1.143 2.222,-1.905 2.667,-3.429zM32,4.088c-2.667,1.143 -5.333,1.143 -5.333,3.429 0,2.286 4,3.429 4,4.571 0,1.143 -1.778,2.286 -2.667,3.429 4,-1.143 5.333,-1.143 5.333,-3.429 0,-2.286 -2.667,-3.429 -4,-4.571 0,-1.143 2.222,-1.905 2.667,-3.429zM4,17.803v18.286h2.667v-4.571h26.667v4.571L36,36.088L36,17.803c-10.667,0 -21.333,0 -32,0zM6.667,20.088h26.667v9.143L6.667,29.231ZM12,22.374c-1.473,0 -2.667,1.023 -2.667,2.286 0,1.262 1.194,2.286 2.667,2.286 1.473,0 2.667,-1.023 2.667,-2.286 0,-1.262 -1.194,-2.286 -2.667,-2.286zM20,22.374c-1.473,0 -2.667,1.023 -2.667,2.286 0,1.262 1.194,2.286 2.667,2.286 1.473,0 2.667,-1.023 2.667,-2.286 0,-1.262 -1.194,-2.286 -2.667,-2.286zM28,22.374c-1.473,0 -2.667,1.023 -2.667,2.286 0,1.262 1.194,2.286 2.667,2.286 1.473,0 2.667,-1.023 2.667,-2.286 0,-1.262 -1.194,-2.286 -2.667,-2.286z"
android:strokeWidth="0.469"
android:fillColor="#000000"
android:strokeColor="#e6e6e6"/>
</vector>
20 changes: 20 additions & 0 deletions app/src/main/res/drawable/ic_quest_bbq_fuel.xml
@@ -0,0 +1,20 @@
<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,64 -35.35,0 -64,-28.65 -64,-64 0,-35.35 28.65,-64 64,-64 35.35,0 64,28.65 64,64"
android:strokeWidth=".2"
android:fillColor="#9bbe55"/>
<path
android:fillColor="#FF000000"
android:pathData="m49.24,28.68c-4.92,2.46 -9.84,2.46 -9.84,7.38 0,4.92 7.38,7.38 7.38,9.84 0,2.46 -3.28,4.92 -4.92,7.38 7.38,-2.46 9.84,-2.46 9.84,-7.38 0,-4.92 -4.92,-7.38 -7.38,-9.84 0,-2.46 4.1,-4.1 4.92,-7.38zM67.69,28.68c-4.92,2.46 -9.84,2.46 -9.84,7.38 0,4.92 7.38,7.38 7.38,9.84 0,2.46 -3.28,4.92 -4.92,7.38 7.38,-2.46 9.84,-2.46 9.84,-7.38 0,-4.92 -4.92,-7.38 -7.38,-9.84 0,-2.46 4.1,-4.1 4.92,-7.38zM86.15,28.68c-4.92,2.46 -9.84,2.46 -9.84,7.38 0,4.92 7.38,7.38 7.38,9.84 0,2.46 -3.28,4.92 -4.92,7.38 7.38,-2.46 9.84,-2.46 9.84,-7.38 0,-4.92 -4.92,-7.38 -7.38,-9.84 0,-2.46 4.1,-4.1 4.92,-7.38zM34.47,58.21l0,39.37l4.92,0L39.39,87.73l49.21,0l0,9.84l4.92,0L93.53,58.21c-19.68,0 -39.37,0 -59.05,0zM39.39,63.13L88.61,63.13L88.61,82.81L39.39,82.81ZM49.24,68.05c-2.72,0 -4.92,2.2 -4.92,4.92 0,2.72 2.2,4.92 4.92,4.92 2.72,0 4.92,-2.2 4.92,-4.92 0,-2.72 -2.2,-4.92 -4.92,-4.92zM64,68.05c-2.72,0 -4.92,2.2 -4.92,4.92 0,2.72 2.2,4.92 4.92,4.92 2.72,0 4.92,-2.2 4.92,-4.92 0,-2.72 -2.2,-4.92 -4.92,-4.92zM78.76,68.05c-2.72,0 -4.92,2.2 -4.92,4.92 0,2.72 2.2,4.92 4.92,4.92 2.72,0 4.92,-2.2 4.92,-4.92 0,-2.72 -2.2,-4.92 -4.92,-4.92z"
android:strokeWidth="4.92"/>
<path
android:fillColor="#FF000000"
android:pathData="m49.24,30.42c-4.92,2.46 -9.84,2.46 -9.84,7.38 0,4.92 7.38,7.38 7.38,9.84 0,2.46 -3.28,4.92 -4.92,7.38 7.38,-2.46 9.84,-2.46 9.84,-7.38 0,-4.92 -4.92,-7.38 -7.38,-9.84 0,-2.46 4.1,-4.1 4.92,-7.38zM67.69,30.42c-4.92,2.46 -9.84,2.46 -9.84,7.38 0,4.92 7.38,7.38 7.38,9.84 0,2.46 -3.28,4.92 -4.92,7.38 7.38,-2.46 9.84,-2.46 9.84,-7.38 0,-4.92 -4.92,-7.38 -7.38,-9.84 0,-2.46 4.1,-4.1 4.92,-7.38zM86.15,30.42c-4.92,2.46 -9.84,2.46 -9.84,7.38 0,4.92 7.38,7.38 7.38,9.84 0,2.46 -3.28,4.92 -4.92,7.38 7.38,-2.46 9.84,-2.46 9.84,-7.38 0,-4.92 -4.92,-7.38 -7.38,-9.84 0,-2.46 4.1,-4.1 4.92,-7.38zM34.47,59.95l0,39.37l4.92,0L39.39,89.48l49.21,0l0,9.84l4.92,0L93.53,59.95c-19.68,0 -39.37,0 -59.05,0zM39.39,64.87L88.61,64.87L88.61,84.56L39.39,84.56ZM49.24,69.79c-2.72,0 -4.92,2.2 -4.92,4.92 0,2.72 2.2,4.92 4.92,4.92 2.72,0 4.92,-2.2 4.92,-4.92 0,-2.72 -2.2,-4.92 -4.92,-4.92zM64,69.79c-2.72,0 -4.92,2.2 -4.92,4.92 0,2.72 2.2,4.92 4.92,4.92 2.72,0 4.92,-2.2 4.92,-4.92 0,-2.72 -2.2,-4.92 -4.92,-4.92zM78.76,69.79c-2.72,0 -4.92,2.2 -4.92,4.92 0,2.72 2.2,4.92 4.92,4.92 2.72,0 4.92,-2.2 4.92,-4.92 0,-2.72 -2.2,-4.92 -4.92,-4.92z"
android:strokeAlpha="0.403101"
android:strokeWidth="4.92"
android:fillAlpha="0.403101"/>
</vector>
6 changes: 6 additions & 0 deletions app/src/main/res/values-de/strings.xml
Expand Up @@ -296,6 +296,12 @@ Andernfalls kannst du eine alternative Tastatur im App Store herunterladen. Beli
<string name="quest_powerPolesMaterial_wood">"Holz"</string>
<string name="quest_powerPolesMaterial_metal">"Stahl"</string>
<string name="quest_powerPolesMaterial_concrete">"Beton"</string>

<string name="quest_bbq_fuel_title">Womit wird dieser Grill betrieben?</string>
westnordost marked this conversation as resolved.
Show resolved Hide resolved
<string name="quest_bbq_fuel_wood">Holz</string>
<string name="quest_bbq_fuel_electric">Elektrisch</string>
<string name="quest_bbq_fuel_charcoal">Holzkohle</string>

<string name="quest_maxspeed_answer_advisory_speed_limit">"Nur eine Richtgeschwindigkeit …"</string>
<string name="quest_address_house_name_label">"Hausname:"</string>
<string name="quest_buildingLevels_roofLevelsLabel2">"Dach­­­­geschosse"</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Expand Up @@ -1284,6 +1284,11 @@ If there are no signs along the whole street which apply for the highlighted sec
<string name="quest_powerPolesMaterial_metal">Steel</string>
<string name="quest_powerPolesMaterial_concrete">Concrete</string>

<string name="quest_bbq_fuel_title">What is this grill powered by?</string>
<string name="quest_bbq_fuel_wood">Wood</string>
<string name="quest_bbq_fuel_electric">Electric</string>
<string name="quest_bbq_fuel_charcoal">Charcoal</string>

<string name="quest_railway_crossing_barrier_title2">What barriers are used at this railway crossing?</string>
<string name="quest_railway_crossing_barrier_none2">No barriers</string>

Expand Down
4 changes: 3 additions & 1 deletion res/graphics/authors.txt
Expand Up @@ -248,6 +248,7 @@ max weight/
truck.svg

pins/
bbq.svg modified from https://github.com/gravitystorm/openstreetmap-carto/blob/master/symbols/amenity/bbq.svg (License: CC0 1.0)
bicycle_parking.svg
bicycle_pump.svg
bicycle_rental.svg
Expand Down Expand Up @@ -284,7 +285,8 @@ quest/
barrier.svg Tobias Zwick (CC-BY-SA 4.0) (based on road_construction.svg)
barrier_on_path.svg Tobias Zwick (CC-BY-SA 4.0), adding road line by Mateusz Konieczny
barrier_on_road.svg Tobias Zwick (CC-BY-SA 4.0), adding road line by Mateusz Konieczny
beach.svg parts taken from beach_volleyball.svg by Adrien Pavie
bbq_fuel.svg based on https://github.com/gravitystorm/openstreetmap-carto/blob/master/symbols/amenity/bbq.svg (License: CC0 1.0)
beach.svg parts taken from beach_volleyball.svg by Adrien Pavie
beer.svg modified from Twemoji: U+1F37A
bench_poi.svg
bench_public_transport.svg
Expand Down
36 changes: 36 additions & 0 deletions res/graphics/pins/bbq.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions res/graphics/quest/bbq_fuel.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.