Skip to content

Commit

Permalink
added desktop notification for menu popup
Browse files Browse the repository at this point in the history
  • Loading branch information
SheepYhangCN committed Mar 5, 2024
1 parent b9b4cf4 commit 8f6ab11
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Locale/Locale.csv
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ locConnectionLost;Connection Lost;连接已丢失;連線已丟失;接続が失
locSha256DoesntMatch;Sha256 doesn't match with Host\nMake sure you are using the\nsame version as Host;与主机的 Sha256 不匹配\n请确保你使用的是与主机相同的版本;與主機的 Sha256 不匹配\n請確保你是用的是與主機相同的版本;Sha256とホストの不一致\nホストと同じバージョンを\n使用していることを確認します
locVersionDoesntMatch;Version doesn't match with Host\nMake sure you are using the\nsame version as Host;与主机的版本号不匹配\n请确保你使用的是与主机相同的版本;與主機的版本號不匹配\n請確保你是用的是與主機相同的版本;バージョン番号の不一致\nホストと同じバージョンを\n使用していることを確認してく
locNewSystemMessage;There is a new system message;有一条新的系统消息;有一條新的系統訊息;新しいシステムメッセージがあります
locYouWasPinged;You was pinged;你被呼叫了;你被呼叫了;あなたは呼び出された
locYouWasPinged;You was pinged;你被呼叫了;你被呼叫了;あなたは呼び出された
locBackedToMenu;Backed to Menu;回到菜单;回到選單;メニューに戻る
locConnectFailed;Connect Failed;连接失败;連線失敗;接続に失敗しました
Binary file modified Locale/Locale.en.translation
Binary file not shown.
Binary file modified Locale/Locale.ja.translation
Binary file not shown.
Binary file modified Locale/Locale.zh_CN.translation
Binary file not shown.
Binary file modified Locale/Locale.zh_TW.translation
Binary file not shown.
10 changes: 10 additions & 0 deletions Menu.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Godot;
using System;
using Microsoft.Toolkit.Uwp.Notifications;

public partial class Menu : Control
{
Expand Down Expand Up @@ -44,6 +45,15 @@ public override void _Ready()
{
GetNode<Label>("Popup/PanelContainer/Label").Text="locVersionDoesntMatch";
}
if (OS.GetName() == "Windows" && !GetWindow().HasFocus())
{
new ToastContentBuilder()
.AddArgument("action", "viewConversation")
.AddArgument("conversationId", 9813)
.AddText(TranslationServer.Translate(autoload.popup == 1 ? "locBackedToMenu" : "locConnectFailed"))
.AddText(TranslationServer.Translate(GetNode<Label>("Popup/PanelContainer/Label").Text))
.Show();
}
autoload.popup=0;
autoload.is_connection_lost=false;
GetNode<Panel>("Popup").Visible=true;
Expand Down

0 comments on commit 8f6ab11

Please sign in to comment.