{
+ let row = div().flex().items_center().gap(px(2.));
+ Some(match horizon::rating(id)? {
+ None => row.text_color(t.muted).child("No ratings yet"),
+ Some(r) => {
+ let lit = r.average.round() as usize;
+ row.children((0..5).map(|i| {
+ blocks::icon(
+ "star",
+ 12.,
+ if i < lit {
+ t.warn
+ } else {
+ t.muted.opacity(0.6)
+ },
+ )
+ }))
+ .child(div().ml(px(4.)).child(format!(
+ "{:.1} ({})",
+ r.average,
+ count(r.count)
+ )))
+ }
+ })
+}
+
/// A checksum as the page shows it: the algorithm and the first and last hex digits.
fn short_sum(checksum: &str) -> String {
let (algo, hex) = checksum.split_once(':').unwrap_or(("", checksum));
@@ -968,9 +996,7 @@ impl Launcher {
if !p.author.is_empty() {
by.push(format!("by {}", p.author));
}
- if p.source != SourceId::Horizon {
- by.push(format!("{} downloads", count(p.downloads)));
- }
+ by.push(format!("{} downloads", count(p.downloads)));
by.push(format!("from {}", p.source.label()));
if !p.license.is_empty() {
by.push(p.license.clone());
@@ -980,6 +1006,11 @@ impl Launcher {
.flex_col()
.child(div().truncate().child(p.summary.clone()))
.child(by.join(" · "))
+ .children(
+ (p.source == SourceId::Horizon)
+ .then(|| stars(&p.id, &t))
+ .flatten(),
+ )
.children(
support
.reason()
diff --git a/launcher/src/mods_project.rs b/launcher/src/mods_project.rs
index 97d23e0aa..72a95b142 100644
--- a/launcher/src/mods_project.rs
+++ b/launcher/src/mods_project.rs
@@ -491,6 +491,21 @@ impl Launcher {
.gap(px(24.))
.child(div().flex().child(back))
.child(head);
+ // Registry projects are rated on the site, signed in with GitHub (one rating per account).
+ if p.source == SourceId::Horizon {
+ let url = browser::horizon::rate_url(&p.id);
+ page = page.child(
+ div()
+ .flex()
+ .items_center()
+ .gap(px(16.))
+ .children(super::mods_page::stars(&p.id, &t).map(|s| text(theme::UI).child(s)))
+ .child(
+ button("mods-rate", "Sign in with GitHub to rate", Kind::Ghost, &t)
+ .on_click(move |_, _, cx| cx.open_url(&url)),
+ ),
+ );
+ }
if let Some(why) = support.reason() {
page = page.child(
text(theme::UI)
diff --git a/launcher/src/partner.rs b/launcher/src/partner.rs
new file mode 100644
index 000000000..eea1a3524
--- /dev/null
+++ b/launcher/src/partner.rs
@@ -0,0 +1,64 @@
+//! Sculk's banner: a server host that sponsors Horizon (Ludovic, 2026-10-26), on the Servers page
+//! and under Home's rows. The picture is in the binary, never fetched; a click opens Sculk's page in
+//! the browser. A "Partner" label above it says it is an ad.
+use crate::theme::Theme;
+use gpui::{div, img, prelude::*, px, ClickEvent, Div, Image, ImageFormat, Stateful};
+use std::sync::{Arc, LazyLock};
+
+pub const URL: &str = "https://my.sculkhosting.com/ref/horizon";
+
+/// 1200×441: twice the widest it is shown at, for Retina screens. Its transparent edges let the
+/// characters stand out of the card.
+const WIDTH: f32 = 1200.;
+const HEIGHT: f32 = 441.;
+static BANNER: LazyLock
> = LazyLock::new(|| {
+ Arc::new(Image::from_bytes(
+ ImageFormat::Webp,
+ include_bytes!("../assets/sculk-banner.webp").to_vec(),
+ ))
+});
+
+/// The banner `width` logical pixels wide, under its label. Hovering lifts it a little and turns the
+/// label to ink. The narrowest window (960) leaves the page 648 pixels, so it always fits.
+pub fn banner(id: &'static str, width: f32, t: &Theme) -> Stateful {
+ let t = *t;
+ let el = div()
+ .id(id)
+ .group(id)
+ .flex()
+ .flex_col()
+ .gap(px(8.))
+ .w(px(width))
+ .cursor_pointer()
+ .child(
+ crate::text(crate::theme::MICRO)
+ .text_color(t.muted)
+ .group_hover(id, move |s| s.text_color(t.ink))
+ .child("PARTNER"),
+ )
+ .child(
+ div().relative().group_hover(id, |s| s.top(px(-2.))).child(
+ img(BANNER.clone())
+ .w(px(width))
+ .h(px(width * HEIGHT / WIDTH)),
+ ),
+ )
+ .on_click(|_: &ClickEvent, _, cx| cx.open_url(URL));
+ crate::keyboard(el, &t)
+}
+
+#[cfg(test)]
+mod tests {
+ use super::{HEIGHT, WIDTH};
+
+ #[test]
+ fn the_bundled_banner_decodes() {
+ let bytes = include_bytes!("../assets/sculk-banner.webp");
+ let banner = image::load_from_memory_with_format(bytes, image::ImageFormat::WebP)
+ .expect("the banner is a WebP");
+ assert_eq!(
+ (banner.width(), banner.height()),
+ (WIDTH as u32, HEIGHT as u32)
+ );
+ }
+}
diff --git a/launcher/src/proxy.rs b/launcher/src/proxy.rs
new file mode 100644
index 000000000..8d6493456
--- /dev/null
+++ b/launcher/src/proxy.rs
@@ -0,0 +1,140 @@
+//! The proxy every download and request goes through, when the player needs one: a school's or an
+//! office's, or a country where a host is unreachable. The Settings page's Proxy row (kept as
+//! `proxy` in `settings.json`) wins; without it the usual `HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY`
+//! and `NO_PROXY` variables apply, so a launcher started from a shell that has them needs nothing.
+//!
+//! What goes through it: Horizon's releases and the launcher's own update, Minecraft's files and
+//! Java from Mojang, Modrinth, CurseForge, Horizon's mod registry, pictures, Microsoft sign-in,
+//! Tailscale's API, and the jars a modpack import downloads. A local address never does, and the
+//! Servers page's calls to a game server's API (`servers.rs`) build their agent without it: they
+//! are on loopback and asked every second.
+//!
+//! Which hosts are reached directly, and how an address is read, are `horizon-port-pack`'s rules
+//! (`crates/horizon-port-pack/src/net.rs`): the jars an import fetches are downloaded there, and
+//! the same hosts have to be left alone on both sides. This module adds what is the launcher's
+//! own — the setting in `settings.json`, kept in memory so a request doesn't read the file — and
+//! hands the address to the parts that build their agents.
+use crate::backend::Settings;
+use std::sync::Mutex;
+
+/// The launcher's setting, as `announce` last read it, or None before it has: a request shouldn't
+/// read `settings.json` every time, and an import fetches hundreds of jars.
+static SET: Mutex