mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Merge branch 'master' into Enterprise
This commit is contained in:
commit
fe04410681
@ -0,0 +1,37 @@
|
||||
//
|
||||
// AppleIIOptionsPanel.swift
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 07/06/2021.
|
||||
// Copyright 2021 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
class AppleIIOptionsPanel: MachinePanel {
|
||||
var appleII: CSAppleII! {
|
||||
get {
|
||||
return self.machine.appleII
|
||||
}
|
||||
}
|
||||
var squarePixelsUserDefaultsKey: String {
|
||||
return prefixedUserDefaultsKey("useSquarePixels")
|
||||
}
|
||||
|
||||
@IBOutlet var squarePixelButton: NSButton!
|
||||
|
||||
@IBAction func optionDidChange(_ sender: AnyObject!) {
|
||||
let useSquarePixels = squarePixelButton.state == .on
|
||||
appleII.useSquarePixels = useSquarePixels
|
||||
|
||||
let standardUserDefaults = UserDefaults.standard
|
||||
standardUserDefaults.set(useSquarePixels, forKey: squarePixelsUserDefaultsKey)
|
||||
}
|
||||
|
||||
override func establishStoredOptions() {
|
||||
super.establishStoredOptions()
|
||||
|
||||
let standardUserDefaults = UserDefaults.standard
|
||||
let useSquarePixels = standardUserDefaults.bool(forKey: squarePixelsUserDefaultsKey)
|
||||
appleII.useSquarePixels = useSquarePixels
|
||||
squarePixelButton.state = useSquarePixels ? .on : .off
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user