Skip to content

Commit

Permalink
修复易语言窗口无法弹出的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellobaka committed Oct 11, 2022
1 parent 8e253b6 commit bf9ee43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Another-Mirai-Native/Forms/FloatWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected override void OnCreateControl()
public static FloatWindow Instance { get; set; }
public bool TopMostFlag { get { return Instance.TopMost; } set { Instance.TopMost = value; ConfigHelper.SetConfig("FloatWindow_TopMost", value); } }
public bool ShowFlag { get { return Instance.Visible; } set { Instance.Visible = value; ConfigHelper.SetConfig("FloatWindow_Visible", value); } }

private static string DefaultIcon = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAA4AEMDASIAAhEBAxEB/8QAGwAAAwEBAQEBAAAAAAAAAAAAAAcIBgUDAQn/xAA+EAAABAQDBAYHBAsAAAAAAAABAwQFAAIGEQcTFAghIzESFUNRU3MWIjNBYWPwFzSBoSQyRHGRlKOxs8Hj/8QAGgEAAgMBAQAAAAAAAAAAAAAAAAYBBAUHAv/EACYRAAIBAwQBAwUAAAAAAAAAAAABAwQFEQITITEUBiIjMjNBQ1L/2gAMAwEAAhEDEQA/AP1QgHlBcO+MnWlcttFsaxydJjQKLAeESXmGm28IvtIANKM9xGw/nAE4994SDBtMU1WxSn0ZROK9am9qlUpdJpvME3lHaDFJ9CQOlTcg/uXf8oxpLpTRSbcmsuaKWSRcIaQF333j2llCULBCQctqqkGF7lY10jsLjyNKRoDVWm83LvaHMlVyLUsikmYDiTJOmWY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FpgHiDYd5ofnDalAJQsG4InbbXpYyuNnKp6dnbnlxlWHIM1JT6EVys0C1yY2xRWaVfl9Wiio6iuhMfeQ6EEEEGSD5YLcomXaFcErjtM7OrAsATSRdHRfl9+U1qv9wQR7AotexonYsZFacs78Iz8mE9KlGibIxpgMHvCCCKjSfaJTa6F7tYN6Zt2eal05BZcshqAbcv28mHan6IlSDYL2ggizjgG89nrBBBHggIIIIAP/9k=";
private void FloatWindow_Load(object sender, EventArgs e)
{
Expand All @@ -70,7 +70,7 @@ private void FloatWindow_Load(object sender, EventArgs e)
{
Left = int.Parse(position[0]);
Top = int.Parse(position[1]);
}
}
TopMost = ConfigHelper.GetConfig<bool>("FloatWindow_TopMost");
//日志窗口初始化
LogForm logForm = new();
Expand All @@ -81,9 +81,6 @@ private void FloatWindow_Load(object sender, EventArgs e)
NotifyIconHelper.Instance = notifyIcon;
NotifyIconHelper.Init();
NotifyIconHelper.ShowNotifyIcon();
//载入插件
PluginManagment manage = new();
manage.Init();
//将托盘右键菜单复制一份
pictureBox_Main.ContextMenu = notifyIcon.ContextMenu;
//默认头像,防止网络问题造成空头像出现
Expand Down Expand Up @@ -114,6 +111,9 @@ private void FloatWindow_Load(object sender, EventArgs e)
//显示控件, 置顶
this.Controls.Add(RoundpictureBox);
RoundpictureBox.BringToFront();
//载入插件
PluginManagment manage = new();
manage.Init();
}
//防抖
System.Windows.Forms.Timer Debounce = null;
Expand Down
9 changes: 6 additions & 3 deletions Another-Mirai-Native/Native/PluginManagment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class PluginManagment
public List<CQPlugin> Plugins { get; set; } = new();
public List<CQPlugin> SavedPlugins { get; set; } = new();
public Dictionary<IntPtr, AppDomain> AppDomains { get; set; } = new();
public bool Loading { get; set; } = false;
public bool Loading { get; set; } = true;
private JObject PluginStatus;
public PluginManagment()
{
Expand Down Expand Up @@ -299,8 +299,11 @@ public void Init()
}
Load();
LogHelper.WriteLog("遍历启动事件……");
CallFunction(FunctionEnums.StartUp);
CallFunction(FunctionEnums.Enable);
new Thread(() =>
{
CallFunction(FunctionEnums.StartUp);
CallFunction(FunctionEnums.Enable);
}).Start();
LogHelper.WriteLog("插件启动完成,开始处理消息逻辑……");
Loading = false;
}
Expand Down

0 comments on commit bf9ee43

Please sign in to comment.