diff --git a/Demo/SKTiledDemoScene.swift b/Demo/SKTiledDemoScene.swift
index 1cc6d9e9..0727c107 100644
--- a/Demo/SKTiledDemoScene.swift
+++ b/Demo/SKTiledDemoScene.swift
@@ -104,11 +104,11 @@ public class SKTiledDemoScene: SKTiledScene {
var result: [SKNode] = []
let nodes = self.nodes(at: point)
for node in nodes {
- if let tile = node as? SKTile {
+ if node is SKTile {
result.append(node)
}
- if let object = node as? SKTileObject {
+ if node is SKTileObject {
result.append(node)
}
}
@@ -183,34 +183,17 @@ public class SKTiledDemoScene: SKTiledScene {
switch fileNamed {
case "dungeon-16x16.tmx":
-
if let upperGraphLayer = tilemap.tileLayers(named: "Graph-Upper").first {
- upperGraphLayer.initializeGraph(walkable: walkableTiles)
+ _ = upperGraphLayer.initializeGraph(walkable: walkableTiles)
}
if let lowerGraphLayer = tilemap.tileLayers(named: "Graph-Lower").first {
- lowerGraphLayer.initializeGraph(walkable: walkableTiles)
- }
-
- let lowerGraph = graphs["Graph-Lower"]!
- let upperGraph = graphs["Graph-Upper"]!
-
- let lowerBridge = lowerGraph.node(atGridPosition: int2(17, 8))!
- let upperBridge = upperGraph.node(atGridPosition: int2(17, 7))!
-
- lowerBridge.addConnections(to: [upperBridge], bidirectional: true)
-
-
- case "mountains-hex-65x65.tmx":
- let tileset = tilemap.getTileset(named: "hex1-65x65-65x230")!
- let grassTiles = tilemap.getTiles(globalID: 1)
- for tile in grassTiles {
- tile.alpha = 0.2
+ _ = lowerGraphLayer.initializeGraph(walkable: walkableTiles)
}
case "graphtest-8x8.tmx":
if let graphLayer = tilemap.tileLayers(named: "Graph").first {
- graphLayer.initializeGraph(walkable: walkableTiles)
+ _ = graphLayer.initializeGraph(walkable: walkableTiles)
}
case "pacman.tmx":
@@ -325,11 +308,10 @@ public class SKTiledDemoScene: SKTiledScene {
let startPoint = graphCoordinates.first!.toVec2
let endPoint = graphCoordinates[1].toVec2
- for (graphKey, graph) in graphs {
+ for (_, graph) in graphs {
if let startNode = graph.node(atGridPosition: startPoint) {
if let endNode = graph.node(atGridPosition: endPoint) {
currentPath = startNode.findPath(to: endNode) as! [GKGridGraphNode]
-
}
}
}
@@ -497,18 +479,13 @@ extension SKTiledDemoScene {
cameraNode.mouseDown(with: event)
let defaultLayer = tilemap.defaultLayer
- // get the position relative as drawn by the
- let positionInScene = event.location(in: self)
- let positionInLayer = defaultLayer.mouseLocation(event: event)
let coord = defaultLayer.coordinateAtMouseEvent(event: event)
-
- let tileShapesUnderCursor = nodes(at: positionInScene).filter { $0 as? TileShape != nil } as! [TileShape]
+ let tileShapesUnderCursor = tileShapesAt(event: event)
for tile in tileShapesUnderCursor where tile.role == .coordinate {
tile.interactions += 1
}
-
if (liveMode == true) && (isPaused == false) {
if (event.clickCount > 1) {
@@ -565,7 +542,7 @@ extension SKTiledDemoScene {
if let view = view {
let viewSize = view.bounds.size
- var positionInWindow = event.locationInWindow
+ let positionInWindow = event.locationInWindow
let xpos = positionInWindow.x
let ypos = positionInWindow.y
@@ -632,7 +609,7 @@ extension SKTiledDemoScene {
if (tileShapesUnderCursor.isEmpty) {
if (liveMode == true) && (isPaused == false) {
- let tile = self.addTileToWorld(Int(coord.x), Int(coord.y), role: .highlight)
+ _ = self.addTileToWorld(Int(coord.x), Int(coord.y), role: .highlight)
}
}
@@ -758,7 +735,7 @@ internal class MouseTracker: SKNode {
}
func setOffset(dx: CGFloat, dy: CGFloat) {
- var vector = (1 / -dy) * (fabs(dy) * 2)
+ let vector = (1 / -dy) * (fabs(dy) * 2)
label.position.y = vector * (scaleSize * 2)
}
@@ -865,7 +842,7 @@ extension SKTiledDemoScene {
guard let view = view,
let cameraNode = cameraNode,
let tilemap = tilemap,
- let worldNode = worldNode else {
+ let _ = worldNode else {
return
}
diff --git a/README.md b/README.md
index 627c52b2..44239c30 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,7 @@
**SKTiled** is a Swift framework for using [Tiled](http://www.mapeditor.org) content with [Apple's SpriteKit][spritekit-url], allowing the creation of game assets from Tiled's .tmx files. Inspired by [TilemapKit](http://tilemapkit.com) and written purely in Swift, I began working on this after the development of TilemapKit was halted, primarily to learn Apple's new programming language. I've decided to open-source it in case others find it helpful.
+
Current release is Swift 3/macOS 10.11/iOS 10+. For Swift 4/Xcode 9, see the [**swift4**][swift4-url] branch.
@@ -42,7 +43,7 @@ Check out the [Official Documentation](https://mfessenden.github.io/SKTiled).
## Requirements
- iOS 9+
-- macOS 10.12+
+- macOS 10.11+
- Xcode 8+
## Installation
diff --git a/SKTiled.xcodeproj/project.pbxproj b/SKTiled.xcodeproj/project.pbxproj
index b07bb4b4..8729a050 100644
--- a/SKTiled.xcodeproj/project.pbxproj
+++ b/SKTiled.xcodeproj/project.pbxproj
@@ -717,9 +717,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 4C1774911D909740000C0AFD /* Build configuration list for PBXNativeTarget "Demo - macOS" */;
buildPhases = (
- 4CA4006B1F4721ED0032CD21 /* Run Swiftlint */,
4CABC4D71DAEE1F900ACA1A4 /* Run xattr */,
- 4C4184A71F34D57B004E392A /* Todo Tags */,
4C17747B1D909740000C0AFD /* Sources */,
4C17747C1D909740000C0AFD /* Frameworks */,
4C17747D1D909740000C0AFD /* Resources */,
@@ -737,8 +735,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 4C41A5E71F437118001622FF /* Build configuration list for PBXNativeTarget "SKTiled-macOS" */;
buildPhases = (
- 4CA400691F47214B0032CD21 /* Run Swiftlint */,
- 4C2FCE5E1F437A39004AD742 /* Todo Tags */,
4C41A5DB1F437118001622FF /* Sources */,
4C41A5DC1F437118001622FF /* Frameworks */,
4C41A5DD1F437118001622FF /* Headers */,
@@ -757,8 +753,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 4C41A6021F43739C001622FF /* Build configuration list for PBXNativeTarget "SKTiled-iOS" */;
buildPhases = (
- 4CA4006A1F4721770032CD21 /* Run Swiftlint */,
- 4C2FCE5F1F437A45004AD742 /* Todo Tags */,
4C41A5F81F43739C001622FF /* Sources */,
4C41A5F91F43739C001622FF /* Frameworks */,
4C41A5FA1F43739C001622FF /* Headers */,
@@ -777,9 +771,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 4CBA617B1D8A048300B31FC1 /* Build configuration list for PBXNativeTarget "Demo - iOS" */;
buildPhases = (
- 4CA4006C1F4722040032CD21 /* Run Swiftlint */,
4C3496881EA513D9003900C8 /* Run xattr */,
- 4C4184A81F34D592004E392A /* Todo Tags */,
4CBA61611D8A048200B31FC1 /* Sources */,
4CBA61621D8A048200B31FC1 /* Frameworks */,
4CBA61631D8A048200B31FC1 /* Resources */,
@@ -1056,34 +1048,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 4C2FCE5E1F437A39004AD742 /* Todo Tags */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Todo Tags";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "TAGS=\"TODO:|FIXME:|CLEANUP:\"\necho \"searching ${SRCROOT} for ${TAGS}\"\nfind \"${SRCROOT}\" \\( -name \"*.swift\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($TAGS).*\\$\" | perl -p -e \"s/($TAGS)/ warning: \\$1/\"";
- };
- 4C2FCE5F1F437A45004AD742 /* Todo Tags */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Todo Tags";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "TAGS=\"TODO:|FIXME:|CLEANUP:\"\necho \"searching ${SRCROOT} for ${TAGS}\"\nfind \"${SRCROOT}\" \\( -name \"*.swift\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($TAGS).*\\$\" | perl -p -e \"s/($TAGS)/ warning: \\$1/\"";
- };
4C3496881EA513D9003900C8 /* Run xattr */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -1098,90 +1062,6 @@
shellPath = /bin/sh;
shellScript = "xattr -rc $PROJECT_DIR\n";
};
- 4C4184A71F34D57B004E392A /* Todo Tags */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Todo Tags";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "TAGS=\"TODO:|FIXME:|CLEANUP:\"\necho \"searching ${SRCROOT} for ${TAGS}\"\nfind \"${SRCROOT}\" \\( -name \"*.swift\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($TAGS).*\\$\" | perl -p -e \"s/($TAGS)/ warning: \\$1/\"";
- };
- 4C4184A81F34D592004E392A /* Todo Tags */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Todo Tags";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "TAGS=\"TODO:|FIXME:|CLEANUP:\"\necho \"searching ${SRCROOT} for ${TAGS}\"\nfind \"${SRCROOT}\" \\( -name \"*.swift\" \\) -print0 | xargs -0 egrep --with-filename --line-number --only-matching \"($TAGS).*\\$\" | perl -p -e \"s/($TAGS)/ warning: \\$1/\"";
- };
- 4CA400691F47214B0032CD21 /* Run Swiftlint */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Swiftlint";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
- };
- 4CA4006A1F4721770032CD21 /* Run Swiftlint */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Swiftlint";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
- };
- 4CA4006B1F4721ED0032CD21 /* Run Swiftlint */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Swiftlint";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
- };
- 4CA4006C1F4722040032CD21 /* Run Swiftlint */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Swiftlint";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
- };
4CABC4D71DAEE1F900ACA1A4 /* Run xattr */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_128x128.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_128x128.png
deleted file mode 100644
index fc0fb81f..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_128x128.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_128x128@2x.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_128x128@2x.png
deleted file mode 100644
index d0adbb35..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_128x128@2x.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_16x16.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_16x16.png
deleted file mode 100644
index 00568315..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_16x16.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_16x16@2x.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_16x16@2x.png
deleted file mode 100644
index a1104ea1..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_16x16@2x.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_256x256.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_256x256.png
deleted file mode 100644
index d0adbb35..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_256x256.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_256x256@2x.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_256x256@2x.png
deleted file mode 100644
index 7023b0ff..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_256x256@2x.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_32x32.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_32x32.png
deleted file mode 100644
index a1104ea1..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_32x32.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_32x32@2x.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_32x32@2x.png
deleted file mode 100644
index 52a70077..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_32x32@2x.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_512x512.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_512x512.png
deleted file mode 100644
index 7023b0ff..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_512x512.png and /dev/null differ
diff --git a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_512x512@2x.png b/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_512x512@2x.png
deleted file mode 100644
index 6ae799ac..00000000
Binary files a/Shared/Assets.xcassets/AppIcon.appiconset/icon_mac_512x512@2x.png and /dev/null differ
diff --git a/Sources/SKTileObject.swift b/Sources/SKTileObject.swift
index fa7e0d98..d61fdc58 100644
--- a/Sources/SKTileObject.swift
+++ b/Sources/SKTileObject.swift
@@ -288,7 +288,7 @@ open class SKTileObject: SKShapeNode, SKTiledObject {
*/
required public init(layer: SKObjectGroup) {
super.init()
- layer.addObject(self)
+ _ = layer.addObject(self)
drawObject()
}
diff --git a/Sources/SKTiled+Debug.swift b/Sources/SKTiled+Debug.swift
index b45d17db..0d6199e5 100644
--- a/Sources/SKTiled+Debug.swift
+++ b/Sources/SKTiled+Debug.swift
@@ -512,15 +512,12 @@ public class TileShape: SKShapeNode {
baseColor = SKColor.gray
case 11...200:
baseColor = TiledObjectColors.dandelion
- case 201...FLT_MAX:
+ case 201...Float.greatestFiniteMagnitude:
baseColor = TiledObjectColors.english
default:
baseColor = SKColor.gray
}
-
-
-
baseOpacity = 0.8
self.strokeColor = baseColor.withAlphaComponent(baseOpacity * 2)
self.fillColor = baseColor.withAlphaComponent(baseOpacity * 1.5)
diff --git a/Sources/SKTiled+Extensions.swift b/Sources/SKTiled+Extensions.swift
index 4bacb2b8..4b3ba0a6 100644
--- a/Sources/SKTiled+Extensions.swift
+++ b/Sources/SKTiled+Extensions.swift
@@ -1376,7 +1376,6 @@ internal func drawLayerGraph(_ layer: SKTiledLayerObject,
guard let graph = layer.graph else { return }
- let innerColor = layer.gridColor
// line width should be at least 1 for larger tile sizes
let lineWidth: CGFloat = defaultLineWidth
context.setLineWidth(lineWidth)
@@ -1396,21 +1395,20 @@ internal func drawLayerGraph(_ layer: SKTiledLayerObject,
if let tiledNode = node as? SKTiledGraphNode {
switch tiledNode.weight {
- case (-205)...(-101):
- fillColor = TiledObjectColors.obsidian
- case -100...0:
- fillColor = TiledObjectColors.azure
- case 10...100:
- fillColor = TiledObjectColors.dandelion
- case 101...250:
+ case (-2000)...(-1):
fillColor = TiledObjectColors.lime
- case 251...500:
+ case 0...10:
+ fillColor = SKColor.gray
+ case 11...200:
+ fillColor = TiledObjectColors.tangerine
+ case 201...Float.greatestFiniteMagnitude:
fillColor = TiledObjectColors.english
default:
- break
+ fillColor = SKColor.gray
}
}
+
let screenPosition = layer.tileToScreenCoords(CGPoint(x: col, y: row))
var xpos: CGFloat = screenPosition.x * imageScale
diff --git a/Sources/SKTiledSceneCamera.swift b/Sources/SKTiledSceneCamera.swift
index fc126dc8..603ed89a 100644
--- a/Sources/SKTiledSceneCamera.swift
+++ b/Sources/SKTiledSceneCamera.swift
@@ -381,7 +381,7 @@ public class SKTiledSceneCamera: SKCameraNode, Loggable {
let usableHeight: CGFloat = newSize.height * screenScaleHeight
let scaleFactor = (isPortrait == true) ? usableWidth / tilemapSize.width : usableHeight / tilemapSize.height
- let heightOffset: CGFloat = (usableHeight / 20)
+ //let heightOffset: CGFloat = (usableHeight / 20)
let focusPoint = CGPoint(x: tilemapCenter.x, y: tilemapCenter.y) // -heightOffset
centerOn(scenePoint: focusPoint)
diff --git a/Sources/SKTilemap+Properties.swift b/Sources/SKTilemap+Properties.swift
index e8bf23c7..6341a360 100644
--- a/Sources/SKTilemap+Properties.swift
+++ b/Sources/SKTilemap+Properties.swift
@@ -166,7 +166,7 @@ public extension SKTileset {
if (ignoreProperties == true) { return }
if (self.type == nil) { self.type = properties.removeValue(forKey: "type") }
- for (attr, value) in properties {
+ for (attr, _) in properties {
let lattr = attr.lowercased()
if (lattr == "walkable") {
if (keyValuePair(key: attr) != nil) {
diff --git a/Sources/SKTilemap.swift b/Sources/SKTilemap.swift
index 584f00ee..2375880f 100644
--- a/Sources/SKTilemap.swift
+++ b/Sources/SKTilemap.swift
@@ -1550,13 +1550,6 @@ public class SKTilemap: SKNode, SKTiledObject {
self.layers.forEach { layer in
layer.update(currentTime)
}
-
- let baseLineWidth: CGFloat = 1
- // size of one point
- let pointSize = (1 * SKTiledContentScaleFactor)
- let scaleFactor = 1 / currentZoom
- let actualPointSize = (pointSize * scaleFactor)
- let renderLineWidth = baseLineWidth * actualPointSize
}
}
@@ -1814,7 +1807,6 @@ extension SKTilemap {
// get the max column size for each column
for (_, stats) in allLayerStats.enumerated() {
- let columns = stats.map { $0.characters.count }
for stat in stats {
let cindex = Int(stats.index(of: stat)!)
@@ -1848,7 +1840,7 @@ extension SKTilemap {
let columnSize = columnSizes[sidx]
let buffer = buffers[sidx]
- var isLastColumn = (sidx == stats.count - 1)
+ let isLastColumn = (sidx == stats.count - 1)
var nextValue: String? = nil
let nextIndex = sidx + 1
@@ -2001,7 +1993,7 @@ extension SKTilemap: SKTiledSceneCameraDelegate {
focusObjects = []
for node in nodesUnderCursor {
- if let object = node as? SKTileObject {
+ if node is SKTileObject {
focusObjects.append(node)
}
diff --git a/Sources/SKTileset.swift b/Sources/SKTileset.swift
index 7717c2b5..ccdcb473 100644
--- a/Sources/SKTileset.swift
+++ b/Sources/SKTileset.swift
@@ -224,7 +224,7 @@ public class SKTileset: SKTiledObject {
let image = CGImage(pngDataProviderSource: imageDataProvider, decode: nil, shouldInterpolate: false, intent: .defaultIntent)!
// create the texture
- var sourceTexture = SKTexture(cgImage: image)
+ let sourceTexture = SKTexture(cgImage: image)
sourceTexture.filteringMode = .nearest
let textureWidth = Int(sourceTexture.size().width)
diff --git a/macOS/AppDelegate.swift b/macOS/AppDelegate.swift
index c757e984..f8405e37 100644
--- a/macOS/AppDelegate.swift
+++ b/macOS/AppDelegate.swift
@@ -71,11 +71,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let demoController = gameController.demoController
let currentMapIndex = demoController.currentIndex
demoController.addTilemap(url: relativeURL, at: currentMapIndex)
-
- let newMenuItem = NSMenuItem(title: filename, action: "loadRecentFile", keyEquivalent: "")
- recentFilesSubmenu.addItem(newMenuItem)
- newMenuItem.isEnabled = true
- recentFilesMenu.isEnabled = true
}
} else {
@@ -83,10 +78,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
}
- func loadRecentFile(named: String) {
- print("loading: \"\(named)\"")
- }
-
/**
Action to reload the current scene.
*/
@@ -183,8 +174,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
guard let gameController = viewController else { return }
let demoController = gameController.demoController
demoController.toggleMapGraphVisualization()
- guard let view = gameController.view as? SKView else { return }
- guard let scene = view.scene as? SKTiledDemoScene else { return }
var currentGraphMode = false
if let tilemap = self.tilemap {
diff --git a/macOS/Base.lproj/Main.storyboard b/macOS/Base.lproj/Main.storyboard
index 629fd66e..adb756ea 100644
--- a/macOS/Base.lproj/Main.storyboard
+++ b/macOS/Base.lproj/Main.storyboard
@@ -90,7 +90,7 @@
-