Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit d152a05

Browse files
committed
feat: add optional prefs
Signed-off-by: 82Flex <82flex@gmail.com>
1 parent e8a8534 commit d152a05

File tree

14 files changed

+332
-6
lines changed

14 files changed

+332
-6
lines changed

.clang-format

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# clang-format
2+
BasedOnStyle: LLVM
3+
IndentWidth: 4
4+
AccessModifierOffset: -4
5+
ContinuationIndentWidth: 4
6+
ColumnLimit: 120

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ TrollSpeed_CODESIGN_FLAGS += -Ssupports/entitlements.plist
3636

3737
include $(THEOS_MAKE_PATH)/application.mk
3838

39+
SUBPROJECTS += prefs
3940
ifneq ($(FINALPACKAGE),1)
4041
SUBPROJECTS += memory_pressure
41-
include $(THEOS_MAKE_PATH)/aggregate.mk
4242
endif
4343

44+
include $(THEOS_MAKE_PATH)/aggregate.mk
45+
4446
before-all::
4547
$(ECHO_NOTHING)defaults write $(LAUNCHD_PLIST) ProgramArguments -array "$(THEOS_PACKAGE_INSTALL_PREFIX)/Applications/TrollSpeed.app/TrollSpeed" "-hud" || true$(ECHO_END)
4648
$(ECHO_NOTHING)plutil -convert xml1 $(LAUNCHD_PLIST)$(ECHO_END)

prefs/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARCHS := arm64 arm64e
2+
TARGET := iphone:clang:15.6:14.0
3+
INSTALL_TARGET_PROCESSES := Preferences
4+
5+
include $(THEOS)/makefiles/common.mk
6+
7+
BUNDLE_NAME += TrollSpeedPrefs
8+
9+
TrollSpeedPrefs_FILES += TSPrefsRootListController.m
10+
TrollSpeedPrefs_FRAMEWORKS += UIKit
11+
TrollSpeedPrefs_PRIVATE_FRAMEWORKS += Preferences
12+
TrollSpeedPrefs_INSTALL_PATH += /Library/PreferenceBundles
13+
TrollSpeedPrefs_CFLAGS += -fobjc-arc
14+
TrollSpeedPrefs_CFLAGS += -I../supports/
15+
16+
include $(THEOS_MAKE_PATH)/bundle.mk

prefs/Resources/Info.plist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleExecutable</key>
8+
<string>TrollSpeedPrefs</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>ch.xxtou.hudapp.prefs</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundlePackageType</key>
14+
<string>BNDL</string>
15+
<key>CFBundleShortVersionString</key>
16+
<string>1.0.0</string>
17+
<key>CFBundleSignature</key>
18+
<string>????</string>
19+
<key>CFBundleVersion</key>
20+
<string>1.0</string>
21+
<key>NSPrincipalClass</key>
22+
<string>TSPrefsRootListController</string>
23+
</dict>
24+
</plist>

prefs/Resources/Root.plist

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>items</key>
6+
<array>
7+
<dict>
8+
<key>cell</key>
9+
<string>PSGroupCell</string>
10+
<key>label</key>
11+
<string>Custom Font Size</string>
12+
</dict>
13+
<dict>
14+
<key>cell</key>
15+
<string>PSSwitchCell</string>
16+
<key>default</key>
17+
<false/>
18+
<key>defaults</key>
19+
<string>ch.xxtou.hudapp.prefs</string>
20+
<key>key</key>
21+
<string>usesCustomFontSize</string>
22+
<key>label</key>
23+
<string>Uses Custom Font Size</string>
24+
<key>PostNotification</key>
25+
<string>ch.xxtou.notification.hud.reload</string>
26+
</dict>
27+
<dict>
28+
<key>cell</key>
29+
<string>PSSliderCell</string>
30+
<key>default</key>
31+
<real>9</real>
32+
<key>defaults</key>
33+
<string>ch.xxtou.hudapp.prefs</string>
34+
<key>key</key>
35+
<string>realCustomFontSize</string>
36+
<key>label</key>
37+
<string>Custom Font Size</string>
38+
<key>max</key>
39+
<real>12</real>
40+
<key>min</key>
41+
<real>8</real>
42+
<key>showValue</key>
43+
<true/>
44+
<key>PostNotification</key>
45+
<string>ch.xxtou.notification.hud.reload</string>
46+
</dict>
47+
<dict>
48+
<key>cell</key>
49+
<string>PSGroupCell</string>
50+
<key>label</key>
51+
<string>Custom Offset</string>
52+
</dict>
53+
<dict>
54+
<key>cell</key>
55+
<string>PSSwitchCell</string>
56+
<key>default</key>
57+
<false/>
58+
<key>defaults</key>
59+
<string>ch.xxtou.hudapp.prefs</string>
60+
<key>key</key>
61+
<string>usesCustomOffset</string>
62+
<key>label</key>
63+
<string>Uses Custom Offset</string>
64+
<key>PostNotification</key>
65+
<string>ch.xxtou.notification.hud.reload</string>
66+
</dict>
67+
<dict>
68+
<key>cell</key>
69+
<string>PSSliderCell</string>
70+
<key>default</key>
71+
<real>0</real>
72+
<key>defaults</key>
73+
<string>ch.xxtou.hudapp.prefs</string>
74+
<key>key</key>
75+
<string>realCustomOffsetX</string>
76+
<key>label</key>
77+
<string>Custom Offset X</string>
78+
<key>max</key>
79+
<real>100</real>
80+
<key>min</key>
81+
<real>-100</real>
82+
<key>showValue</key>
83+
<true/>
84+
<key>PostNotification</key>
85+
<string>ch.xxtou.notification.hud.reload</string>
86+
</dict>
87+
<dict>
88+
<key>cell</key>
89+
<string>PSSliderCell</string>
90+
<key>default</key>
91+
<real>0</real>
92+
<key>defaults</key>
93+
<string>ch.xxtou.hudapp.prefs</string>
94+
<key>key</key>
95+
<string>realCustomOffsetY</string>
96+
<key>label</key>
97+
<string>Custom Offset Y</string>
98+
<key>max</key>
99+
<real>100</real>
100+
<key>min</key>
101+
<real>-100</real>
102+
<key>showValue</key>
103+
<true/>
104+
<key>PostNotification</key>
105+
<string>ch.xxtou.notification.hud.reload</string>
106+
</dict>
107+
<dict>
108+
<key>cell</key>
109+
<string>PSGroupCell</string>
110+
<key>label</key>
111+
<string></string>
112+
<key>footerText</key>
113+
<string>Made with ♥ by @Lessica and @jmpews</string>
114+
</dict>
115+
<dict>
116+
<key>cell</key>
117+
<string>PSButtonCell</string>
118+
<key>label</key>
119+
<string>Reset to Default</string>
120+
<key>action</key>
121+
<string>resetToDefaults:</string>
122+
<key>defaults</key>
123+
<string>ch.xxtou.hudapp.prefs</string>
124+
<key>PostNotification</key>
125+
<string>ch.xxtou.notification.hud.reload</string>
126+
</dict>
127+
</array>
128+
<key>title</key>
129+
<string>TrollSpeed</string>
130+
</dict>
131+
</plist>

Resources/Settings.bundle/es.lproj/Root.strings renamed to prefs/Resources/en.lproj/Root.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
"Custom Offset" = "Custom Offset";
88

99
"Uses Custom Offset" = "Uses Custom Offset";
10+
11+
"Reset to Default" = "Reset to Default";

prefs/Resources/icon.png

2.99 KB
Loading

prefs/Resources/icon@2x.png

7.88 KB
Loading

prefs/Resources/icon@3x.png

14.8 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"Appearance" = "外观";
2+
3+
"Custom Font Size" = "自定义字体大小";
4+
5+
"Uses Custom Font Size" = "使用自定义字体大小";
6+
7+
"Custom Offset" = "自定义偏移位置";
8+
9+
"Uses Custom Offset" = "使用自定义偏移位置";
10+
11+
"Reset to Default" = "重置为默认值";

0 commit comments

Comments
 (0)