Add auswählbare Fahrzeuggrafik am Neigungsmesser, neues California-Set
Jedes Grafikset (Seiten-/Heckansicht) ist jetzt ein VehicleGraphicStyle mit eigenem Seitenverhältnis, wählbar in der Neigungsmesser-Einrichtung und angewendet in Fahrzeug-Ansicht und Ausrichtungs-Assistent. Die bisherigen VehicleSide/VehicleRear-Assets heißen jetzt VansterSide/ VansterRear, damit sie eindeutig ihrem Set zuzuordnen sind; California kommt als zweites Set mit eigener Seitenansicht dazu (Heckansicht vorerst von Vanster übernommen). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
97e3d040a9
commit
362a62cd77
Binary file not shown.
|
After Width: | Height: | Size: 341 KiB |
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "CaliforniaSide.png",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : { "author" : "xcode", "version" : 1 },
|
||||
"properties" : { "template-rendering-intent" : "template" }
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "VehicleRear.png",
|
||||
"filename" : "VansterRear.png",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "VehicleSide.png",
|
||||
"filename" : "VansterSide.png",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
@@ -35,7 +35,8 @@ struct AlignmentAssistantView: View {
|
||||
LevelBubble(pitch: state.pitch, roll: state.roll)
|
||||
.frame(maxWidth: 320)
|
||||
case .vehicle:
|
||||
VehicleTiltView(pitch: state.pitch, roll: state.roll)
|
||||
VehicleTiltView(pitch: state.pitch, roll: state.roll,
|
||||
style: device.vehicleGraphicStyle)
|
||||
}
|
||||
|
||||
if !isLive { disconnectedBanner }
|
||||
|
||||
@@ -25,6 +25,8 @@ struct LevelSetupView: View {
|
||||
store.devices.first { $0.id == device.id } ?? device
|
||||
}
|
||||
|
||||
private let graphicColumns = [GridItem(.adaptive(minimum: 76), spacing: 12)]
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
Section {
|
||||
@@ -80,6 +82,44 @@ struct LevelSetupView: View {
|
||||
} footer: {
|
||||
Text(calibrationHint)
|
||||
}
|
||||
|
||||
Section {
|
||||
LazyVGrid(columns: graphicColumns, spacing: 12) {
|
||||
ForEach(VehicleGraphicStyle.allCases) { style in
|
||||
Button {
|
||||
var updated = currentDevice
|
||||
updated.vehicleGraphicStyle = style
|
||||
store.update(updated)
|
||||
} label: {
|
||||
VStack(spacing: 4) {
|
||||
Image(style.sideImageName)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.padding(10)
|
||||
.frame(width: 60, height: 60)
|
||||
.background(currentDevice.vehicleGraphicStyle == style
|
||||
? Color.accentColor.opacity(0.18)
|
||||
: Color.secondary.opacity(0.08),
|
||||
in: .rect(cornerRadius: 12))
|
||||
.foregroundStyle(currentDevice.vehicleGraphicStyle == style
|
||||
? Color.accentColor : Color.primary)
|
||||
Text(style.title)
|
||||
.font(.caption2)
|
||||
.foregroundStyle(currentDevice.vehicleGraphicStyle == style
|
||||
? Color.accentColor : Color.secondary)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel(style.title)
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 4)
|
||||
} header: {
|
||||
Text("Fahrzeuggrafik")
|
||||
} footer: {
|
||||
Text("Wird in der Fahrzeug-Darstellung des Neigungsmessers verwendet. "
|
||||
+ "Weitere Grafiken folgen.")
|
||||
}
|
||||
}
|
||||
.navigationTitle("Neigungsmesser einrichten")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
|
||||
@@ -127,7 +127,8 @@ struct LevelControls: View {
|
||||
LevelBubble(pitch: state.pitch, roll: state.roll)
|
||||
.frame(maxHeight: 220)
|
||||
case .vehicle:
|
||||
VehicleTiltView(pitch: state.pitch, roll: state.roll)
|
||||
VehicleTiltView(pitch: state.pitch, roll: state.roll,
|
||||
style: device.vehicleGraphicStyle)
|
||||
}
|
||||
|
||||
if let instruction = state.instruction {
|
||||
|
||||
@@ -15,22 +15,23 @@ import SwiftUI
|
||||
struct VehicleTiltView: View {
|
||||
let pitch: Double?
|
||||
let roll: Double?
|
||||
var style: VehicleGraphicStyle = .vanster
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 20) {
|
||||
tiltPanel(image: "VehicleSide",
|
||||
tiltPanel(image: style.sideImageName,
|
||||
angle: pitch,
|
||||
title: "Längs",
|
||||
lowerLabel: "Front",
|
||||
upperLabel: "Heck",
|
||||
aspect: VehicleTilt.sideAspect)
|
||||
aspect: style.sideAspect)
|
||||
|
||||
tiltPanel(image: "VehicleRear",
|
||||
tiltPanel(image: style.rearImageName,
|
||||
angle: roll,
|
||||
title: "Quer",
|
||||
lowerLabel: "links",
|
||||
upperLabel: "rechts",
|
||||
aspect: VehicleTilt.rearAspect)
|
||||
aspect: style.rearAspect)
|
||||
|
||||
// Ohne diesen Hinweis nähme man den Bildwinkel für den echten.
|
||||
Text(String(format: "Neigung %.0f-fach überhöht dargestellt – "
|
||||
|
||||
Reference in New Issue
Block a user