)
}
- @State private var selectedEvolution = StageType.general
-
var body: some View {
if map.uuid != nil {
VSplitView {
Image(systemName: "photo")
}.padding(.vertical, 4.0).padding(.leading, 4.0).padding(.trailing, 8.0)
}
- Picker("Evolution", selection: $selectedEvolution) {
- ForEach(StageType.allCases) { stage in
- Text(Stage.title(stage)).tag(stage).padding(4.0)
- }
- }.padding(.horizontal, 8.0).padding(.vertical, 4.0)
+ EvolutionPicker()
ZStack(alignment: .topLeading) {
- MapTextEditor(text: content).onChange(of: map.content) { _ in
+ MapTextEditor(text: content, colorScheme: colorScheme).onChange(of: map.content) { _ in
try? viewContext.save()
}
.background(mapColor.background)
5.0)
}.padding(.horizontal, 8.0)
ScrollView([.horizontal, .vertical]) {
- MapRenderView(map: map, evolution: Stage.stages(selectedEvolution))
+ MapRenderView(
+ content: content.wrappedValue, evolution: Stage.stages(store.state.selectedEvolution))
}.background(mapColor.background)
}
} else {
}
private func saveImage() {
- store.send(.exportMapAsImage(map: map, evolution: selectedEvolution))
+ store.send(.exportMapAsImage(map: map))
}
}