Skip to content

Commit

Permalink
add general fee quest
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoniecz committed Oct 9, 2019
1 parent e285f5c commit ffa6388
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import de.westnordost.streetcomplete.quests.building_type.AddBuildingType;
import de.westnordost.streetcomplete.quests.building_underground.AddIsBuildingUnderground;
import de.westnordost.streetcomplete.quests.foot.AddProhibitedForPedestrians;
import de.westnordost.streetcomplete.quests.general_fee.AddGeneralFee;
import de.westnordost.streetcomplete.quests.leaf_detail.AddForestLeafType;
import de.westnordost.streetcomplete.quests.localized_name.AddBusStopName;
import de.westnordost.streetcomplete.quests.bus_stop_shelter.AddBusStopShelter;
Expand Down Expand Up @@ -162,6 +163,7 @@ public class QuestModule
new AddReligionToWaysideShrine(o),
new AddCyclewaySegregation(o),
new MarkCompletedBuildingConstruction(o),
new AddGeneralFee(o),

// ↓ 8. defined in the wiki, but not really used by anyone yet. Just collected for
// the sake of mapping it in case it makes sense later
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package de.westnordost.streetcomplete.quests.general_fee

import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.SimpleOverpassQuestType
import de.westnordost.streetcomplete.data.osm.changes.StringMapChangesBuilder
import de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao
import de.westnordost.streetcomplete.quests.YesNoQuestAnswerFragment

class AddGeneralFee(o: OverpassMapDataDao) : SimpleOverpassQuestType<Boolean>(o) {

override val tagFilters = "nodes, ways, relations with " +
"(tourism=museum or leisure=beach_resort or tourism=gallery) " +
"and access !~ private|no and !fee and name"
override val commitMessage = "Add fee info"
override val icon = R.drawable.ic_quest_money

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

override fun createForm() = YesNoQuestAnswerFragment()

override fun applyAnswerTo(answer: Boolean, changes: StringMapChangesBuilder) {
changes.add("fee", if (answer) "yes" else "no")
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -678,5 +678,6 @@ Otherwise, you can download another keyboard in the app store. Popular keyboards
<string name="quest_split_way_tutorial">Tap on the way to split it at the point(s) where the answer differs. Try to be as precise as possible, you can zoom in as usual.</string>
<string name="quest_split_way_too_imprecise">"Please zoom in further"</string>
<string name="quest_split_way_many_splits_confirmation_description">These are quite a few splits. You can always further split up the way later.</string>
<string name="quest_generalFee_title">Does it cost a fee to enter %s?</string>

</resources>

0 comments on commit ffa6388

Please sign in to comment.