Update ShowMessage #2

This commit is contained in:
风吹落的叶子 2022-09-11 13:00:00 +08:00
parent 8ab7110d8a
commit 2da0407fa9
4 changed files with 283 additions and 1129 deletions

View File

@ -43,7 +43,7 @@ namespace FunGame.Desktop.Models.Component
* objs:
* 0 = title
* 1 = msg
* 2 = autoclose(msecond)
* 2 = autoclose(second)
* 3 = button type
* 4 = mid text
* 5 = left text
@ -53,6 +53,7 @@ namespace FunGame.Desktop.Models.Component
if (length > 0 && objs[0] != null)
{
Title.Text = (string)objs[0];
Text = Title.Text;
}
if (length > 1 && objs[1] != null)
{
@ -105,19 +106,17 @@ namespace FunGame.Desktop.Models.Component
MessageResult = MessageResult.Cancel;
Dispose();
}
if (Title.Text == "Message") Text = MsgText.Text; // 窗体默认标题
if (AutoClose > 0)
{
Action action = new(() =>
{
string msg = MsgText.Text;
MsgText.Text = msg + "\n[ " + AutoClose/1000 + " 秒后自动关闭 ]";
MsgText.Text = msg + "\n[ " + AutoClose + " 秒后自动关闭 ]";
while (AutoClose > 0)
{
Thread.Sleep(1000);
AutoClose -= 1000;
MsgText.Text = msg + "\n[ " + AutoClose / 1000 + " 秒后自动关闭 ]";
BringToFront();
AutoClose--;
MsgText.Text = msg + "\n[ " + AutoClose + " 秒后自动关闭 ]";
}
MessageResult = MessageResult.OK;
Dispose();

View File

@ -158,7 +158,7 @@ namespace FunGame.Desktop.UI
this.SendTalkText.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Teal;
this.SendTalkText.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.SendTalkText.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.SendTalkText.Font = new System.Drawing.Font("阿丽达黑体", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.SendTalkText.Font = new System.Drawing.Font("LanaPixel", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.SendTalkText.Location = new System.Drawing.Point(608, 421);
this.SendTalkText.Name = "SendTalkText";
this.SendTalkText.Size = new System.Drawing.Size(51, 27);

View File

@ -627,7 +627,7 @@ namespace FunGame.Desktop.UI
SetServerStatusLight((int)LightType.Green);
Task.Run(() =>
{ // DEBUG
ShowMessage.TipMessage("欢迎回来, " + Usercfg.LoginUserName + "", "登录成功", 5000);
ShowMessage.TipMessage("欢迎回来, " + Usercfg.LoginUserName + "", "登录成功", 5);
});
}

File diff suppressed because it is too large Load Diff