-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct DocumentFocusedValueKey: FocusedValueKey {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
import UniformTypeIdentifiers
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
struct Stage {
let i: String
let ii: String
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
struct Constants {
static let kMaxZoom = 2.0
static let kMinZoom = 0.1
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
class Debouncer {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import CoreGraphics
import Foundation
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct BlockerParserStrategy: MapParserStrategy {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct EdgeParserStrategy: MapParserStrategy {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct GroupParserStrategy: MapParserStrategy {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct NoteParserStrategy: MapParserStrategy {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct OpportunityParserStrategy: MapParserStrategy {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct StageParserStrategy: MapParserStrategy {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct VertexParserStrategy: MapParserStrategy {
-import Sparkle
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
+import Sparkle
import SwiftUI
@main
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct EvolutionPicker: View {
var body: some View {
Picker("Evolution", selection: $selectedEvolution) {
ForEach(StageType.types) { stage in
- Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0)
+ Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0)
}
Divider()
ForEach(StageType.characteristics) { stage in
- Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0).font(.theme.body)
+ Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0).font(.Theme.body)
}
Divider()
ForEach(StageType.properties) { stage in
- Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0)
+ Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0)
}
Divider()
ForEach(StageType.custom) { stage in
- Text(Stage.title(stage)).font(.theme.body).tag(stage).padding(4.0)
+ Text(Stage.title(stage)).font(.Theme.body).tag(stage).padding(4.0)
}
- }.font(.theme.body).padding(.horizontal, 8.0).padding(.vertical, 4.0)
+ }.font(.Theme.body).padding(.horizontal, 8.0).padding(.vertical, 4.0)
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapAxes: View {
path.addLine(to: CGPoint(x: mapSize.width, y: mapSize.height))
path.move(to: CGPoint(x: mapSize.width, y: mapSize.height))
path.closeSubpath()
- }.stroke(Color.map.axisColor, lineWidth: lineWidth * 2)
+ }.stroke(Color.Map.axisColor, lineWidth: lineWidth * 2)
// Y Labels
- Text("Visible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect(
+ Text("Visible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect(
Angle(degrees: -90.0)
)
.offset(CGSize(width: -35.0, height: 0.0))
- Text("Invisible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect(
+ Text("Invisible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect(
Angle(degrees: -90.0)
)
.offset(CGSize(width: -40.0, height: mapSize.height - 20))
// X Labels
Text("Uncharted")
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading)
.offset(CGSize(width: 0.0, height: -stageHeight / 4.0))
Text("Industrialised")
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading)
.offset(CGSize(width: mapSize.width - 100.0, height: -stageHeight / 4.0))
Text(evolution.i)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: w(stages[0]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: 0.0, height: mapSize.height + padding))
Text(evolution.ii)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: w(stages[1]) - w(stages[0]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: w(stages[0]), height: mapSize.height + padding))
Text(evolution.iii)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: w(stages[2]) - w(stages[1]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: w(stages[1]), height: mapSize.height + padding))
Text(evolution.iv)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: mapSize.width - w(stages[2]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: w(stages[2]), height: mapSize.height + padding))
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapBlockers: View {
y: h(vertex.position.y) - vertexSize.height * 2 / 3),
size: CGSize(width: vertexSize.width / 2, height: vertexSize.height * 2)
), cornerSize: cornerSize)
- }.fill(Color.map.blockerColor)
+ }.fill(Color.Map.blockerColor)
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapEdges: View {
path.closeSubpath()
}.applying(
CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0)
- ).stroke(Color.map.vertexColor, lineWidth: lineWidth)
+ ).stroke(Color.Map.vertexColor, lineWidth: lineWidth)
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import ConcaveHull
import SwiftUI
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import ConcaveHull
import SwiftUI
}
private func color(_ index: Int) -> Color {
- return .map.groupColors[index % Color.map.groupColors.count]
+ return .Map.groupColors[index % Color.Map.groupColors.count]
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapNotes: View {
var body: some View {
ForEach(notes, id: \.id) { note in
- Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.note)
+ Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.note)
.padding(2.0)
.background(.white)
- .foregroundColor(.map.labelColor)
- .border(Color.map.vertexColor, width: lineWidth)
+ .foregroundColor(.Map.labelColor)
+ .border(Color.Map.vertexColor, width: lineWidth)
.frame(minWidth: 16.0, maxWidth: maxWidth, alignment: .topLeading)
.offset(
CGSize(
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapOpportunities: View {
}.applying(
CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0)
).strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0])).stroke(
- Color.map.opportunityColor)
+ Color.Map.opportunityColor)
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Patterns
import SwiftUI
var body: some View {
ZStack(alignment: .topLeading) {
PatternView(
- design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.frame(width: w(stages[0]), height: mapSize.height)
PatternView(
- design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.offset(CGSize(width: w(stages[0]), height: 0))
.frame(width: w(stages[1]) - w(stages[0]), height: mapSize.height)
PatternView(
- design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.offset(CGSize(width: w(stages[1]), height: 0))
.frame(width: w(stages[2]) - w(stages[1]), height: mapSize.height)
PatternView(
- design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.offset(CGSize(width: w(stages[2]), height: 0))
.frame(width: mapSize.width - w(stages[2]), height: mapSize.height)
path.move(to: CGPoint(x: w(stages[0]), y: 0))
path.closeSubpath()
}.strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0, 18.0])).stroke(
- Color.map.axisColor)
+ Color.Map.axisColor)
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapVertices: View {
ZStack(alignment: .topLeading) {
ForEach(vertices, id: \.id) { vertex in
ZStack(alignment: .topLeading) {
- getVertexShape(vertex).fill(Color.map.vertexColor)
- Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.vertexLabel)
- .foregroundColor(.map.labelColor)
+ getVertexShape(vertex).fill(Color.Map.vertexColor)
+ Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.vertexLabel)
+ .foregroundColor(.Map.labelColor)
.shadow(color: .white, radius: 0, x: -0.5, y: -0.5)
.shadow(color: .white, radius: 0, x: 0.5, y: 0.5)
.offset(
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Cocoa
import SwiftUI
scrollView.translatesAutoresizingMaskIntoConstraints = false
- textView.backgroundColor = .ui.background
+ textView.backgroundColor = .UI.background
textView.allowsUndo = true
textView.delegate = self
textView.textStorage?.delegate = self
for range in highlightRanges {
let nsRange = NSRange(range, in: textStorage.string)
- textStorage.addAttribute(.backgroundColor, value: NSColor.syntax.match, range: nsRange)
+ textStorage.addAttribute(.backgroundColor, value: NSColor.Syntax.match, range: nsRange)
}
textView.needsDisplay = true
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.number], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.option], range: match.range(at: 4))
+ [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 4))
}
matches = edgeRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 1))
let arrowRange = match.range(at: 2)
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.symbol],
+ [.foregroundColor: NSColor.Syntax.symbol],
range: NSMakeRange(arrowRange.lowerBound - 1, arrowRange.length + 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 3))
}
matches = opportunityRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.symbol], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Syntax.symbol], range: match.range(at: 3))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.number], range: match.range(at: 4))
+ [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 4))
}
matches = blockerRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2))
}
matches = noteRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.number], range: match.range(at: 3))
+ [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 3))
}
matches = stageRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.number], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Syntax.number], range: match.range(at: 2))
}
matches = groupRegex.matches(in: textStorage.string, options: [], range: range)
for match in matches {
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.option], range: match.range(at: 1))
+ [.foregroundColor: NSColor.Syntax.option], range: match.range(at: 1))
textStorage.addAttributes(
- [.foregroundColor: NSColor.syntax.vertex], range: match.range(at: 2))
+ [.foregroundColor: NSColor.Syntax.vertex], range: match.range(at: 2))
}
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct SearchBar: View {
Spacer()
Button(action: onPrevious) {
Image(systemName: "chevron.left")
- .font(.theme.smallControl)
+ .font(.Theme.smallControl)
}.keyboardShortcut(
"g", modifiers: EventModifiers([.command, .shift])
).help("Find Previous (⇧⌘G)")
Button(action: onNext) {
Image(systemName: "chevron.right")
- .font(.theme.smallControl)
+ .font(.Theme.smallControl)
}.keyboardShortcut(
"g", modifiers: EventModifiers([.command])
).help("Find Next (⌘G)")
Button(action: onDismiss) {
Text("Done")
- .font(.theme.smallControl)
+ .font(.Theme.smallControl)
}.keyboardShortcut(.escape, modifiers: EventModifiers())
.help("Done (⎋)")
}.padding(4.0)
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapCommands: Commands {
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Sparkle
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
import SwiftUI
struct UpdateCommands: Commands {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Combine
import CoreData
import CoreGraphics
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// Copyright (C) 2024 Rubén Beltrán del Río
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapEditor: View {
adaptiveStack {
ZStack(alignment: .topLeading) {
MapTextEditor(document: $document, highlightRanges: results, selectedRange: selectedTerm)
- .background(Color.ui.background)
- .foregroundColor(Color.ui.foreground)
+ .background(Color.UI.background)
+ .foregroundColor(Color.UI.foreground)
.frame(minHeight: 96.0)
- }.padding(.top, 8.0).padding(.leading, 8.0).background(Color.ui.background).cornerRadius(
+ }.padding(.top, 8.0).padding(.leading, 8.0).background(Color.UI.background).cornerRadius(
5.0)
GeometryReader { geometry in
ScrollView([.horizontal, .vertical]) {
).scaleEffect(zoom, anchor: .center).frame(
width: (Dimensions.mapSize.width + 2 * Dimensions.mapPadding) * zoom,
height: (Dimensions.mapSize.height + 2 * Dimensions.mapPadding) * zoom)
- }.background(Color.ui.background)
+ }.background(Color.UI.background)
.gesture(
MagnificationGesture()
.onChanged { value in
value: $zoom, in: zoomRange, step: 0.1,
label: {
Text(formatZoom(zoom))
- .font(.theme.smallControl)
+ .font(.Theme.smallControl)
},
minimumValueLabel: {
Image(systemName: "minus.magnifyingglass")
- .font(.theme.smallControl)
+ .font(.Theme.smallControl)
.help("Zoom Out (⌘-)")
},
maximumValueLabel: {
Image(systemName: "plus.magnifyingglass")
- .font(.theme.smallControl)
+ .font(.Theme.smallControl)
.help("Zoom In (⌘+)")
}
).frame(width: 200).padding(.trailing, 10.0)
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
extension Color {
- struct theme {
+ struct Theme {
static let darkSlate = Color("Dark Slate")
static let jasperRed = Color("Jasper Red")
static let olympicBlue = Color("Olympic Blue")
static let darkerNeutralGray = Color("Darker Neutral Gray")
}
- struct map {
- static let labelColor = Color.theme.darkSlate
- static let axisColor = Color.theme.darkSlate
- static let vertexColor = Color.theme.darkSlate
- static let blockerColor = Color.theme.jasperRed
- static let opportunityColor = Color.theme.olympicBlue
- static let stageForeground = Color.theme.lightNeutralGray
+ struct Map {
+ static let labelColor = Color.Theme.darkSlate
+ static let axisColor = Color.Theme.darkSlate
+ static let vertexColor = Color.Theme.darkSlate
+ static let blockerColor = Color.Theme.jasperRed
+ static let opportunityColor = Color.Theme.olympicBlue
+ static let stageForeground = Color.Theme.lightNeutralGray
static let stageBackground = Color.white
static let groupColors = [
- Color.theme.olympicBlue,
- Color.theme.jasperRed,
- Color.theme.lightPorcelainGreen,
- Color.theme.naplesYellow,
- Color.theme.hermosaPink,
+ Color.Theme.olympicBlue,
+ Color.Theme.jasperRed,
+ Color.Theme.lightPorcelainGreen,
+ Color.Theme.naplesYellow,
+ Color.Theme.hermosaPink,
]
}
- struct ui {
+ struct UI {
static let foreground = Color("Foreground")
static let background = Color("Background")
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Foundation
struct Dimensions {
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
extension Font {
- public struct theme {
+ public struct Theme {
// Map
static let note = Font.system(size: 12, design: .serif)
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import AppKit
extension NSColor {
- struct syntax {
+ struct Syntax {
static let vertex = NSColor(named: "Vertex") ?? .textColor
static let number = NSColor(named: "Number") ?? .textColor
static let option = NSColor(named: "Option") ?? .textColor
0.3)
}
- struct ui {
+ struct UI {
static let background = NSColor(named: "Background") ?? .windowBackgroundColor
}
}
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
enum ViewStyle: String {
case vertical, horizontal
}