Unstable 1.2.1.0

This commit is contained in:
Markus Isberg
2023-11-10 17:45:19 +02:00
parent 2ea58c58a7
commit 8a2e2ea0ae
268 changed files with 4076 additions and 1843 deletions
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Barotrauma.Extensions;
using Microsoft.Xna.Framework.Input;
namespace Barotrauma
{
@@ -81,6 +82,8 @@ namespace Barotrauma
public bool FlashOnAutoCloseCondition { get; set; }
public Action OnEnterPressed { get; set; }
public Type MessageBoxType => type;
public static GUIComponent VisibleBox => MessageBoxes.LastOrDefault();
@@ -89,6 +92,10 @@ namespace Barotrauma
: this(headerText, text, new LocalizedString[] { "OK" }, relativeSize, minSize, type: type)
{
this.Buttons[0].OnClicked = Close;
OnEnterPressed = () =>
{
Buttons[0].OnClicked(Buttons[0], Buttons[0].UserData);
};
}
public GUIMessageBox(RichString headerText, RichString text, LocalizedString[] buttons,
@@ -516,6 +523,11 @@ namespace Barotrauma
protected override void Update(float deltaTime)
{
if (PlayerInput.KeyHit(Keys.Enter))
{
OnEnterPressed?.Invoke();
}
if (Draggable)
{
GUIComponent parent = GUI.MouseOn?.Parent?.Parent;