UX: small maps now follow the rotation of the main map, fix #2433, add compass indicators to most of the minimaps

This commit is contained in:
Pieter Vander Vennet 2025-08-26 02:48:08 +02:00
parent aed6defa16
commit 376ed60e6e
15 changed files with 71 additions and 33 deletions

View file

@ -87,6 +87,8 @@ export class Stores {
})
return newStore
}
}
export abstract class Store<T> implements Readable<T> {
@ -347,6 +349,16 @@ export abstract class Store<T> implements Readable<T> {
}
})
}
/**
* Create a new UIEVentSource. Whenever 'this.data' changes, the returned UIEventSource will get this value as well.
* However, this value can be overridden without affecting source
*/
public followingClone(): UIEventSource<T> {
const src = new UIEventSource(this.data)
this.addCallback((t) => src.setData(t))
return src
}
}
export class ImmutableStore<T> extends Store<T> {
@ -814,17 +826,6 @@ export class UIEventSource<T> extends Store<T> implements Writable<T> {
(b) => JSON.stringify(b) ?? ""
)
}
/**
* Create a new UIEVentSource. Whenever 'source' changes, the returned UIEventSource will get this value as well.
* However, this value can be overriden without affecting source
*/
static feedFrom<T>(store: Store<T>): UIEventSource<T> {
const src = new UIEventSource(store.data)
store.addCallback((t) => src.setData(t))
return src
}
/**
* Adds a callback
*