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 new quest: post_office type #737

Merged
merged 4 commits into from
Feb 9, 2025
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 @@ -154,6 +154,7 @@ import de.westnordost.streetcomplete.quests.pitch_lit.AddPitchLit
import de.westnordost.streetcomplete.quests.place_name.AddPlaceName
import de.westnordost.streetcomplete.quests.playground_access.AddPlaygroundAccess
import de.westnordost.streetcomplete.quests.police_type.AddPoliceType
import de.westnordost.streetcomplete.quests.post_office.AddPostOfficeType
import de.westnordost.streetcomplete.quests.postbox_collection_times.AddPostboxCollectionTimes
import de.westnordost.streetcomplete.quests.postbox_ref.AddPostboxRef
import de.westnordost.streetcomplete.quests.postbox_royal_cypher.AddPostboxRoyalCypher
Expand Down Expand Up @@ -646,6 +647,7 @@ fun getQuestTypeList(
EE_QUEST_OFFSET + 52 to AddSaunaAvailability(),
EE_QUEST_OFFSET + 53 to AddSwimmingPoolAvailability(),
EE_QUEST_OFFSET + 54 to AddLampType(),
EE_QUEST_OFFSET + 55 to AddPostOfficeType(),
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,36 @@
package de.westnordost.streetcomplete.quests.post_office

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
import de.westnordost.streetcomplete.osm.Tags

class AddPostOfficeType : OsmFilterQuestType<String>() {

override val elementFilter = """
nodes, ways with
amenity = post_office
and !post_office
"""
override val changesetComment = "Add post office"
override val defaultDisabledMessage = R.string.default_disabled_msg_ee
override val wikiLink = "Key:post_office"
override val icon = R.drawable.ic_quest_post_office
override val isReplacePlaceEnabled = true
override val achievements = listOf(EditTypeAchievement.CITIZEN)

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

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

override fun createForm() = AddPostOfficeTypeForm()

override fun applyAnswerTo(answer: String, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags["post_office"] = answer
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package de.westnordost.streetcomplete.quests.post_office

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

class AddPostOfficeTypeForm : AListQuestForm<String>() {
override val items = listOf(
TextItem("bureau", R.string.quest_postOffice_bureau),
TextItem("post_annex", R.string.quest_postOffice_postAnnex),
TextItem("post_partner", R.string.quest_postOffice_postPartner),
)
}
178 changes: 178 additions & 0 deletions app/src/main/res/drawable/ic_quest_post_office.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<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="#e9a76f"/>
<path
android:fillColor="#FF000000"
android:pathData="M23,44v26.5c-5.4,0 -9.8,-4.4 -9.8,-9.8l9.7,-16.7h0.1Z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M111.3,60.7c0,5.4 -4.4,9.8 -9.8,9.8 -0.5,-0.5 1.5,-20.5 1.5,-20.5l8.3,10.7Z"
android:fillAlpha="0.2"/>
<path
android:pathData="M16,96h92v-60H16v60Z"
android:fillColor="#cb9781"/>
<path
android:pathData="M26,70h48v18h-48z"
android:fillColor="#a4c1ee"/>
<path
android:pathData="M82,70h13v26h-13z"
android:fillColor="#a4c1ee"/>
<path
android:pathData="M26,70h48v6h-48z"
android:fillColor="#859dbf"/>
<path
android:pathData="M82,70h13v6h-13z"
android:fillColor="#859dbf"/>
<path
android:pathData="M24,24h76v12h-76z"
android:fillColor="#d6bdb1"/>
<path
android:pathData="M12.9,56.7l8.1,-14.7h82l8.3,14.7H12.9Z"
android:fillColor="#c84747"/>
<path
android:pathData="M32.6,56.7c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,-0.1Z"
android:fillColor="#9a2e2e"/>
<path
android:pathData="M52.3,56.7c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,-0.1Z"
android:fillColor="#c8c8c8"/>
<path
android:pathData="M71.9,56.7c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,0Z"
android:fillColor="#9a2e2e"/>
<path
android:pathData="M91.6,56.7c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,0Z"
android:fillColor="#c8c8c8"/>
<path
android:pathData="M111.3,56.7c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,0Z"
android:fillColor="#9a2e2e"/>
<path
android:pathData="M32.6,56.7l4.4,-14.7h17l-1.7,14.7h-19.7Z"
android:fillColor="#fff"/>
<path
android:pathData="M71.9,56.7l-1.9,-14.7h17l4.6,14.7s-19.7,0 -19.7,0Z"
android:fillColor="#fff"/>
<path
android:fillColor="#FF000000"
android:pathData="M16,96h92v4h-92z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M27.5,70.3c-1.8,0 -2.8,1.7 -2.4,3.2v33.7c-0.4,1.5 0.6,3.2 2.4,3.2h45c1.8,0 2.8,-1.7 2.4,-3.2v-33.7c0.4,-1.5 -0.6,-3.2 -2.4,-3.2H27.5Z"
android:fillAlpha="0.2"/>
<path
android:pathData="M29,67.8h41.9c2.2,0 4,1.8 4,4v31.9c0,2.2 -1.8,4 -4,4H29c-2.2,0 -4,-1.8 -4,-4v-31.9c0,-2.2 1.8,-4 4,-4Z"
android:fillColor="#ddd"/>
<path
android:pathData="M27.5,104.1l22.5,-23.8 22.5,23.8"
android:strokeLineJoin="round"
android:strokeWidth="5"
android:fillColor="#00000000"
android:strokeColor="#aaa"
android:strokeLineCap="round"/>
<path
android:pathData="M27.5,107.8c-2.3,0 -3.4,-2.8 -1.7,-4.4l22.5,-20c0.9,-0.8 2.4,-0.8 3.3,0l22.5,20c1.7,1.5 0.6,4.4 -1.7,4.4H27.5Z"
android:fillColor="#e9e9e9"
android:fillType="evenOdd"/>
<path
android:pathData="M27.5,71.6l22.5,23.8 22.5,-23.8"
android:strokeLineJoin="round"
android:strokeWidth="5"
android:fillColor="#00000000"
android:strokeColor="#aaa"
android:strokeLineCap="round"/>
<path
android:pathData="M27.5,67.8c-2.3,0 -3.4,2.8 -1.7,4.4l22.5,20c0.9,0.8 2.4,0.8 3.3,0l22.5,-20c1.7,-1.5 0.6,-4.4 -1.7,-4.4H27.5Z"
android:fillColor="#fff"
android:fillType="evenOdd"/>
<path
android:pathData="M-423,55.5c0,35.3 -28.7,64 -64,64s-64,-28.7 -64,-64 28.7,-64 64,-64 64,28.7 64,64"
android:fillColor="#e9a76f"/>
<path
android:fillColor="#FF000000"
android:pathData="M-528,29.5v26.5c-5.4,0 -9.8,-4.4 -9.8,-9.8l9.7,-16.7h0.1Z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M-439.7,46.2c0,5.4 -4.4,9.8 -9.8,9.8 -0.5,-0.5 1.5,-20.5 1.5,-20.5l8.3,10.7Z"
android:fillAlpha="0.2"/>
<path
android:pathData="M-535,87.5h92V27.5h-92v60Z"
android:fillColor="#cb9781"/>
<path
android:pathData="M-525,61.5h48v18h-48z"
android:fillColor="#a4c1ee"/>
<path
android:pathData="M-469,61.5h13v26h-13z"
android:fillColor="#a4c1ee"/>
<path
android:pathData="M-525,61.5h48v6h-48z"
android:fillColor="#859dbf"/>
<path
android:pathData="M-469,61.5h13v6h-13z"
android:fillColor="#859dbf"/>
<path
android:pathData="M-527,15.5h76v12h-76z"
android:fillColor="#d6bdb1"/>
<path
android:pathData="M-538.1,42.2l8.1,-14.7h82l8.3,14.7h-98.4Z"
android:fillColor="#c84747"/>
<path
android:pathData="M-518.4,42.2c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,-0.1Z"
android:fillColor="#9a2e2e"/>
<path
android:pathData="M-498.7,42.2c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,-0.1Z"
android:fillColor="#c8c8c8"/>
<path
android:pathData="M-479.1,42.2c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,0Z"
android:fillColor="#9a2e2e"/>
<path
android:pathData="M-459.4,42.2c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,0Z"
android:fillColor="#c8c8c8"/>
<path
android:pathData="M-439.7,42.2c0,5.4 -4.4,9.8 -9.8,9.8s-9.8,-4.4 -9.8,-9.8h19.7,0Z"
android:fillColor="#9a2e2e"/>
<path
android:pathData="M-518.4,42.2l4.4,-14.7h17l-1.7,14.7h-19.7Z"
android:fillColor="#fff"/>
<path
android:pathData="M-479.1,42.2l-1.9,-14.7h17l4.6,14.7s-19.7,0 -19.7,0Z"
android:fillColor="#fff"/>
<path
android:fillColor="#FF000000"
android:pathData="M-535,87.5h92v4h-92z"
android:fillAlpha="0.2"/>
<path
android:fillColor="#FF000000"
android:pathData="M-524.5,58c-1.8,0 -2.8,1.7 -2.4,3.2v33.7c-0.4,1.5 0.6,3.2 2.4,3.2h45c1.8,0 2.8,-1.7 2.4,-3.2v-33.7c0.4,-1.5 -0.6,-3.2 -2.4,-3.2h-45Z"
android:fillAlpha="0.2"/>
<path
android:pathData="M-523,55.5h41.9c2.2,0 4,1.8 4,4v31.9c0,2.2 -1.8,4 -4,4h-41.9c-2.2,0 -4,-1.8 -4,-4v-31.9c0,-2.2 1.8,-4 4,-4Z"
android:fillColor="#ddd"/>
<path
android:pathData="M-524.5,91.8l22.5,-23.8 22.5,23.8"
android:strokeLineJoin="round"
android:strokeWidth="5"
android:fillColor="#00000000"
android:strokeColor="#aaa"
android:strokeLineCap="round"/>
<path
android:pathData="M-524.5,95.5c-2.3,0 -3.4,-2.8 -1.7,-4.4l22.5,-20c0.9,-0.8 2.4,-0.8 3.3,0l22.5,20c1.7,1.5 0.6,4.4 -1.7,4.4h-44.9Z"
android:fillColor="#e9e9e9"
android:fillType="evenOdd"/>
<path
android:pathData="M-524.5,59.3l22.5,23.8 22.5,-23.8"
android:strokeLineJoin="round"
android:strokeWidth="5"
android:fillColor="#00000000"
android:strokeColor="#aaa"
android:strokeLineCap="round"/>
<path
android:pathData="M-524.5,55.5c-2.3,0 -3.4,2.8 -1.7,4.4l22.5,20c0.9,0.8 2.4,0.8 3.3,0l22.5,-20c1.7,-1.5 0.6,-4.4 -1.7,-4.4h-44.9Z"
android:fillColor="#fff"
android:fillType="evenOdd"/>
</vector>
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings_ee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@
<string name="quest_lampType_mercury">Mercury-vapor lamp</string>
<string name="quest_lampType_halogen">Halogen lamp</string>

<!-- post office -->
<string name="quest_postOffice_title">What type is this post office?</string>
<string name="quest_postOffice_bureau">Full (official) post office</string>
<string name="quest_postOffice_postAnnex">Post office (privatly owned, perhaps with restricted service)</string>
<string name="quest_postOffice_postPartner">Post relay point in shops or amenities (as a service)</string>

<!-- new overlays -->

<!-- custom overlay -->
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/
pitch_lantern.svg
pitch_surface.svg
playground.svg
post_office.svg modified by mcliquid based on mail.svg and shop.svg
power.svg
quest.svg
railway.svg
Expand Down
59 changes: 59 additions & 0 deletions res/graphics/quest/post_office.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.