Skip to content

Commit 1ff37c4

Browse files
committed
combine thought text with stream
1 parent aa6228e commit 1ff37c4

File tree

8 files changed

+414
-363
lines changed

8 files changed

+414
-363
lines changed

app/src/Outlander.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
7B5DD3D22DD25686009C1D99 /* LayoutCommandHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B5DD3D02DD25686009C1D99 /* LayoutCommandHandler.swift */; };
8080
7B6820472C8BC856009833B3 /* EmulateTextCommandHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6820462C8BC856009833B3 /* EmulateTextCommandHandler.swift */; };
8181
7B6820482C8BC856009833B3 /* EmulateTextCommandHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B6820462C8BC856009833B3 /* EmulateTextCommandHandler.swift */; };
82+
7B7A80CB2EF76D3300439A34 /* GameStreamTokenizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B7A80CA2EF76D3300439A34 /* GameStreamTokenizerTests.swift */; };
8283
7B8F887327924B5200713BA7 /* AddProfileWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8F887127924B5200713BA7 /* AddProfileWindow.swift */; };
8384
7B8F887427924B5200713BA7 /* AddProfileWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8F887127924B5200713BA7 /* AddProfileWindow.swift */; };
8485
7B8F887527924B5200713BA7 /* AddProfileWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B8F887227924B5200713BA7 /* AddProfileWindow.xib */; };
@@ -363,6 +364,7 @@
363364
7B3B9A1C275B11390035D731 /* SubsCommandHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubsCommandHandler.swift; sourceTree = "<group>"; };
364365
7B5DD3D02DD25686009C1D99 /* LayoutCommandHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutCommandHandler.swift; sourceTree = "<group>"; };
365366
7B6820462C8BC856009833B3 /* EmulateTextCommandHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmulateTextCommandHandler.swift; sourceTree = "<group>"; };
367+
7B7A80CA2EF76D3300439A34 /* GameStreamTokenizerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameStreamTokenizerTests.swift; sourceTree = "<group>"; };
366368
7B8F887127924B5200713BA7 /* AddProfileWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddProfileWindow.swift; sourceTree = "<group>"; };
367369
7B8F887227924B5200713BA7 /* AddProfileWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddProfileWindow.xib; sourceTree = "<group>"; };
368370
7B8F888D279FB1A500713BA7 /* Swen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swen.swift; sourceTree = "<group>"; };
@@ -772,6 +774,7 @@
772774
F9CA20512466057000A92736 /* Handlers */,
773775
F9CA206A2466761B00A92736 /* InMemoryHelpers.swift */,
774776
F9D36E9522EFC73B008BC6E6 /* GameStreamTests.swift */,
777+
7B7A80CA2EF76D3300439A34 /* GameStreamTokenizerTests.swift */,
775778
F9BCF30022E177E200C7F7F0 /* OutlanderTests.swift */,
776779
F98B491F2470B63D000E2D92 /* StreamTokenTests.swift */,
777780
F98B491A24709CAE000E2D92 /* RegexTester.swift */,
@@ -1170,6 +1173,7 @@
11701173
F98B490A246F9668000E2D92 /* HighlightLoader.swift in Sources */,
11711174
F9CA2073246776B800A92736 /* ClassLoaderTests.swift in Sources */,
11721175
7BBBC519276DA3EB00D1CF3E /* LogBuilder.swift in Sources */,
1176+
7B7A80CB2EF76D3300439A34 /* GameStreamTokenizerTests.swift in Sources */,
11731177
7B228B1E273871720052610B /* Pathfinder.swift in Sources */,
11741178
F98B4907246F8EFD000E2D92 /* AliasLoader.swift in Sources */,
11751179
7B10A69B276346C9000FEDE8 /* WindowSettingsViewController.swift in Sources */,

app/src/Outlander/Server/GameStream.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ struct TextTag {
636636
func canCombine(with tag: TextTag) -> Bool {
637637
guard window == tag.window else { return false }
638638
guard isPrompt == tag.isPrompt else { return false }
639+
if window == "thoughts" {
640+
return true
641+
}
639642
guard mono == tag.mono else { return false }
640643
guard bold == tag.bold else { return false }
641644
guard preset == tag.preset else { return false }
@@ -876,6 +879,11 @@ class GameStream {
876879

877880
tags.append(tag)
878881

882+
// wait until prompt so thoughts are combined
883+
if(tag.window == "thoughts") {
884+
continue
885+
}
886+
879887
if !isSetup || isPrompt {
880888
let combined = TextTag.combine(tags: tags)
881889

app/src/Outlander/UI/Game.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="tny-JT-jcH">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="tny-JT-jcH">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22689"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<scenes>
@@ -23,7 +23,7 @@
2323
<constraint firstAttribute="height" constant="24" id="Fef-4U-bgj"/>
2424
</constraints>
2525
</customView>
26-
<textField clipsToBounds="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9lN-eF-asn" customClass="HistoryTextField" customModule="Outlander" customModuleProvider="target">
26+
<textField clipsToBounds="YES" focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9lN-eF-asn" customClass="HistoryTextField" customModule="Outlander" customModuleProvider="target">
2727
<rect key="frame" x="3" y="25" width="706" height="25"/>
2828
<constraints>
2929
<constraint firstAttribute="height" constant="25" id="bFl-Mm-yPl"/>

app/src/Outlander/UI/MapWindow.xib

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22689"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<objects>
@@ -22,7 +22,7 @@
2222
<window title="AutoMapper" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" titlebarAppearsTransparent="YES" id="F0z-JX-Cv5">
2323
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
2424
<rect key="contentRect" x="196" y="240" width="934" height="545"/>
25-
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
25+
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1409"/>
2626
<value key="minSize" type="size" width="800" height="500"/>
2727
<view key="contentView" id="se5-gp-TjO">
2828
<rect key="frame" x="0.0" y="0.0" width="934" height="545"/>
@@ -80,7 +80,7 @@
8080
<action selector="levelAction:" target="-2" id="yw5-Bc-ixE"/>
8181
</connections>
8282
</segmentedControl>
83-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oWP-KH-2r6">
83+
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oWP-KH-2r6">
8484
<rect key="frame" x="10" y="8" width="913" height="17"/>
8585
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
8686
<textFieldCell key="cell" lineBreakMode="clipping" title="#64 some long text in here" id="cbx-j6-9uB">
@@ -89,7 +89,7 @@
8989
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
9090
</textFieldCell>
9191
</textField>
92-
<comboBox verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ixo-5h-EM0">
92+
<comboBox focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ixo-5h-EM0">
9393
<rect key="frame" x="6" y="496" width="420" height="25"/>
9494
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
9595
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" drawsBackground="YES" buttonBordered="NO" completes="NO" usesDataSource="YES" numberOfVisibleItems="15" id="66B-9S-GuG">
@@ -112,7 +112,7 @@
112112
<action selector="centerAction:" target="-2" id="5mn-Jk-zxt"/>
113113
</connections>
114114
</button>
115-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PXn-Zw-TLz">
115+
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PXn-Zw-TLz">
116116
<rect key="frame" x="672" y="0.0" width="250" height="25"/>
117117
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
118118
<textFieldCell key="cell" lineBreakMode="clipping" selectable="YES" alignment="right" title="1015 rooms" id="5LE-TA-zRr">

app/src/Outlander/UI/OWindow.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ class OWindow: NSWindow {
7676
return
7777
}
7878

79+
guard let titlebarContainer = self.standardWindowButton(.closeButton)?.superview else {
80+
return
81+
}
82+
7983
let titleView = findViewInSubview(contentSuperView.subviews, ignoreView: windowContentView, test: { view in
8084
view is NSTextField
8185
})
@@ -93,6 +97,16 @@ class OWindow: NSWindow {
9397
}
9498

9599
titleText.attributedStringValue = NSAttributedString(string: title, attributes: attributes)
100+
titleText.sizeToFit()
101+
102+
// center
103+
// titleText.frame.origin.x = (titlebarContainer.bounds.width - titleText.frame.width) / 2
104+
// titleText.frame.origin.y = (titlebarContainer.bounds.height - titleText.frame.height) / 2
105+
106+
// right
107+
let rightPadding: CGFloat = 5
108+
titleText.frame.origin.x = titlebarContainer.bounds.width - titleText.frame.width - rightPadding
109+
titleText.frame.origin.y = (titlebarContainer.bounds.height - titleText.frame.height) / 2
96110
}
97111

98112
func findViewInSubview(_ subviews: [NSView], ignoreView: NSView, test: (NSView) -> Bool) -> NSView? {

app/src/Outlander/UI/Window.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="bhD-Jz-R1g">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="24127" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="bhD-Jz-R1g">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22689"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24127"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<scenes>
@@ -39,7 +39,7 @@
3939
<autoresizingMask key="autoresizingMask"/>
4040
</scroller>
4141
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="FgD-Bg-wTs">
42-
<rect key="frame" x="541" y="0.0" width="16" height="397"/>
42+
<rect key="frame" x="540" y="0.0" width="17" height="397"/>
4343
<autoresizingMask key="autoresizingMask"/>
4444
</scroller>
4545
</scrollView>

0 commit comments

Comments
 (0)