Skip to content

Commit 282855d

Browse files
authored
Add new quest: post_office type (#737)
Fixes #736
1 parent d5f3d25 commit 282855d

File tree

7 files changed

+295
-0
lines changed

7 files changed

+295
-0
lines changed

app/src/main/java/de/westnordost/streetcomplete/quests/QuestsModule.kt

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ import de.westnordost.streetcomplete.quests.pitch_lit.AddPitchLit
154154
import de.westnordost.streetcomplete.quests.place_name.AddPlaceName
155155
import de.westnordost.streetcomplete.quests.playground_access.AddPlaygroundAccess
156156
import de.westnordost.streetcomplete.quests.police_type.AddPoliceType
157+
import de.westnordost.streetcomplete.quests.post_office.AddPostOfficeType
157158
import de.westnordost.streetcomplete.quests.postbox_collection_times.AddPostboxCollectionTimes
158159
import de.westnordost.streetcomplete.quests.postbox_ref.AddPostboxRef
159160
import de.westnordost.streetcomplete.quests.postbox_royal_cypher.AddPostboxRoyalCypher
@@ -646,6 +647,7 @@ fun getQuestTypeList(
646647
EE_QUEST_OFFSET + 52 to AddSaunaAvailability(),
647648
EE_QUEST_OFFSET + 53 to AddSwimmingPoolAvailability(),
648649
EE_QUEST_OFFSET + 54 to AddLampType(),
650+
EE_QUEST_OFFSET + 55 to AddPostOfficeType(),
649651
EE_QUEST_OFFSET + 10 to OsmoseQuest(osmoseDao),
650652
EE_QUEST_OFFSET + 11 to CustomQuest(customQuestList),
651653
// POI quests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package de.westnordost.streetcomplete.quests.post_office
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.user.achievements.EditTypeAchievement
10+
import de.westnordost.streetcomplete.osm.Tags
11+
12+
class AddPostOfficeType : OsmFilterQuestType<String>() {
13+
14+
override val elementFilter = """
15+
nodes, ways with
16+
amenity = post_office
17+
and !post_office
18+
"""
19+
override val changesetComment = "Add post office"
20+
override val defaultDisabledMessage = R.string.default_disabled_msg_ee
21+
override val wikiLink = "Key:post_office"
22+
override val icon = R.drawable.ic_quest_post_office
23+
override val isReplacePlaceEnabled = true
24+
override val achievements = listOf(EditTypeAchievement.CITIZEN)
25+
26+
override fun getTitle(tags: Map<String, String>) = R.string.quest_postOffice_title
27+
28+
override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry) =
29+
getMapData().filter("nodes with amenity = post_office or post_office")
30+
31+
override fun createForm() = AddPostOfficeTypeForm()
32+
33+
override fun applyAnswerTo(answer: String, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
34+
tags["post_office"] = answer
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package de.westnordost.streetcomplete.quests.post_office
2+
3+
import de.westnordost.streetcomplete.R
4+
import de.westnordost.streetcomplete.quests.AListQuestForm
5+
import de.westnordost.streetcomplete.quests.TextItem
6+
7+
class AddPostOfficeTypeForm : AListQuestForm<String>() {
8+
override val items = listOf(
9+
TextItem("bureau", R.string.quest_postOffice_bureau),
10+
TextItem("post_annex", R.string.quest_postOffice_postAnnex),
11+
TextItem("post_partner", R.string.quest_postOffice_postPartner),
12+
)
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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="#e9a76f"/>
9+
<path
10+
android:fillColor="#FF000000"
11+
android:pathData="M23,44v26.5c-5.4,0 -9.8,-4.4 -9.8,-9.8l9.7,-16.7h0.1Z"
12+
android:fillAlpha="0.2"/>
13+
<path
14+
android:fillColor="#FF000000"
15+
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"
16+
android:fillAlpha="0.2"/>
17+
<path
18+
android:pathData="M16,96h92v-60H16v60Z"
19+
android:fillColor="#cb9781"/>
20+
<path
21+
android:pathData="M26,70h48v18h-48z"
22+
android:fillColor="#a4c1ee"/>
23+
<path
24+
android:pathData="M82,70h13v26h-13z"
25+
android:fillColor="#a4c1ee"/>
26+
<path
27+
android:pathData="M26,70h48v6h-48z"
28+
android:fillColor="#859dbf"/>
29+
<path
30+
android:pathData="M82,70h13v6h-13z"
31+
android:fillColor="#859dbf"/>
32+
<path
33+
android:pathData="M24,24h76v12h-76z"
34+
android:fillColor="#d6bdb1"/>
35+
<path
36+
android:pathData="M12.9,56.7l8.1,-14.7h82l8.3,14.7H12.9Z"
37+
android:fillColor="#c84747"/>
38+
<path
39+
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"
40+
android:fillColor="#9a2e2e"/>
41+
<path
42+
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"
43+
android:fillColor="#c8c8c8"/>
44+
<path
45+
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"
46+
android:fillColor="#9a2e2e"/>
47+
<path
48+
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"
49+
android:fillColor="#c8c8c8"/>
50+
<path
51+
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"
52+
android:fillColor="#9a2e2e"/>
53+
<path
54+
android:pathData="M32.6,56.7l4.4,-14.7h17l-1.7,14.7h-19.7Z"
55+
android:fillColor="#fff"/>
56+
<path
57+
android:pathData="M71.9,56.7l-1.9,-14.7h17l4.6,14.7s-19.7,0 -19.7,0Z"
58+
android:fillColor="#fff"/>
59+
<path
60+
android:fillColor="#FF000000"
61+
android:pathData="M16,96h92v4h-92z"
62+
android:fillAlpha="0.2"/>
63+
<path
64+
android:fillColor="#FF000000"
65+
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"
66+
android:fillAlpha="0.2"/>
67+
<path
68+
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"
69+
android:fillColor="#ddd"/>
70+
<path
71+
android:pathData="M27.5,104.1l22.5,-23.8 22.5,23.8"
72+
android:strokeLineJoin="round"
73+
android:strokeWidth="5"
74+
android:fillColor="#00000000"
75+
android:strokeColor="#aaa"
76+
android:strokeLineCap="round"/>
77+
<path
78+
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"
79+
android:fillColor="#e9e9e9"
80+
android:fillType="evenOdd"/>
81+
<path
82+
android:pathData="M27.5,71.6l22.5,23.8 22.5,-23.8"
83+
android:strokeLineJoin="round"
84+
android:strokeWidth="5"
85+
android:fillColor="#00000000"
86+
android:strokeColor="#aaa"
87+
android:strokeLineCap="round"/>
88+
<path
89+
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"
90+
android:fillColor="#fff"
91+
android:fillType="evenOdd"/>
92+
<path
93+
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"
94+
android:fillColor="#e9a76f"/>
95+
<path
96+
android:fillColor="#FF000000"
97+
android:pathData="M-528,29.5v26.5c-5.4,0 -9.8,-4.4 -9.8,-9.8l9.7,-16.7h0.1Z"
98+
android:fillAlpha="0.2"/>
99+
<path
100+
android:fillColor="#FF000000"
101+
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"
102+
android:fillAlpha="0.2"/>
103+
<path
104+
android:pathData="M-535,87.5h92V27.5h-92v60Z"
105+
android:fillColor="#cb9781"/>
106+
<path
107+
android:pathData="M-525,61.5h48v18h-48z"
108+
android:fillColor="#a4c1ee"/>
109+
<path
110+
android:pathData="M-469,61.5h13v26h-13z"
111+
android:fillColor="#a4c1ee"/>
112+
<path
113+
android:pathData="M-525,61.5h48v6h-48z"
114+
android:fillColor="#859dbf"/>
115+
<path
116+
android:pathData="M-469,61.5h13v6h-13z"
117+
android:fillColor="#859dbf"/>
118+
<path
119+
android:pathData="M-527,15.5h76v12h-76z"
120+
android:fillColor="#d6bdb1"/>
121+
<path
122+
android:pathData="M-538.1,42.2l8.1,-14.7h82l8.3,14.7h-98.4Z"
123+
android:fillColor="#c84747"/>
124+
<path
125+
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"
126+
android:fillColor="#9a2e2e"/>
127+
<path
128+
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"
129+
android:fillColor="#c8c8c8"/>
130+
<path
131+
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"
132+
android:fillColor="#9a2e2e"/>
133+
<path
134+
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"
135+
android:fillColor="#c8c8c8"/>
136+
<path
137+
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"
138+
android:fillColor="#9a2e2e"/>
139+
<path
140+
android:pathData="M-518.4,42.2l4.4,-14.7h17l-1.7,14.7h-19.7Z"
141+
android:fillColor="#fff"/>
142+
<path
143+
android:pathData="M-479.1,42.2l-1.9,-14.7h17l4.6,14.7s-19.7,0 -19.7,0Z"
144+
android:fillColor="#fff"/>
145+
<path
146+
android:fillColor="#FF000000"
147+
android:pathData="M-535,87.5h92v4h-92z"
148+
android:fillAlpha="0.2"/>
149+
<path
150+
android:fillColor="#FF000000"
151+
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"
152+
android:fillAlpha="0.2"/>
153+
<path
154+
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"
155+
android:fillColor="#ddd"/>
156+
<path
157+
android:pathData="M-524.5,91.8l22.5,-23.8 22.5,23.8"
158+
android:strokeLineJoin="round"
159+
android:strokeWidth="5"
160+
android:fillColor="#00000000"
161+
android:strokeColor="#aaa"
162+
android:strokeLineCap="round"/>
163+
<path
164+
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"
165+
android:fillColor="#e9e9e9"
166+
android:fillType="evenOdd"/>
167+
<path
168+
android:pathData="M-524.5,59.3l22.5,23.8 22.5,-23.8"
169+
android:strokeLineJoin="round"
170+
android:strokeWidth="5"
171+
android:fillColor="#00000000"
172+
android:strokeColor="#aaa"
173+
android:strokeLineCap="round"/>
174+
<path
175+
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"
176+
android:fillColor="#fff"
177+
android:fillType="evenOdd"/>
178+
</vector>

app/src/main/res/values/strings_ee.xml

+6
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,12 @@
677677
<string name="quest_lampType_mercury">Mercury-vapor lamp</string>
678678
<string name="quest_lampType_halogen">Halogen lamp</string>
679679

680+
<!-- post office -->
681+
<string name="quest_postOffice_title">What type is this post office?</string>
682+
<string name="quest_postOffice_bureau">Full (official) post office</string>
683+
<string name="quest_postOffice_postAnnex">Post office (privatly owned, perhaps with restricted service)</string>
684+
<string name="quest_postOffice_postPartner">Post relay point in shops or amenities (as a service)</string>
685+
680686
<!-- new overlays -->
681687

682688
<!-- custom overlay -->

res/graphics/authors.txt

+1
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ quest/
372372
pitch_lantern.svg
373373
pitch_surface.svg
374374
playground.svg
375+
post_office.svg modified by mcliquid based on mail.svg and shop.svg
375376
power.svg
376377
quest.svg
377378
railway.svg

res/graphics/quest/post_office.svg

+59
Loading

0 commit comments

Comments
 (0)