mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-08 03:54:27 +00:00
Fixed mismatch between initial tick box states and communicated switches; ensured they're visible upon launching a game.
This commit is contained in:
parent
2f00b841d8
commit
3591479571
@ -68,7 +68,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="3qw-C1-NYW">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="3qw-C1-NYW">
|
||||||
<rect key="frame" x="18" y="58" width="164" height="18"/>
|
<rect key="frame" x="18" y="58" width="164" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Black and White" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="UP7-mf-IKo">
|
<buttonCell key="cell" type="check" title="Black and White" bezelStyle="regularSquare" imagePosition="left" inset="2" id="UP7-mf-IKo">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
@ -78,7 +78,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="Xbc-cw-Sc2">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="Xbc-cw-Sc2">
|
||||||
<rect key="frame" x="18" y="38" width="164" height="18"/>
|
<rect key="frame" x="18" y="38" width="164" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Left Player Difficulty" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="wlJ-8s-PEh">
|
<buttonCell key="cell" type="check" title="Left Player Difficulty" bezelStyle="regularSquare" imagePosition="left" inset="2" id="wlJ-8s-PEh">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="kPV-Tm-TTc">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="kPV-Tm-TTc">
|
||||||
<rect key="frame" x="18" y="18" width="164" height="18"/>
|
<rect key="frame" x="18" y="18" width="164" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Right Player Difficulty" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="F05-cA-66S">
|
<buttonCell key="cell" type="check" title="Right Player Difficulty" bezelStyle="regularSquare" imagePosition="left" inset="2" id="F05-cA-66S">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
|
@ -28,6 +28,17 @@ class Atari2600Document: MachineDocument {
|
|||||||
atari2600.setROM(data)
|
atari2600.setROM(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func windowControllerDidLoadNib(aController: NSWindowController) {
|
||||||
|
super.windowControllerDidLoadNib(aController)
|
||||||
|
|
||||||
|
// push whatever settings the switches have in the NIB into the emulation
|
||||||
|
pushSwitchValues()
|
||||||
|
|
||||||
|
// show the options window but ensure the OpenGL view is key
|
||||||
|
showOptions(self)
|
||||||
|
self.openGLView.window?.makeKeyWindow()
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: CSOpenGLViewResponderDelegate
|
// MARK: CSOpenGLViewResponderDelegate
|
||||||
private func inputForKey(event: NSEvent) -> Atari2600DigitalInput? {
|
private func inputForKey(event: NSEvent) -> Atari2600DigitalInput? {
|
||||||
switch event.keyCode {
|
switch event.keyCode {
|
||||||
@ -72,6 +83,10 @@ class Atari2600Document: MachineDocument {
|
|||||||
@IBOutlet var rightPlayerDifficultyButton: NSButton!
|
@IBOutlet var rightPlayerDifficultyButton: NSButton!
|
||||||
|
|
||||||
@IBAction func optionDidChange(sender: AnyObject!) {
|
@IBAction func optionDidChange(sender: AnyObject!) {
|
||||||
|
pushSwitchValues()
|
||||||
|
}
|
||||||
|
|
||||||
|
private func pushSwitchValues() {
|
||||||
atari2600.colourButton = colourButton.state == NSOnState
|
atari2600.colourButton = colourButton.state == NSOnState
|
||||||
atari2600.leftPlayerDifficultyButton = leftPlayerDifficultyButton.state == NSOnState
|
atari2600.leftPlayerDifficultyButton = leftPlayerDifficultyButton.state == NSOnState
|
||||||
atari2600.rightPlayerDifficultyButton = rightPlayerDifficultyButton.state == NSOnState
|
atari2600.rightPlayerDifficultyButton = rightPlayerDifficultyButton.state == NSOnState
|
||||||
|
Loading…
Reference in New Issue
Block a user