This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: 82Flex <[email protected]>
- Loading branch information
Showing
10 changed files
with
165 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// ActivateHUDIntent.swift | ||
// TrollSpeed | ||
// | ||
// Created by Lessica on 2024/1/27. | ||
// | ||
|
||
import AppIntents | ||
|
||
@available(iOS 16, *) | ||
struct ActivateHUDIntent: AppIntent { | ||
static let title: LocalizedStringResource = "Open HUD" | ||
|
||
static let description = IntentDescription( | ||
"Activate the network speed HUD.", | ||
categoryName: "Utility", | ||
searchKeywords: [ | ||
"activate", | ||
"open", | ||
"hud", | ||
] | ||
) | ||
|
||
func perform() async throws -> some IntentResult { | ||
if !IsHUDEnabled() { | ||
SetHUDEnabled(true) | ||
return .result(value: true) | ||
} | ||
return .result(value: false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// DeactivateHUDIntent.swift | ||
// TrollSpeed | ||
// | ||
// Created by Lessica on 2024/1/27. | ||
// | ||
|
||
import AppIntents | ||
|
||
@available(iOS 16, *) | ||
struct DeactivateHUDIntent: AppIntent { | ||
static let title: LocalizedStringResource = "Exit HUD" | ||
|
||
static let description = IntentDescription( | ||
"Deactivate the network speed HUD.", | ||
categoryName: "Utility", | ||
searchKeywords: [ | ||
"deactivate", | ||
"exit", | ||
"hud", | ||
] | ||
) | ||
|
||
func perform() async throws -> some IntentResult { | ||
if IsHUDEnabled() { | ||
SetHUDEnabled(false) | ||
return .result(value: true) | ||
} | ||
return .result(value: false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// ToggleHUDIntent.swift | ||
// TrollSpeed | ||
// | ||
// Created by Lessica on 2024/1/27. | ||
// | ||
|
||
import AppIntents | ||
|
||
@available(iOS 16, *) | ||
struct ToggleHUDIntent: AppIntent { | ||
static let title: LocalizedStringResource = "Toggle HUD" | ||
|
||
static let description = IntentDescription( | ||
"Toggle the network speed HUD.", | ||
categoryName: "Utility", | ||
searchKeywords: [ | ||
"toggle", | ||
"exit", | ||
"hud", | ||
] | ||
) | ||
|
||
func perform() async throws -> some IntentResult { | ||
SetHUDEnabled(!IsHUDEnabled()) | ||
return .result(value: true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters