Skip to content

Commit d939a39

Browse files
committed
Trim "from" room
1 parent 8bfd913 commit d939a39

File tree

9 files changed

+53
-23
lines changed

9 files changed

+53
-23
lines changed

app/src/Outlander.xcodeproj/project.pbxproj

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@
902902
isa = PBXProject;
903903
attributes = {
904904
LastSwiftUpdateCheck = 1100;
905-
LastUpgradeCheck = 1230;
905+
LastUpgradeCheck = 1400;
906906
ORGANIZATIONNAME = "Joe McBride";
907907
TargetAttributes = {
908908
F9BCF2E922E177E100C7F7F0 = {
@@ -1320,6 +1320,7 @@
13201320
CLANG_WARN_UNREACHABLE_CODE = YES;
13211321
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
13221322
COPY_PHASE_STRIP = NO;
1323+
DEAD_CODE_STRIPPING = YES;
13231324
DEBUG_INFORMATION_FORMAT = dwarf;
13241325
ENABLE_STRICT_OBJC_MSGSEND = YES;
13251326
ENABLE_TESTABILITY = YES;
@@ -1339,7 +1340,7 @@
13391340
GCC_WARN_UNUSED_FUNCTION = YES;
13401341
GCC_WARN_UNUSED_VARIABLE = YES;
13411342
HEADER_SEARCH_PATHS = "";
1342-
MACOSX_DEPLOYMENT_TARGET = 10.14;
1343+
MACOSX_DEPLOYMENT_TARGET = 10.15;
13431344
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
13441345
MTL_FAST_MATH = YES;
13451346
ONLY_ACTIVE_ARCH = YES;
@@ -1385,6 +1386,7 @@
13851386
CLANG_WARN_UNREACHABLE_CODE = YES;
13861387
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
13871388
COPY_PHASE_STRIP = NO;
1389+
DEAD_CODE_STRIPPING = YES;
13881390
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
13891391
ENABLE_NS_ASSERTIONS = NO;
13901392
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -1399,7 +1401,7 @@
13991401
GCC_WARN_UNUSED_FUNCTION = YES;
14001402
GCC_WARN_UNUSED_VARIABLE = YES;
14011403
HEADER_SEARCH_PATHS = "";
1402-
MACOSX_DEPLOYMENT_TARGET = 10.14;
1404+
MACOSX_DEPLOYMENT_TARGET = 10.15;
14031405
MTL_ENABLE_DEBUG_INFO = NO;
14041406
MTL_FAST_MATH = YES;
14051407
OTHER_CODE_SIGN_FLAGS = "";
@@ -1420,7 +1422,8 @@
14201422
CODE_SIGN_IDENTITY = "Apple Development";
14211423
CODE_SIGN_STYLE = Automatic;
14221424
COMBINE_HIDPI_IMAGES = YES;
1423-
CURRENT_PROJECT_VERSION = 41;
1425+
CURRENT_PROJECT_VERSION = 42;
1426+
DEAD_CODE_STRIPPING = YES;
14241427
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
14251428
DEVELOPMENT_TEAM = 9TZ225FMST;
14261429
ENABLE_HARDENED_RUNTIME = YES;
@@ -1431,6 +1434,7 @@
14311434
"$(inherited)",
14321435
"@executable_path/../Frameworks",
14331436
);
1437+
MACOSX_DEPLOYMENT_TARGET = 10.15;
14341438
MARKETING_VERSION = 2.0;
14351439
OTHER_LDFLAGS = "";
14361440
PRODUCT_BUNDLE_IDENTIFIER = com.OutlanderApp;
@@ -1452,7 +1456,8 @@
14521456
CODE_SIGN_IDENTITY = "Apple Development";
14531457
CODE_SIGN_STYLE = Automatic;
14541458
COMBINE_HIDPI_IMAGES = YES;
1455-
CURRENT_PROJECT_VERSION = 41;
1459+
CURRENT_PROJECT_VERSION = 42;
1460+
DEAD_CODE_STRIPPING = YES;
14561461
DEVELOPMENT_TEAM = 9TZ225FMST;
14571462
ENABLE_HARDENED_RUNTIME = YES;
14581463
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@@ -1462,6 +1467,7 @@
14621467
"$(inherited)",
14631468
"@executable_path/../Frameworks",
14641469
);
1470+
MACOSX_DEPLOYMENT_TARGET = 10.15;
14651471
MARKETING_VERSION = 2.0;
14661472
OTHER_LDFLAGS = "";
14671473
PRODUCT_BUNDLE_IDENTIFIER = com.OutlanderApp;
@@ -1482,6 +1488,7 @@
14821488
CODE_SIGN_IDENTITY = "Apple Development";
14831489
CODE_SIGN_STYLE = Automatic;
14841490
COMBINE_HIDPI_IMAGES = YES;
1491+
DEAD_CODE_STRIPPING = YES;
14851492
DEVELOPMENT_TEAM = 9TZ225FMST;
14861493
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
14871494
INFOPLIST_FILE = OutlanderTests/Info.plist;
@@ -1509,6 +1516,7 @@
15091516
CODE_SIGN_IDENTITY = "Apple Development";
15101517
CODE_SIGN_STYLE = Automatic;
15111518
COMBINE_HIDPI_IMAGES = YES;
1519+
DEAD_CODE_STRIPPING = YES;
15121520
DEVELOPMENT_TEAM = 9TZ225FMST;
15131521
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
15141522
INFOPLIST_FILE = OutlanderTests/Info.plist;

app/src/Outlander.xcodeproj/xcshareddata/xcschemes/Outlander.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1230"
3+
LastUpgradeVersion = "1400"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

app/src/Outlander.xcodeproj/xcshareddata/xcschemes/OutlanderTests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1230"
3+
LastUpgradeVersion = "1400"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

app/src/Outlander/Handlers/GotoCommandHandler.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class GotoComandHandler: ICommandHandler {
2626

2727
DispatchQueue.global(qos: .userInteractive).async {
2828
if area.count > 1 {
29-
self.gotoArea(area: area[0], from: area[1], context: context)
29+
self.gotoArea(area: area[0].trimmingCharacters(in: .whitespaces), from: area[1].trimmingCharacters(in: .whitespaces), context: context)
3030
} else if area.count > 0 {
31-
self.gotoArea(area: area[0], context: context)
31+
self.gotoArea(area: area[0].trimmingCharacters(in: .whitespaces), context: context)
3232
}
3333
}
3434
}

app/src/Outlander/Infrastructure/Logger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class PrintLogger: ILogger {
7575
}
7676

7777
private func log(_ data: String, level: String) {
78-
print("\(level): \(data)")
78+
print("\(name)-\(level): \(data)")
7979
}
8080
}
8181

app/src/Outlander/Maps/MapZone.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ final class MapZone {
8484
return nil
8585
}
8686

87-
return roomIdLookup[id]
87+
return roomIdLookup[id.trimmingCharacters(in: .whitespacesAndNewlines)]
8888
}
8989

9090
func rooms(note: String) -> [MapNode] {

app/src/Outlander/Scripting/Script.swift

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ class Script {
307307
}
308308

309309
func queueNext() {
310+
self.log.info("script queue next")
310311
scriptQueue.queue(.next)
311312
next()
312313
}
@@ -322,6 +323,7 @@ class Script {
322323
guard !inLoop, !stopped else { return }
323324

324325
if paused {
326+
self.log.info("script nextAfterUnpause 1")
325327
nextAfterUnpause = true
326328
return
327329
}
@@ -338,6 +340,7 @@ class Script {
338340
}
339341
inLoop = false
340342
if paused {
343+
self.log.info("script nextAfterUnpause 2")
341344
nextAfterUnpause = true
342345
}
343346
}
@@ -425,23 +428,29 @@ class Script {
425428
}
426429

427430
func pause() {
428-
paused = true
429-
sendText("[Pausing '\(fileName)']")
431+
lockQueue.async {
432+
self.paused = true
433+
self.log.info("script pause")
434+
self.sendText("[Pausing '\(self.fileName)']")
435+
}
430436
}
431437

432438
func resume() {
433-
if !paused {
434-
return
435-
}
439+
lockQueue.async {
440+
self.log.info("script resume paused=\(self.paused) nextAfterUnpause=\(self.nextAfterUnpause)")
441+
if !self.paused {
442+
return
443+
}
436444

437-
sendText("[Resuming '\(fileName)']")
445+
self.sendText("[Resuming '\(self.fileName)']")
438446

439-
scriptQueue.clear()
447+
self.scriptQueue.clear()
440448

441-
paused = false
449+
self.paused = false
442450

443-
if nextAfterUnpause {
444-
queueNext()
451+
if self.nextAfterUnpause {
452+
self.queueNext()
453+
}
445454
}
446455
}
447456

app/src/Outlander/UI/GameViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class GameViewController: NSViewController, NSWindowDelegate {
105105
roundtime = RoundtimeTimer(gameContext, variable: "roundtime")
106106
roundtime?.interval = { [weak self] value in
107107
DispatchQueue.main.async {
108-
self?.log.info("RT: \(value.value) / \(value.percent)")
108+
// self?.log.info("RT: \(value.value) / \(value.percent)")
109109
self?.statusBarController?.roundtime = value.value
110110
self?.commandInput.progress = value.percent
111111
}
@@ -114,7 +114,7 @@ class GameViewController: NSViewController, NSWindowDelegate {
114114
spelltime = SpellTimer(gameContext, variable: "spelltime", initialPercent: 0.0)
115115
spelltime?.interval = { [weak self] value in
116116
DispatchQueue.main.async {
117-
self?.log.info("Spell RT: \(value.value) / \(value.percent)")
117+
// self?.log.info("Spell RT: \(value.value) / \(value.percent)")
118118
var spell = "\(value.value)"
119119
if value.percent > 0 {
120120
spell = "(\(Int(value.percent.rounded(.down)))) \(value.value)"

app/src/OutlanderTests/GameStreamTests.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,4 +568,17 @@ class GameStreamTokenizerTests: XCTestCase {
568568
XCTAssertTrue(token.hasAttr("cmd"))
569569
XCTAssertEqual(token.attr("cmd"), "urchin guide Raven's Point, Town Square")
570570
}
571+
572+
func test_d_tag_stream_2() {
573+
let tokens = reader.read("""
574+
Raven's Point <d cmd="urchin guide Raven's Point, Town Square">Raven's Point, Town Square</d>
575+
""")
576+
577+
XCTAssertEqual(tokens.count, 2)
578+
579+
let token = tokens[1]
580+
XCTAssertEqual(token.name(), "d")
581+
XCTAssertTrue(token.hasAttr("cmd"))
582+
XCTAssertEqual(token.attr("cmd"), "urchin guide Raven's Point, Town Square")
583+
}
571584
}

0 commit comments

Comments
 (0)