Skip to content

Commit

Permalink
Add option for link
Browse files Browse the repository at this point in the history
  • Loading branch information
DeDiamondPro committed Dec 8, 2024
1 parent 1fe816c commit fb2b7b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import java.io.File
class Config {
var defaultService: String = ModrinthService.getName()
var fullResThumbnail: Boolean = false
var openLinkInResourcify: Boolean = true
var adsEnabled: Boolean = true
var resourcePacksEnabled: Boolean = true
var dataPacksEnabled: Boolean = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ class SettingsPage() : PaginatedScreen(adaptScale = false) {
Config.instance.fullResThumbnail = it
}

// Open links in Resourcify
addCheckBoxOption("resourcify.config.open_link", Config.instance.openLinkInResourcify) {
Config.instance.openLinkInResourcify = it
}

// Ads
addCheckBoxOption("resourcify.config.ads", Config.instance.adsEnabled) {
Config.instance.adsEnabled = it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package dev.dediamondpro.resourcify.util

import dev.dediamondpro.minemark.providers.BrowserProvider
import dev.dediamondpro.resourcify.config.Config
import dev.dediamondpro.resourcify.gui.ConfirmLinkScreen
import dev.dediamondpro.resourcify.gui.projectpage.ProjectScreen
import dev.dediamondpro.resourcify.services.ProjectType
Expand All @@ -37,7 +38,7 @@ object ConfirmingBrowserProvider : BrowserProvider {
}

val screen = UScreen.currentScreen
if (screen is ProjectScreen && tryCreateScreen(actualUrl, screen)) {
if (Config.instance.openLinkInResourcify && screen is ProjectScreen && tryCreateScreen(actualUrl, screen)) {
return // We have opened this in a ProjectScreen
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/resourcify/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"resourcify.config.source.description": "The source that will be enabled by default when opening the browse page.",
"resourcify.config.thumbnail.title": "Full-Resolution Thumbnails",
"resourcify.config.thumbnail.description": "Use full-resolution images in thumbnails when available instead of using a lower resolution picture, will cause some things like the gallery to load significantly slower.",
"resourcify.config.open_link.title": "Open Links In Resourcify",
"resourcify.config.open_link.description": "When possible, if you click a link that can be opened in Resourcify (like a modrinth project page), this linked will be opened in Resourcify.",
"resourcify.config.resource-pack.title": "Enable Resource Pack Browsing",
"resourcify.config.resource-pack.description": "Show the browse and update button in the resource pack screen.",
"resourcify.config.data-pack.title": "Enable Data Pack Browsing",
Expand Down

0 comments on commit fb2b7b2

Please sign in to comment.