mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 13:00:17 +02:00
chore: fine tuning to style
* reduced notices * rewrote some strings
This commit is contained in:
parent
58a13fe5be
commit
e587f4700a
@ -76,6 +76,7 @@ import kotlinx.coroutines.launch
|
|||||||
import me.rhunk.snapenhance.core.config.ConfigContainer
|
import me.rhunk.snapenhance.core.config.ConfigContainer
|
||||||
import me.rhunk.snapenhance.core.config.ConfigFlag
|
import me.rhunk.snapenhance.core.config.ConfigFlag
|
||||||
import me.rhunk.snapenhance.core.config.DataProcessors
|
import me.rhunk.snapenhance.core.config.DataProcessors
|
||||||
|
import me.rhunk.snapenhance.core.config.FeatureNotice
|
||||||
import me.rhunk.snapenhance.core.config.PropertyKey
|
import me.rhunk.snapenhance.core.config.PropertyKey
|
||||||
import me.rhunk.snapenhance.core.config.PropertyPair
|
import me.rhunk.snapenhance.core.config.PropertyPair
|
||||||
import me.rhunk.snapenhance.core.config.PropertyValue
|
import me.rhunk.snapenhance.core.config.PropertyValue
|
||||||
@ -301,6 +302,12 @@ class FeaturesSection : Section() {
|
|||||||
@Composable
|
@Composable
|
||||||
private fun PropertyCard(property: PropertyPair<*>) {
|
private fun PropertyCard(property: PropertyPair<*>) {
|
||||||
var clickCallback by remember { mutableStateOf<ClickCallback?>(null) }
|
var clickCallback by remember { mutableStateOf<ClickCallback?>(null) }
|
||||||
|
val noticeColorMap = mapOf(
|
||||||
|
FeatureNotice.UNSTABLE.key to Color(0xFFFFFB87),
|
||||||
|
FeatureNotice.BAN_RISK.key to Color(0xFFFF8585),
|
||||||
|
FeatureNotice.INTERNAL_BEHAVIOR.key to Color(0xFFFFFB87)
|
||||||
|
)
|
||||||
|
|
||||||
Card(
|
Card(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@ -356,13 +363,12 @@ class FeaturesSection : Section() {
|
|||||||
}.forEach {
|
}.forEach {
|
||||||
Text(
|
Text(
|
||||||
text = context.translation["features.notices.${it.key}"],
|
text = context.translation["features.notices.${it.key}"],
|
||||||
color = Color.Yellow,
|
color = noticeColorMap[it.key] ?: Color(0xFFFFFB87),
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
lineHeight = 15.sp
|
lineHeight = 15.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.CenterVertically)
|
.align(Alignment.CenterVertically)
|
||||||
|
@ -77,15 +77,14 @@
|
|||||||
|
|
||||||
"features": {
|
"features": {
|
||||||
"notices": {
|
"notices": {
|
||||||
"unstable": "This feature is unstable and may cause issues",
|
"unstable": "\u26A0 Unstable",
|
||||||
"may_ban": "This feature may cause bans",
|
"ban_risk": "\u26A0 This feature may cause bans",
|
||||||
"may_break_internal_behavior": "This may break Snapchat internal behavior",
|
"internal_behavior": "\u26A0 This may break Snapchat internal behavior"
|
||||||
"may_cause_crashes": "This may cause instability"
|
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"downloader": {
|
"downloader": {
|
||||||
"name": "Downloader",
|
"name": "Downloader",
|
||||||
"description": "Download Snaps and Stories",
|
"description": "Download Snapchat Media",
|
||||||
"properties": {
|
"properties": {
|
||||||
"save_folder": {
|
"save_folder": {
|
||||||
"name": "Save Folder",
|
"name": "Save Folder",
|
||||||
@ -193,7 +192,7 @@
|
|||||||
},
|
},
|
||||||
"2d_bitmoji_selfie": {
|
"2d_bitmoji_selfie": {
|
||||||
"name": "2D Bitmoji Selfie",
|
"name": "2D Bitmoji Selfie",
|
||||||
"description": "Brings back the 2D selfie from older Snapchat versions\nYou need to clean the Snapchat cache from debug for this to take effect"
|
"description": "Brings back the 2D Bitmoji selfies from older Snapchat versions\nYou may need to clean the Snapchat cache for this to take effect"
|
||||||
},
|
},
|
||||||
"disable_spotlight": {
|
"disable_spotlight": {
|
||||||
"name": "Disable Spotlight",
|
"name": "Disable Spotlight",
|
||||||
@ -277,7 +276,7 @@
|
|||||||
},
|
},
|
||||||
"global": {
|
"global": {
|
||||||
"name": "Global",
|
"name": "Global",
|
||||||
"description": "Tweak Snapchat Globally",
|
"description": "Tweak Global Snapchat Settings",
|
||||||
"properties": {
|
"properties": {
|
||||||
"snapchat_plus": {
|
"snapchat_plus": {
|
||||||
"name": "Snapchat Plus",
|
"name": "Snapchat Plus",
|
||||||
@ -315,7 +314,7 @@
|
|||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"name": "Rules",
|
"name": "Rules",
|
||||||
"description": "Manage Automatic Features\nThe social tab lets you assign a rule to an object"
|
"description": "Manage Automatic Features for individual people"
|
||||||
},
|
},
|
||||||
"camera": {
|
"camera": {
|
||||||
"name": "Camera",
|
"name": "Camera",
|
||||||
@ -349,7 +348,7 @@
|
|||||||
},
|
},
|
||||||
"streaks_reminder": {
|
"streaks_reminder": {
|
||||||
"name": "Streaks Reminder",
|
"name": "Streaks Reminder",
|
||||||
"description": "Reminds you to keep your streaks",
|
"description": "Periodically notifies you about your Streaks",
|
||||||
"properties": {
|
"properties": {
|
||||||
"interval": {
|
"interval": {
|
||||||
"name": "Interval",
|
"name": "Interval",
|
||||||
|
@ -3,7 +3,6 @@ package me.rhunk.snapenhance.core.config
|
|||||||
import me.rhunk.snapenhance.core.bridge.wrapper.LocaleWrapper
|
import me.rhunk.snapenhance.core.bridge.wrapper.LocaleWrapper
|
||||||
import kotlin.reflect.KProperty
|
import kotlin.reflect.KProperty
|
||||||
|
|
||||||
|
|
||||||
data class PropertyPair<T>(
|
data class PropertyPair<T>(
|
||||||
val key: PropertyKey<T>,
|
val key: PropertyKey<T>,
|
||||||
val value: PropertyValue<*>
|
val value: PropertyValue<*>
|
||||||
@ -16,9 +15,8 @@ enum class FeatureNotice(
|
|||||||
val key: String
|
val key: String
|
||||||
) {
|
) {
|
||||||
UNSTABLE(0b0001, "unstable"),
|
UNSTABLE(0b0001, "unstable"),
|
||||||
MAY_BAN(0b0010, "may_ban"),
|
BAN_RISK(0b0010, "ban_risk"),
|
||||||
MAY_BREAK_INTERNAL_BEHAVIOR(0b0100, "may_break_internal_behavior"),
|
INTERNAL_BEHAVIOR(0b0100, "internal_behavior")
|
||||||
MAY_CAUSE_CRASHES(0b1000, "may_cause_crashes");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class ConfigFlag(
|
enum class ConfigFlag(
|
||||||
|
@ -7,13 +7,13 @@ import me.rhunk.snapenhance.features.impl.tweaks.CameraTweaks
|
|||||||
|
|
||||||
class Camera : ConfigContainer() {
|
class Camera : ConfigContainer() {
|
||||||
val disable = boolean("disable_camera")
|
val disable = boolean("disable_camera")
|
||||||
val immersiveCameraPreview = boolean("immersive_camera_preview") { addNotices(FeatureNotice.MAY_CAUSE_CRASHES) }
|
val immersiveCameraPreview = boolean("immersive_camera_preview") { addNotices(FeatureNotice.UNSTABLE) }
|
||||||
val overridePreviewResolution = unique("override_preview_resolution", *CameraTweaks.resolutions.toTypedArray())
|
val overridePreviewResolution = unique("override_preview_resolution", *CameraTweaks.resolutions.toTypedArray())
|
||||||
{ addFlags(ConfigFlag.NO_TRANSLATE) }
|
{ addFlags(ConfigFlag.NO_TRANSLATE) }
|
||||||
val overridePictureResolution = unique("override_picture_resolution", *CameraTweaks.resolutions.toTypedArray())
|
val overridePictureResolution = unique("override_picture_resolution", *CameraTweaks.resolutions.toTypedArray())
|
||||||
{ addFlags(ConfigFlag.NO_TRANSLATE) }
|
{ addFlags(ConfigFlag.NO_TRANSLATE) }
|
||||||
val customFrameRate = unique("custom_frame_rate",
|
val customFrameRate = unique("custom_frame_rate",
|
||||||
"5", "10", "20", "25", "30", "48", "60", "90", "120"
|
"5", "10", "20", "25", "30", "48", "60", "90", "120"
|
||||||
) { addNotices(FeatureNotice.MAY_BREAK_INTERNAL_BEHAVIOR); addFlags(ConfigFlag.NO_TRANSLATE) }
|
) { addNotices(FeatureNotice.UNSTABLE); addFlags(ConfigFlag.NO_TRANSLATE) }
|
||||||
val forceCameraSourceEncoding = boolean("force_camera_source_encoding")
|
val forceCameraSourceEncoding = boolean("force_camera_source_encoding")
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class DownloaderConfig : ConfigContainer() {
|
|||||||
"append_date_time",
|
"append_date_time",
|
||||||
).apply { set(mutableListOf("append_hash", "append_date_time", "append_type", "append_username")) }
|
).apply { set(mutableListOf("append_hash", "append_date_time", "append_type", "append_username")) }
|
||||||
val allowDuplicate = boolean("allow_duplicate")
|
val allowDuplicate = boolean("allow_duplicate")
|
||||||
val mergeOverlays = boolean("merge_overlays") { addNotices(FeatureNotice.MAY_CAUSE_CRASHES) }
|
val mergeOverlays = boolean("merge_overlays") { addNotices(FeatureNotice.UNSTABLE) }
|
||||||
val forceImageFormat = unique("force_image_format", "jpg", "png", "webp") {
|
val forceImageFormat = unique("force_image_format", "jpg", "png", "webp") {
|
||||||
addFlags(ConfigFlag.NO_TRANSLATE)
|
addFlags(ConfigFlag.NO_TRANSLATE)
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ class Experimental : ConfigContainer() {
|
|||||||
val appLockOnResume = boolean("app_lock_on_resume")
|
val appLockOnResume = boolean("app_lock_on_resume")
|
||||||
val infiniteStoryBoost = boolean("infinite_story_boost")
|
val infiniteStoryBoost = boolean("infinite_story_boost")
|
||||||
val meoPasscodeBypass = boolean("meo_passcode_bypass")
|
val meoPasscodeBypass = boolean("meo_passcode_bypass")
|
||||||
val unlimitedMultiSnap = boolean("unlimited_multi_snap") { addNotices(FeatureNotice.MAY_BAN)}
|
val unlimitedMultiSnap = boolean("unlimited_multi_snap") { addNotices(FeatureNotice.BAN_RISK)}
|
||||||
val noFriendScoreDelay = boolean("no_friend_score_delay")
|
val noFriendScoreDelay = boolean("no_friend_score_delay")
|
||||||
val addFriendSourceSpoof = unique("add_friend_source_spoof",
|
val addFriendSourceSpoof = unique("add_friend_source_spoof",
|
||||||
"added_by_username",
|
"added_by_username",
|
||||||
@ -18,5 +18,5 @@ class Experimental : ConfigContainer() {
|
|||||||
"added_by_group_chat",
|
"added_by_group_chat",
|
||||||
"added_by_qr_code",
|
"added_by_qr_code",
|
||||||
"added_by_community",
|
"added_by_community",
|
||||||
) { addNotices(FeatureNotice.MAY_BAN) }
|
) { addNotices(FeatureNotice.BAN_RISK) }
|
||||||
}
|
}
|
@ -4,11 +4,11 @@ import me.rhunk.snapenhance.core.config.ConfigContainer
|
|||||||
import me.rhunk.snapenhance.core.config.FeatureNotice
|
import me.rhunk.snapenhance.core.config.FeatureNotice
|
||||||
|
|
||||||
class Global : ConfigContainer() {
|
class Global : ConfigContainer() {
|
||||||
val snapchatPlus = boolean("snapchat_plus") { addNotices(FeatureNotice.MAY_BAN) }
|
val snapchatPlus = boolean("snapchat_plus") { addNotices(FeatureNotice.BAN_RISK) }
|
||||||
val disableMetrics = boolean("disable_metrics")
|
val disableMetrics = boolean("disable_metrics")
|
||||||
val blockAds = boolean("block_ads")
|
val blockAds = boolean("block_ads")
|
||||||
val disableVideoLengthRestrictions = boolean("disable_video_length_restrictions") { addNotices(FeatureNotice.MAY_BAN) }
|
val disableVideoLengthRestrictions = boolean("disable_video_length_restrictions") { addNotices(FeatureNotice.BAN_RISK) }
|
||||||
val disableGooglePlayDialogs = boolean("disable_google_play_dialogs")
|
val disableGooglePlayDialogs = boolean("disable_google_play_dialogs")
|
||||||
val forceMediaSourceQuality = boolean("force_media_source_quality")
|
val forceMediaSourceQuality = boolean("force_media_source_quality")
|
||||||
val disableSnapSplitting = boolean("disable_snap_splitting") { addNotices(FeatureNotice.MAY_BREAK_INTERNAL_BEHAVIOR) }
|
val disableSnapSplitting = boolean("disable_snap_splitting") { addNotices(FeatureNotice.INTERNAL_BEHAVIOR) }
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ class MessagingTweaks : ConfigContainer() {
|
|||||||
val notificationBlacklist = multiple("notification_blacklist", *NotificationType.getIncomingValues().map { it.key }.toTypedArray()) {
|
val notificationBlacklist = multiple("notification_blacklist", *NotificationType.getIncomingValues().map { it.key }.toTypedArray()) {
|
||||||
customOptionTranslationPath = "features.options.notifications"
|
customOptionTranslationPath = "features.options.notifications"
|
||||||
}
|
}
|
||||||
val messageLogger = boolean("message_logger") { addNotices(FeatureNotice.MAY_CAUSE_CRASHES) }
|
val messageLogger = boolean("message_logger") { addNotices(FeatureNotice.UNSTABLE) }
|
||||||
val galleryMediaSendOverride = boolean("gallery_media_send_override")
|
val galleryMediaSendOverride = boolean("gallery_media_send_override")
|
||||||
val messagePreviewLength = integer("message_preview_length", defaultValue = 20)
|
val messagePreviewLength = integer("message_preview_length", defaultValue = 20)
|
||||||
}
|
}
|
@ -33,6 +33,6 @@ class UserInterfaceTweaks : ConfigContainer() {
|
|||||||
"ngs_community_icon_container",
|
"ngs_community_icon_container",
|
||||||
"ngs_spotlight_icon_container",
|
"ngs_spotlight_icon_container",
|
||||||
"ngs_search_icon_container"
|
"ngs_search_icon_container"
|
||||||
) { addNotices(FeatureNotice.MAY_BREAK_INTERNAL_BEHAVIOR) }
|
) { addNotices(FeatureNotice.INTERNAL_BEHAVIOR) }
|
||||||
val storyViewerOverride = unique("story_viewer_override", "DISCOVER_PLAYBACK_SEEKBAR", "VERTICAL_STORY_VIEWER") { addNotices(FeatureNotice.UNSTABLE) }
|
val storyViewerOverride = unique("story_viewer_override", "DISCOVER_PLAYBACK_SEEKBAR", "VERTICAL_STORY_VIEWER") { addNotices(FeatureNotice.UNSTABLE) }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user