Mod browser: CurseForge is coming soon
Ludovic dropped CurseForge for now (its API needs a paid key). The Mods page shows "CurseForge (coming soon)" beside the Modrinth switch, disabled and inert; browser::sources() is Modrinth only, so no search or install goes to CurseForge, and `--source curseforge` says it is coming soon. Text that asked for a key or an environment variable now says CurseForge support is coming soon. Importing a CurseForge zip or instance still works; jars only CurseForge serves are listed as "CurseForge downloads coming soon". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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<Box<dyn Source>> {
|
||||
let mut all: Vec<Box<dyn Source>> = 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.
|
||||
|
||||
@@ -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<SourceId> = sources().iter().map(|s| s.id()).collect();
|
||||
assert_eq!(ids, [SourceId::Modrinth]);
|
||||
assert!(source(SourceId::CurseForge).is_none());
|
||||
}
|
||||
|
||||
+5
-5
@@ -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<ModpackCmd>,
|
||||
},
|
||||
/// 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<ModsCmd>,
|
||||
|
||||
@@ -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"),
|
||||
|
||||
+19
-19
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user