add hide-live-chat-button, hide-next-button , hide-prev-button patches (player controller)

This commit is contained in:
inotia00
2023-01-27 19:28:11 +09:00
parent 2c1fe86a60
commit 96d8f6b02b
7 changed files with 211 additions and 0 deletions

View File

@ -0,0 +1,49 @@
package app.revanced.patches.youtube.layout.player.livechatbutton.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.shared.annotation.YouTubeCompatibility
import app.revanced.shared.patches.playerbutton.PlayerButtonPatch
import app.revanced.shared.util.resources.ResourceHelper
@Patch
@Name("hide-live-chat-button")
@Description("Hides the live chat button in the video player.")
@DependsOn(
[
PlayerButtonPatch::class,
SettingsPatch::class
]
)
@YouTubeCompatibility
@Version("0.0.1")
class HideLiveChatButtonPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
/*
add settings
*/
ResourceHelper.addSettings2(
context,
"PREFERENCE_CATEGORY: REVANCED_SETTINGS",
"PREFERENCE: LAYOUT_SETTINGS",
"PREFERENCE_HEADER: PLAYER",
"SETTINGS: HIDE_LIVE_CHAT_BUTTON"
)
ResourceHelper.patchSuccess(
context,
"hide-live-chat-button"
)
return PatchResultSuccess()
}
}

View File

@ -0,0 +1,50 @@
package app.revanced.patches.youtube.layout.player.nextprevbutton.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.shared.annotation.YouTubeCompatibility
import app.revanced.shared.patches.playerbutton.PlayerButtonPatch
import app.revanced.shared.util.resources.ResourceHelper
@Patch
@Name("hide-next-prev-button")
@Description("Hides the next prev button in the player controller.")
@DependsOn(
[
PlayerButtonPatch::class,
SettingsPatch::class
]
)
@YouTubeCompatibility
@Version("0.0.1")
class HideNextPrevButtonPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
/*
add settings
*/
ResourceHelper.addSettings3(
context,
"PREFERENCE_CATEGORY: REVANCED_SETTINGS",
"PREFERENCE: LAYOUT_SETTINGS",
"PREFERENCE_HEADER: PLAYER",
"SETTINGS: HIDE_NEXT_BUTTON",
"SETTINGS: HIDE_PREV_BUTTON"
)
ResourceHelper.patchSuccess(
context,
"hide-next-prev-button"
)
return PatchResultSuccess()
}
}