diff --git a/docs/mod-browser.md b/docs/mod-browser.md index bc7a80b16..6601fea70 100644 --- a/docs/mod-browser.md +++ b/docs/mod-browser.md @@ -1,6 +1,6 @@ # The launcher's mod browser -Search Modrinth (and CurseForge, once the launcher has a key) for Java mods, modpacks, resource packs and shader +Search Modrinth (CurseForge support is coming soon) for Java mods, modpacks, resource packs and shader packs, see how well each one runs before installing it, and install it with its checksum checked. This is item 16 of the roadmap and issue #577. The code is in `launcher/src/browser.rs` and `launcher/src/browser/`. @@ -63,8 +63,8 @@ off. ## The Mods page -The launcher's **Mods** page has the four kinds as tabs (Mods, Modpacks, Resource packs, Shader packs), a search field (Enter searches), **Show everything** and, -once CurseForge is set up, a Modrinth / CurseForge switch. Each result is an index row: its summary, author, +The launcher's **Mods** page has the four kinds as tabs (Mods, Modpacks, Resource packs, Shader packs), a search field (Enter searches), **Show everything** and +the source: Modrinth, with **CurseForge (coming soon)** beside it, disabled. Each result is an index row: its summary, author, downloads, source and licence, how well it runs (and why), **Page** (the project's page on its source) and **Install** (**Import** for a modpack). The Modpacks tab lists the imported packs first, with their coverage report, **Port** and **Play** ([modpacks.md](modpacks.md)). Installed packs are listed above the results with their version, source, @@ -102,21 +102,13 @@ horizon-launcher mods remove faithful-32x **Modrinth.** The public API (`api.modrinth.com/v2`) needs no key. The launcher names itself in its user agent, as Modrinth asks. -### CurseForge +### CurseForge (coming soon) -CurseForge's API (`api.curseforge.com/v1`) needs an API key from its developer console. Ludovic approved CurseForge -for the browser on 2026-10-21; the key is his (agents never sign up for him). Until a key exists the CurseForge source -is off and the browser searches Modrinth only. +CurseForge support is coming soon. Its API (`api.curseforge.com/v1`) needs a paid key, so for now the launcher +doesn't use it: the Mods page shows **CurseForge (coming soon)** beside the Modrinth switch, disabled, and no search +or install goes to CurseForge (`browser::sources()` is Modrinth only; `horizon-launcher mods ... --source curseforge` +says it is coming soon). The CurseForge source (`browser/curseforge.rs`) is kept for when it comes. -To turn it on: - -1. Ludovic gets a key at (sign in, API keys). CurseForge's terms for a launcher - that ships the key apply: the key is built into the binary, so anyone with the binary can read it. -2. He stores it in the 1Password **Agents** vault as an item `CurseForge API`, field `credential`. -3. It goes into the repository secret `HORIZON_CURSEFORGE_API_KEY` - (`~/fleet/op read "op://Agents/CurseForge API/credential" | gh secret set HORIZON_CURSEFORGE_API_KEY`). - The launcher workflow passes it to the build, which builds it in (`option_env!`). - -At run time `HORIZON_CURSEFORGE_API_KEY` in the environment overrides the built-in key; empty means none. A file -whose author allows downloads from CurseForge's own site only (no `downloadUrl` in the API) is shown but can't be -installed. +A CurseForge modpack zip or instance the player already has still imports, since that needs no key: its jars come +from the player's installed instance or, when Modrinth has the same file, from Modrinth. A jar only CurseForge serves +is listed under the pack as "CurseForge downloads coming soon". diff --git a/launcher/README.md b/launcher/README.md index 08ec11f98..85b74e6aa 100644 --- a/launcher/README.md +++ b/launcher/README.md @@ -24,10 +24,10 @@ The opening, then Play ([clip](docs/opening.webm)): preparation reuses checksum-verified game jars and libraries from the current or another installed Horizon version, so the original Minecraft install is only required when no valid imported copy exists. -- **Mods**: search Modrinth (and CurseForge once the launcher has its API key) for resource +- **Mods**: search Modrinth (CurseForge support is coming soon) for resource packs, Iris/OptiFine shader packs and modpacks, each marked Works, Partly or Doesn't run in Horizon; Java mod jars are never offered. Install puts a pack and what it needs in - `resourcepacks/` or `shaderpacks/` only after its SHA-512 (SHA-1 on CurseForge) matches, and a + `resourcepacks/` or `shaderpacks/` only after its SHA-512 matches, and a modpack goes to the Modpacks page; installed packs show their source and checksum, with Update and Remove ([docs/mod-browser.md](../docs/mod-browser.md)). - **Modpacks**: import a Java modpack (a Modrinth `.mrpack`, a CurseForge zip, or a Prism, @@ -35,8 +35,8 @@ The opening, then Play ([clip](docs/opening.webm)): not yet or not needed, with the reason ([docs/modpacks.md](../docs/modpacks.md)). **Port** gets the jars of what this computer can port today (content mods with data and assets only) the player's own way: copied from a folder they have, or downloaded from the pack's own links - or the same file on Modrinth's CDN, hash checked; files only CurseForge has need its API key, so - they come from your installed instance. It carries them over for the selected version, and + or the same file on Modrinth's CDN, hash checked; files only CurseForge has come from your + installed instance (CurseForge downloads are coming soon). It carries them over for the selected version, and **Play** starts the game as the pack's own profile (`ports//home/` in the game's home: its own saves and options) with those mods. Nothing is uploaded or shared: mod jars and ports stay on this computer. @@ -155,7 +155,7 @@ The same binary is a command-line tool; without a subcommand it opens the window horizon-launcher modpack play [--version ] play it as its own profile horizon-launcher modpack remove horizon-launcher mods [list] what the mod browser installed (docs/mod-browser.md) - horizon-launcher mods search [--kind resource|shader|modpack] [--everything] [--source modrinth|curseforge] + horizon-launcher mods search [--kind resource|shader|modpack] [--everything] [--source modrinth] horizon-launcher mods install checksum checked, with what it needs; a modpack is imported horizon-launcher mods update [] [--check] horizon-launcher mods remove diff --git a/launcher/src/browser.rs b/launcher/src/browser.rs index b8248fd7c..c4a6ff726 100644 --- a/launcher/src/browser.rs +++ b/launcher/src/browser.rs @@ -1,4 +1,4 @@ -//! The mod browser's sources: search Modrinth (and CurseForge, once a key exists) for what +//! The mod browser's sources: search Modrinth (CurseForge support is coming soon) for what //! Horizon loads, say how well each result runs, and download a file only after its checksum //! matches (docs/mod-browser.md). //! @@ -221,13 +221,13 @@ pub trait Source: Send + Sync { } } -/// The sources this launcher can use: Modrinth always, CurseForge when it has an API key. +/// What the launcher says wherever CurseForge would be. +pub const CURSEFORGE_SOON: &str = "CurseForge support is coming soon."; + +/// The sources this launcher uses: Modrinth. CurseForge support is coming soon: its API needs a +/// paid key, so no search or install goes to it; `curseforge` is kept for then. pub fn sources() -> Vec> { - let mut all: Vec> = vec![Box::new(modrinth::Modrinth)]; - if let Some(cf) = curseforge::CurseForge::from_env() { - all.push(Box::new(cf)); - } - all + vec![Box::new(modrinth::Modrinth)] } /// The source of that id, when this launcher can use it. diff --git a/launcher/src/browser/tests.rs b/launcher/src/browser/tests.rs index 9e75c55a1..2137ecc94 100644 --- a/launcher/src/browser/tests.rs +++ b/launcher/src/browser/tests.rs @@ -400,3 +400,10 @@ fn live_modrinth_search_pick_and_download() { std::fs::remove_dir_all(&dir).unwrap(); assert_eq!(source.project(&p.id).unwrap().slug, p.slug); } + +#[test] +fn curseforge_is_coming_soon_and_never_searched() { + let ids: Vec = sources().iter().map(|s| s.id()).collect(); + assert_eq!(ids, [SourceId::Modrinth]); + assert!(source(SourceId::CurseForge).is_none()); +} diff --git a/launcher/src/cli.rs b/launcher/src/cli.rs index 530d220dd..ebcc95cd6 100644 --- a/launcher/src/cli.rs +++ b/launcher/src/cli.rs @@ -212,6 +212,7 @@ enum KindArg { #[derive(Clone, Copy, clap::ValueEnum)] enum SourceArg { Modrinth, + /// CurseForge support is coming soon Curseforge, } @@ -222,9 +223,7 @@ impl SourceArg { SourceArg::Modrinth => SourceId::Modrinth, SourceArg::Curseforge => SourceId::CurseForge, }; - browser::source(id).ok_or_else(|| { - "CurseForge needs an API key: HORIZON_CURSEFORGE_API_KEY (docs/mod-browser.md).".into() - }) + browser::source(id).ok_or_else(|| browser::CURSEFORGE_SOON.into()) } } @@ -337,8 +336,9 @@ enum Cmd { #[command(subcommand)] action: Option, }, - /// The mod browser: resource packs, shader packs and modpacks from Modrinth (and CurseForge - /// with a key), each file checked against its checksum (docs/mod-browser.md) + /// The mod browser: Java mods, resource packs, shader packs and modpacks from Modrinth + /// (CurseForge support is coming soon), each file checked against its checksum + /// (docs/mod-browser.md) Mods { #[command(subcommand)] action: Option, diff --git a/launcher/src/modpacks.rs b/launcher/src/modpacks.rs index b69ff0976..2495e1ad6 100644 --- a/launcher/src/modpacks.rs +++ b/launcher/src/modpacks.rs @@ -84,7 +84,8 @@ impl Imported { (How::Present, "already here"), ( How::NeedsKey, - "only on CurseForge (needs its API key: choose your installed instance instead)", + "only on CurseForge (CurseForge downloads coming soon: choose your installed \ + instance instead)", ), (How::NotFound, "not found"), (How::Failed, "failed"), diff --git a/launcher/src/mods_page.rs b/launcher/src/mods_page.rs index 136ca7953..fd6a24b76 100644 --- a/launcher/src/mods_page.rs +++ b/launcher/src/mods_page.rs @@ -1,12 +1,11 @@ -//! The Mods page: search Modrinth (and CurseForge with a key) for Java mods, modpacks, resource +//! The Mods page: search Modrinth (CurseForge: coming soon) for Java mods, modpacks, resource //! packs and shader packs, see where each comes from and how well it runs (a Java mod's jar is //! checked first), install it with its checksum checked, and update or remove what was installed //! (`horizon_launcher::browser`). Imported modpacks are listed on its Modpacks tab. use super::servers_page::{type_key, Key}; use super::*; use horizon_launcher::browser::{ - self, curseforge::CurseForge, installed, java, Kind as PackKind, Project, Query, SourceId, - Support, + self, installed, java, Kind as PackKind, Project, Query, SourceId, Support, }; use horizon_launcher::modpacks; use horizon_port_pack::check::Check; @@ -20,10 +19,8 @@ const KINDS: [(PackKind, &str); 4] = [ ]; /// Java mods checked at once. const CHECKING: usize = 2; -const SOURCES: [(SourceId, &str); 2] = [ - (SourceId::Modrinth, "Modrinth"), - (SourceId::CurseForge, "CurseForge"), -]; +/// The sources to pick from; CurseForge is shown beside them as coming soon. +const SOURCES: [(SourceId, &str); 1] = [(SourceId::Modrinth, "Modrinth")]; const PAGE: usize = 20; pub(super) enum Event { @@ -46,7 +43,6 @@ pub(super) enum Checking { pub(super) struct Mods { kind: PackKind, source: SourceId, - curseforge: bool, text: String, focus: FocusHandle, pub(super) focused: bool, @@ -77,7 +73,6 @@ impl Mods { Self { kind: PackKind::Mod, source: SourceId::Modrinth, - curseforge: CurseForge::from_env().is_some(), text: String::new(), focus: cx.focus_handle().tab_index(0).tab_stop(true), focused: false, @@ -458,8 +453,14 @@ impl Launcher { this.mods_search(0); cx.notify(); })); - let source_note = if self.mods.curseforge { - segments("mods-source", &SOURCES, self.mods.source, &t, { + // CurseForge support is coming soon: shown, inert, never searched (like the Microsoft + // account's "Coming soon"). + let source_note = div() + .flex() + .flex_wrap() + .items_center() + .gap(px(8.)) + .child(segments("mods-source", &SOURCES, self.mods.source, &t, { let this = this.clone(); move |source, _, cx| { let _ = this.update(cx, |this, cx| { @@ -470,14 +471,13 @@ impl Launcher { cx.notify(); }); } - }) - .into_any_element() - } else { - text(theme::CAPTION) - .text_color(t.muted) - .child("From Modrinth. CurseForge comes once the launcher has its API key.") - .into_any_element() - }; + })) + .child(disabled(button( + "mods-source-curseforge", + "CurseForge (coming soon)", + Kind::Ghost, + &t, + ))); let controls = div() .flex() .flex_col() diff --git a/website/docs/modpacks.md b/website/docs/modpacks.md index b78c59851..e3ed053d9 100644 --- a/website/docs/modpacks.md +++ b/website/docs/modpacks.md @@ -10,7 +10,7 @@ Open **Modpacks** in the launcher. (From the next launcher release, it is the ** 1. **Import a pack.** Choose **Import a pack file…** for a Modrinth `.mrpack` or a CurseForge zip, or **Import an instance folder…** for a Prism, MultiMC or CurseForge instance. The **Mods** page can also find a Modrinth modpack and import it for you (see [Mods and data packs](/docs/mods#finding-resource-packs-shader-packs-and-modpacks)). 2. **Read the coverage report.** For every mod in the pack it says **Ported**, **Partial**, **Not yet** or **Not needed**, with the reason. You can filter the list by status. -3. **Port.** **Port N mods** gets the jars of the mods this computer can carry over today, and carries them over for the version you picked. It copies the jars from a folder you have, or downloads them from the pack's own links (or the same file from Modrinth's download network), and checks their hashes. Files that only CurseForge has need CurseForge's API key, so for those choose **Use jars from my instance…** and point it at your installed instance. +3. **Port.** **Port N mods** gets the jars of the mods this computer can carry over today, and carries them over for the version you picked. It copies the jars from a folder you have, or downloads them from the pack's own links (or the same file from Modrinth's download network), and checks their hashes. CurseForge downloads are coming soon, so for files that only CurseForge has, choose **Use jars from my instance…** and point it at your installed instance. 4. **Play.** **Play with N mods** starts the game as the pack's own profile, with its own saves and options, and those mods on. Nothing is uploaded or shared. The mod jars and what is made from them stay on your computer. diff --git a/website/docs/mods.md b/website/docs/mods.md index d3305fa69..b0bd8c31f 100644 --- a/website/docs/mods.md +++ b/website/docs/mods.md @@ -36,7 +36,7 @@ cargo horizon-mod run The launcher's **Mods** page (launcher 0.17 and newer) searches [Modrinth](https://modrinth.com) for what Horizon can load: resource packs, Java shader packs and modpacks. Each result says how well it runs in Horizon (**Works**, **Partly**, or **Doesn't run**), and by default the page shows only what runs. **Install** downloads the file, checks it against the checksum Modrinth lists and refuses anything that does not match, then puts it in the right folder, with the packs it needs. **Update** and **Remove** are there too. A resource pack still has to be turned on in the game's Resource Packs screen, and a shader pack in Video, Shader Packs. A modpack is imported on the [Modpacks page](/docs/modpacks). -The page cannot search CurseForge yet. The same things work from a terminal: `horizon-launcher mods search`, `install`, `update` and `remove`. +CurseForge support is coming soon: the page shows it, but doesn't search it yet. The same things work from a terminal: `horizon-launcher mods search`, `install`, `update` and `remove`. ## Java mods from the Mods page (next launcher release)