diff --git a/README.md b/README.md index cab7e8e06..ba9747da0 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@

+ Website · Download · Screenshots · Parity status · @@ -28,7 +29,7 @@ Every subsystem matches vanilla in all 281 parity harnesses, on Linux and macOS: ## Download -**[Download the Horizon launcher](https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true)** for Linux x86-64, macOS Apple Silicon or Windows x64: take the newest `launcher-v*` release (currently [launcher-v0.1.1](https://github.com/ludovic111/horizon/releases/tag/launcher-v0.1.1)); the launcher then updates itself. The launcher is the way to get Horizon: it installs and updates the game, prepares its resources from your own copy of Minecraft, and starts the client or a dedicated server. +**[Download the Horizon launcher](https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true)** (or see [playhorizon.dev](https://playhorizon.dev)) for Linux x86-64, macOS Apple Silicon or Windows x64: take the newest `launcher-v*` release (currently [launcher-v0.1.1](https://github.com/ludovic111/horizon/releases/tag/launcher-v0.1.1)); the launcher then updates itself. The launcher is the way to get Horizon: it installs and updates the game, prepares its resources from your own copy of Minecraft, and starts the client or a dedicated server. **You need** Minecraft: Java Edition installed with the official launcher, with 26.3 played once; Python 3.10 or newer and Java 25 (a JDK, e.g. Eclipse Temurin 25) for the one-time resource preparation; and a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac. diff --git a/docs/README.md b/docs/README.md index 1abd4164a..1a4e47969 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Horizon documentation -To play, use [the launcher](../launcher/README.md). These pages are for developers. +To play, use [the launcher](../launcher/README.md); the project site is [playhorizon.dev](https://playhorizon.dev). These pages are for developers. ## Build and run diff --git a/launcher/Cargo.lock b/launcher/Cargo.lock index adb592215..2cea1ae78 100644 --- a/launcher/Cargo.lock +++ b/launcher/Cargo.lock @@ -2565,7 +2565,7 @@ dependencies = [ [[package]] name = "horizon-launcher" -version = "0.1.2" +version = "0.1.3" dependencies = [ "clap", "dirs 5.0.1", diff --git a/launcher/Cargo.toml b/launcher/Cargo.toml index 07ad45e95..b1e664c0f 100644 --- a/launcher/Cargo.toml +++ b/launcher/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "horizon-launcher" -version = "0.1.2" +version = "0.1.3" edition = "2021" license = "MIT" description = "Downloads, prepares and starts Horizon builds" diff --git a/launcher/README.md b/launcher/README.md index d7695f3de..25e9882cb 100644 --- a/launcher/README.md +++ b/launcher/README.md @@ -17,7 +17,7 @@ The opening, then Play ([clip](docs/opening.webm)): - **Play**: prepares resources as `PLAY.txt` describes (your launcher's 26.3 install, the 26.3 server jar from that version's own json, Python 3.10+ and Java 25), then starts the client, or a server (`--dedicated --nogui`) in a folder you choose, with a live console. -- **Patch notes**: each release's notes, newest first, with a link to GitHub Sponsors. A quiet "Join Discord" link sits in the sidebar footer. +- **Patch notes**: each release's notes, newest first, with a link to GitHub Sponsors. Quiet "Join Discord" and "Website" links sit in the sidebar footer. - **What's next**: the README's roadmap, from main. Data lives in the platform's data directory (`~/.local/share/horizon-launcher` on Linux, @@ -31,8 +31,8 @@ Windows): `versions//`, `server-jars/`, `server/` and `settings.json`. inside the game, so the launcher is where you return to Horizon's. It is the `menuStyle:` line of `horizon.txt` in the game's home folder (`HORIZON_HOME`, else `horizon` in the data directory), which the game reads when it starts. -- **Links**: the Discord invite and the Sponsors page come from `launcher/links.json` on main - (`{"discord": "...", "sponsor": "..."}`), so they change without a launcher release. Offline, +- **Links**: the Discord invite, the Sponsors page and the website come from `launcher/links.json` on main + (`{"discord": "...", "sponsor": "...", "website": "..."}`), so they change without a launcher release. Offline, the launcher uses the same values built in; an empty address hides its button. ## Updates @@ -63,7 +63,7 @@ The same binary is a command-line tool; without a subcommand it opens the window horizon-launcher server [--dir

] [--version ] [--accept-eula] horizon-launcher notes [] patch notes as plain text horizon-launcher next the roadmap - horizon-launcher links the Discord and sponsor links + horizon-launcher links the Discord, sponsor and website links horizon-launcher menu-style [horizon|classic] show or set the game's menu style horizon-launcher update [--check] Horizon and the launcher diff --git a/launcher/links.json b/launcher/links.json index 85a79dee6..c603d840e 100644 --- a/launcher/links.json +++ b/launcher/links.json @@ -1 +1 @@ -{"discord": "https://discord.gg/HcTeMZxe5E", "sponsor": "https://github.com/sponsors/ludovic111"} +{"discord": "https://discord.gg/HcTeMZxe5E", "sponsor": "https://github.com/sponsors/ludovic111", "website": "https://playhorizon.dev"} diff --git a/launcher/src/backend.rs b/launcher/src/backend.rs index c9e266a09..4cb0a453f 100644 --- a/launcher/src/backend.rs +++ b/launcher/src/backend.rs @@ -162,18 +162,19 @@ pub fn roadmap() -> Result { Err("The README has no roadmap section yet.".into()) } -/// The community and sponsor links, from `launcher/links.json` on main, so they can change +/// The community, sponsor and website links, from `launcher/links.json` on main, so they can change /// without a launcher release. An empty address hides its button. #[derive(Clone, Debug, PartialEq, serde::Serialize)] pub struct Links { pub discord: String, pub sponsor: String, + pub website: String, } impl Default for Links { /// What the launcher uses until (or unless) it can read links.json. fn default() -> Self { - Self { discord: "https://discord.gg/HcTeMZxe5E".into(), sponsor: "https://github.com/sponsors/ludovic111".into() } + Self { discord: "https://discord.gg/HcTeMZxe5E".into(), sponsor: "https://github.com/sponsors/ludovic111".into(), website: "https://playhorizon.dev".into() } } } @@ -183,7 +184,7 @@ impl Links { pub fn parse(text: &str) -> Self { let mut links = Self::default(); if let Ok(serde_json::Value::Object(map)) = serde_json::from_str(text) { - for (key, slot) in [("discord", &mut links.discord), ("sponsor", &mut links.sponsor)] { + for (key, slot) in [("discord", &mut links.discord), ("sponsor", &mut links.sponsor), ("website", &mut links.website)] { if let Some(url) = map.get(key).and_then(|v| v.as_str()) { *slot = url.trim().to_string(); } @@ -979,8 +980,9 @@ mod tests { let defaults = Links::default(); assert_eq!(defaults.discord, "https://discord.gg/HcTeMZxe5E"); assert_eq!(defaults.sponsor, "https://github.com/sponsors/ludovic111"); + assert_eq!(defaults.website, "https://playhorizon.dev"); // The file on main says the same thing as the defaults. - let file = Links::parse(r#"{"discord": "https://discord.gg/HcTeMZxe5E", "sponsor": "https://github.com/sponsors/ludovic111"}"#); + let file = Links::parse(r#"{"discord": "https://discord.gg/HcTeMZxe5E", "sponsor": "https://github.com/sponsors/ludovic111", "website": "https://playhorizon.dev"}"#); assert_eq!(file, defaults); // Unreadable or missing, offline included: the defaults. assert_eq!(Links::parse(""), defaults); @@ -989,7 +991,9 @@ mod tests { assert_eq!(Links::parse(r#"{"discord": 5}"#), defaults); // A key that is missing keeps its default; a new address replaces it; empty hides it. assert_eq!(Links::parse(r#"{"discord": "https://x.y/z"}"#), Links { discord: "https://x.y/z".into(), ..defaults.clone() }); - assert_eq!(Links::parse(r#"{"discord": "", "sponsor": " "}"#), Links { discord: String::new(), sponsor: String::new() }); + assert_eq!(Links::parse(r#"{"discord": "", "sponsor": " "}"#), Links { discord: String::new(), sponsor: String::new(), ..defaults.clone() }); + // A key this launcher does not know is ignored. + assert_eq!(Links::parse(r#"{"mastodon": "https://x.y/z"}"#), defaults); } #[test] diff --git a/launcher/src/cli.rs b/launcher/src/cli.rs index 1c2cd76be..83557b4fc 100644 --- a/launcher/src/cli.rs +++ b/launcher/src/cli.rs @@ -57,7 +57,7 @@ enum Cmd { Notes { tag: Option }, /// Show the roadmap Next, - /// Show the Discord and sponsor links + /// Show the Discord, sponsor and website links Links, /// Show or set the game's menu style (classic is vanilla's own screens) MenuStyle { @@ -211,7 +211,7 @@ fn execute(command: Cmd, as_json: bool) -> Result<(), String> { if as_json { json(serde_json::to_value(&links).unwrap()); } else { - for (name, url) in [("Discord", &links.discord), ("Sponsor", &links.sponsor)] { + for (name, url) in [("Discord", &links.discord), ("Sponsor", &links.sponsor), ("Website", &links.website)] { println!("{name:<8} {}", if url.is_empty() { "(none)" } else { url }); } } diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 188bd5c49..402fc3989 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -124,7 +124,7 @@ struct Launcher { confirm_remove: Option, picker_open: bool, settings: Settings, - /// The Discord and sponsor links: built in until links.json on main has been read. + /// The Discord, sponsor and website links: built in until links.json on main has been read. links: backend::Links, menu_style: backend::MenuStyle, preparing: bool, @@ -775,6 +775,17 @@ impl Launcher { .child("Join Discord") .on_click(move |_, _, cx| cx.open_url(&url)) }); + let website = (!self.links.website.is_empty()).then(|| { + let url = self.links.website.clone(); + div() + .id("website") + .mb(px(4.)) + .text_color(t.muted) + .cursor_pointer() + .hover(move |s| s.text_color(t.text)) + .child("Website") + .on_click(move |_, _, cx| cx.open_url(&url)) + }); div() .flex() .flex_col() @@ -797,7 +808,7 @@ impl Launcher { ) .child(nav) .child(div().flex_1()) - .child(div().px(px(10.)).text_size(px(theme::SMALL)).text_color(t.faint).children(discord).child(footer)) + .child(div().px(px(10.)).text_size(px(theme::SMALL)).text_color(t.faint).children(discord).children(website).child(footer)) } fn segmented(&self, cx: &mut Context) -> Div { diff --git a/launcher/src/mcp.rs b/launcher/src/mcp.rs index 64ef322e7..b712812a6 100644 --- a/launcher/src/mcp.rs +++ b/launcher/src/mcp.rs @@ -38,7 +38,7 @@ fn tools() -> Value { { "name": "patch_notes", "description": "A release's patch notes as markdown.", "inputSchema": { "type": "object", "properties": { "tag": { "type": "string", "description": "Default: the newest release." } } } }, { "name": "roadmap", "description": "What's planned next for Horizon, from the README's roadmap.", "inputSchema": none }, - { "name": "links", "description": "The Horizon community links: the Discord invite and the GitHub Sponsors page (an empty one is not offered).", "inputSchema": none }, + { "name": "links", "description": "The Horizon links: the Discord invite, the GitHub Sponsors page and the website (an empty one is not offered).", "inputSchema": none }, { "name": "menu_style", "description": "Show or set the game's menu style. \"horizon\" is Horizon's own menus, \"classic\" is vanilla's screens, which have no way back inside the game. The game reads it when it starts.", "inputSchema": { "type": "object", "properties": { "style": { "type": "string", "enum": ["horizon", "classic"], "description": "Omit to show the current style." } } } }, { "name": "check_updates", "description": "Check GitHub for a Horizon release newer than every installed version, and for a newer launcher.", "inputSchema": none }, diff --git a/packaging/PLAY.txt b/packaging/PLAY.txt index 7477ddf6b..292656c55 100644 --- a/packaging/PLAY.txt +++ b/packaging/PLAY.txt @@ -14,6 +14,7 @@ Playing through the Horizon launcher Downloaded this archive directly? Get the launcher instead; it installs, prepares and updates Horizon for you: https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true + More about Horizon: https://playhorizon.dev To prepare this folder by hand you need Minecraft Java Edition 26.3, played once from the official launcher, Python 3.10+ and Java 25 (a JDK). Then,