Added discord server button, updated build process.

This commit is contained in:
IQuant 2024-06-12 19:07:03 +03:00
parent 67de9c6694
commit 20c497302e
6 changed files with 24 additions and 12 deletions

View file

@ -1922,7 +1922,7 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
[[package]]
name = "noita-proxy"
version = "0.11.1"
version = "0.11.2"
dependencies = [
"bincode",
"bitcode",

View file

@ -3,7 +3,8 @@ members = ["tangled"]
[package]
name = "noita-proxy"
version = "0.11.1"
description = "Noita Entangled Worlds companion app."
version = "0.11.2"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -1,3 +0,0 @@
FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:latest
RUN apt-get update && apt-get install --assume-yes libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev

View file

@ -0,0 +1,3 @@
[toolchain]
channel = "1.77"
targets = [ "x86_64-pc-windows-gnu" ]

View file

@ -8,8 +8,8 @@ use std::{
use bitcode::{Decode, Encode};
use clipboard::{ClipboardContext, ClipboardProvider};
use eframe::egui::{
self, Align2, Button, Color32, InnerResponse, Key, Margin, Rect, RichText, TextureOptions, Ui,
Vec2,
self, Align2, Button, Color32, InnerResponse, Key, Margin, OpenUrl, Rect, RichText,
TextureOptions, Ui, Vec2,
};
use lang::{set_current_locale, tr, LANGS};
use mod_manager::{Modmanager, ModmanagerSettings};
@ -100,9 +100,9 @@ fn heading_with_underline(ui: &mut Ui, text: impl Into<RichText>) {
ui.separator();
}
fn square_button_icon(ui: &mut Ui, text: &str) -> egui::Response {
fn square_button_text(ui: &mut Ui, text: &str, size: f32) -> egui::Response {
let side = ui.available_width();
ui.add_sized([side, side], Button::new(RichText::new(text).size(21.0)))
ui.add_sized([side, side], Button::new(RichText::new(text).size(size)))
}
impl App {
@ -239,12 +239,15 @@ impl App {
.clone()
.unwrap_or_default()
.language;
if square_button_icon(ui, &lang_label.to_string().to_uppercase())
if square_button_text(ui, &lang_label.to_string().to_uppercase(), 21.0)
.on_hover_text(tr("button_set_lang"))
.clicked()
{
self.state = AppState::LangPick;
}
if square_button_text(ui, "Discord server", 10.0).clicked() {
ctx.open_url(OpenUrl::new_tab("https://discord.gg/uAK7utvVWN"));
}
let secret_active = ui.input(|i| i.modifiers.ctrl && i.key_down(Key::D));
if secret_active && ui.button("reset all data").clicked() {
self.saved_state = Default::default();

View file

@ -65,7 +65,7 @@ def make_release_assets():
os.chdir("noita-proxy")
subprocess.run(["cargo", "build", "--release"])
subprocess.run(["~/.cargo/bin/cross", "build", "--release", "--target", "x86_64-unknown-linux-gnu"])
subprocess.run(["cargo", "build", "--release", "--target", "x86_64-pc-windows-gnu"])
os.chdir("..")
@ -91,7 +91,7 @@ def make_release_assets():
print("Writing linux release...")
with ZipFile("target/noita-proxy-linux.zip", "w") as release:
release.write("noita-proxy/target/release/noita-proxy", arcname="noita_proxy.x86_64", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
release.write("noita-proxy/target/x86_64-unknown-linux-gnu/release/noita-proxy", arcname="noita_proxy.x86_64", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
release.write("target/tmp/libsteam_api.so", arcname="libsteam_api.so", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
print("Writing mod release...")
@ -137,6 +137,14 @@ def main():
else:
notes.p("No pull requests have been accepted in this release.")
notes.title("Installation")
notes.p("Download and unpack `noita-proxy-win.zip` or `noita-proxy-linux.zip`, depending on your OS. After that, launch the proxy.")
notes.p("Proxy is able to download and install the mod automatically. There is no need to download the mod (`quant.ew.zip`) manually.")
notes.p("""
You'll be prompted for a path to `noita.exe` when launching the proxy for the first time.
It should be detected automatically as long as you use steam version of the game and steam is launched.
""")
print()
notes_path = "/tmp/rnotes.md"
with open(notes_path, "w") as f: