Moved the whitelist UI to server settings, GUITextBoxes can't be selected through other UI elements anymore

This commit is contained in:
Regalis
2016-09-05 18:12:56 +03:00
parent 59c3773995
commit 53b3ef533e
5 changed files with 67 additions and 94 deletions

View File

@@ -223,26 +223,6 @@ namespace Barotrauma
caretVisible = ((caretTimer * 1000.0f) % 1000) < 500;
}
if (rect.Contains(PlayerInput.MousePosition))
{
state = ComponentState.Hover;
if (PlayerInput.LeftButtonClicked())
{
if (MouseOn != null && MouseOn != this && MouseOn!=textBlock && !MouseOn.IsParentOf(this)) return;
Select();
if (OnSelected != null) OnSelected(this, Keys.None);
}
}
else
{
state = ComponentState.None;
}
textBlock.State = state;
if (keyboardDispatcher.Subscriber == this)
{
Character.DisableControls = true;
@@ -268,6 +248,24 @@ namespace Barotrauma
{
if (!Visible) return;
if (rect.Contains(PlayerInput.MousePosition) && Enabled &&
(MouseOn == null || MouseOn == this || IsParentOf(MouseOn) || MouseOn.IsParentOf(this)))
{
state = ComponentState.Hover;
if (PlayerInput.LeftButtonClicked())
{
Select();
if (OnSelected != null) OnSelected(this, Keys.None);
}
}
else
{
state = ComponentState.None;
}
textBlock.State = state;
DrawChildren(spriteBatch);
if (!CaretEnabled) return;