add button for netplay discord (#452)

This commit is contained in:
Logan McNaughton 2025-06-28 14:19:50 +02:00 committed by GitHub
parent 3183a5eb0b
commit 11830b0222
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View File

@ -87,6 +87,10 @@ fn netplay_window(app: &AppWindow, controller_paths: &[Option<String>]) {
})
.unwrap();
});
app.on_netplay_discord_button_clicked(move || {
open::that_detached("https://discord.gg/JyW6ZgBUyS").unwrap();
});
}
fn local_game_window(app: &AppWindow, controller_paths: &[Option<String>]) {

View File

@ -26,6 +26,7 @@ export component AppWindow inherits Window {
callback input_profile_button_clicked;
callback create_session_button_clicked;
callback join_session_button_clicked;
callback netplay_discord_button_clicked;
in property version <=> AboutData.version;
in property has_update <=> AboutData.has_update;
in-out property integer_scaling <=> SettingsData.integer_scaling;
@ -83,6 +84,9 @@ export component AppWindow inherits Window {
join_session_button_clicked => {
join_session_button_clicked();
}
netplay_discord_button_clicked => {
netplay_discord_button_clicked();
}
}
if(side-bar.current-item == 3): Settings { }
if(side-bar.current-item == 4): About {

View File

@ -36,6 +36,7 @@ export component NetplayDialog inherits Dialog {
export component Netplay inherits Page {
callback create_session_button_clicked;
callback join_session_button_clicked;
callback netplay_discord_button_clicked;
title: @tr("Netplay");
VerticalBox {
@ -59,5 +60,15 @@ export component Netplay inherits Page {
}
}
}
HorizontalBox {
alignment: center;
Button {
text: @tr("Netplay Discord Channel");
clicked => {
netplay_discord_button_clicked();
}
}
}
}
}