Set Elsewhen's here by tapping a city on the globe (#13438)

A city on this machine's zone becomes homeCity, the zone's own city clears
it, and a city on another zone leaves it alone. Ported from omacom/elsewhen#5.

Co-authored-by: Shawn Yeager <shawn@shawnyeager.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-09-27 21:26:00 +02:00
1 parent e7218e36f2
commit 5929a9b80c
5 files changed
+38 -3

No files matched your search

+5 -1
View File
@@ -56,6 +56,7 @@ Item {
signal offsetModeToggleRequested()
// Only real selections: -1 means "no city" here but "home" in the list.
signal citySelected(string label, string zone)
signal cityTapped(string label, string zone)
// ---- data -------------------------------------------------------------
property var land: [] // coastline rings, flat [lon,lat,...]
@@ -96,7 +97,10 @@ Item {
function pickAt(cx, cy) {
var hit = hitAt(cx, cy)
selectAt(hit)
if (hit >= 0) flyTo(allCities[hit][2], allCities[hit][3])
if (hit >= 0) {
flyTo(allCities[hit][2], allCities[hit][3])
cityTapped(allCities[hit][0], allCities[hit][1])
}
return hit
}