Skip to content

Commit

Permalink
Merge pull request #14 from amiantos/v1.1
Browse files Browse the repository at this point in the history
Screensaver v1.1 Prep
  • Loading branch information
amiantos authored Jan 29, 2022
2 parents aa2432c + b4a3d7f commit 8e8e286
Show file tree
Hide file tree
Showing 26 changed files with 122 additions and 13 deletions.
8 changes: 4 additions & 4 deletions MultiClock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
CLANG_ENABLE_MODULES = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 2Y9M69QJKZ;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
Expand All @@ -487,7 +487,7 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = net.amiantos.MultiClock;
PRODUCT_NAME = MultiClock;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -503,7 +503,7 @@
CLANG_ENABLE_MODULES = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 2Y9M69QJKZ;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
Expand All @@ -514,7 +514,7 @@
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.1;
PRODUCT_BUNDLE_IDENTIFIER = net.amiantos.MultiClock;
PRODUCT_NAME = MultiClock;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ MultiClock is a screensaver for macOS that displays the current time using 24 cl

## Download

* [Download MultiClock v1.0 for macOS](https://amiantos.s3.amazonaws.com/multiclock-1.0.zip)
* [Download MultiClock v1.1 for macOS](https://amiantos.s3.amazonaws.com/multiclock-1.1.zip)

## FAQ

*What about 24-hour time support?*

If you have macOS set to 24-hour time, the screensaver will automatically use 24-hour time as well. (Well, it's [supposed to, anyway](https://github.com/amiantos/multiclock/issues/2)...)
If you have macOS set to 24-hour time, the screensaver will automatically use 24-hour time as well.

## Development

Expand All @@ -43,7 +43,7 @@ queue(animations: [
])
```

Completed animations should go in `ClockController.swift`. Bump up the `Int.random()` call and add a new `case` to the `switch`. Then submit a PR if you think the animation is cool :)
Completed animations should go in `ClockController.swift`. Add another integer to `allAnimations` at the top, and add a new `case` to the `switch` down below. Then submit a PR if you think the animation is cool :)

*Why are all the degree references in negative?* Because I'm too lazy to go back and make them positive after reworking the animation system. Submit a PR fixing it, if you want!

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Hourhand-applewatch-filled.pdf",
"filename" : "appleWatchSolidHourHand.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Minutehand-applewatch-filled.pdf",
"filename" : "appleWatchSolidMinuteHand.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions Shared/Nodes/Assets.xcassets/Hands/LCD/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "lcdHourHand.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "lcdMinuteHand.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions Shared/Nodes/Assets.xcassets/Hands/Traditional/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "traditionalHourHand.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"images" : [
{
"filename" : "traditionalMinuteHand.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Binary file not shown.
12 changes: 11 additions & 1 deletion Shared/Nodes/Textures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ enum HandDesign: String {
case appleWatchSolid = "appleWatchSolid"
case appleWatchFilled = "appleWatchFilled"
case shout = "shout"
case lcd = "lcd"
case traditional = "traditional"
}

enum DialDesign: String {
Expand Down Expand Up @@ -51,7 +53,15 @@ let handTextures: [HandDesign: HandTextureSet] = [
.shout: HandTextureSet(
hourHandTexture: FileGrabber.shared.getSKTexture(named: "shoutHourHand"),
minuteHandTexture: FileGrabber.shared.getSKTexture(named: "shoutMinuteHand")
)
),
.lcd: HandTextureSet(
hourHandTexture: FileGrabber.shared.getSKTexture(named: "lcdHourHand"),
minuteHandTexture: FileGrabber.shared.getSKTexture(named: "lcdMinuteHand")
),
.traditional: HandTextureSet(
hourHandTexture: FileGrabber.shared.getSKTexture(named: "traditionalHourHand"),
minuteHandTexture: FileGrabber.shared.getSKTexture(named: "traditionalMinuteHand")
),
]

let dialTextures: [DialDesign: SKTexture?] = [
Expand Down
12 changes: 9 additions & 3 deletions macOS Screensaver/ConfigureSheet/ConfigureSheet.xib
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ DQ
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zng-Ku-YRl">
<rect key="frame" x="50" y="366" width="86" height="16"/>
<rect key="frame" x="49" y="366" width="87" height="16"/>
<buttonCell key="cell" type="square" title="by Brad Root" bezelStyle="shadowlessSquare" alignment="right" imageScaling="proportionallyDown" inset="2" id="piz-AH-ud0">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -78,8 +78,8 @@ DQ
<rect key="frame" x="20" y="58" width="456" height="5"/>
</box>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cPI-vH-MTc">
<rect key="frame" x="23" y="366" width="29" height="14"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="v1.0" id="aYW-mH-qB5">
<rect key="frame" x="23" y="366" width="28" height="14"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="v1.1" id="aYW-mH-qB5">
<font key="font" metaFont="controlContent" size="11"/>
<color key="textColor" name="tertiaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -107,6 +107,12 @@ DQ
<menuItem title="Shout" tag="4" id="n0A-4n-uEB">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="LCD" tag="5" id="oUg-ZH-J4v">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Traditional" tag="6" id="QKS-ym-Qs0">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
</items>
</menu>
</popUpButtonCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ final class ConfigureSheetController: NSObject {
manager.setHandDesign(.appleWatchFilled)
case 4:
manager.setHandDesign(.shout)
case 5:
manager.setHandDesign(.lcd)
case 6:
manager.setHandDesign(.traditional)
default:
manager.setHandDesign(.modern)
}
Expand Down Expand Up @@ -149,6 +153,10 @@ final class ConfigureSheetController: NSObject {
handSwitcher.selectItem(at: 3)
case .shout:
handSwitcher.selectItem(at: 4)
case .lcd:
handSwitcher.selectItem(at: 5)
case .traditional:
handSwitcher.selectItem(at: 6)
}
}
}
9 changes: 9 additions & 0 deletions macOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ class ViewController: NSViewController {
view.presentScene(scene)
scene.controller?.mode = .manual
scene.controller?.start()

scene.controller?.scene?.backgroundColor = .blue

scene.controller?.clocks.forEach({ clockNode in
clockNode.clockFaceNode.texture = dialTextures[.indices]!
clockNode.minuteHandNode.texture = handTextures[.appleWatchFilled]!.minuteHandTexture
clockNode.hourHandNode.texture = handTextures[.appleWatchFilled]!.hourHandTexture
clockNode.clockFaceNode.color = .white
})
}
}
}
Expand Down

0 comments on commit 8e8e286

Please sign in to comment.