Merge remote-tracking branch 'refs/remotes/barotrauma/combat-mission'
Conflicts: Subsurface/Source/GUI/GUIListBox.cs
This commit is contained in:
@@ -472,12 +472,12 @@ namespace Barotrauma
|
||||
{
|
||||
if (pauseMenuOpen)
|
||||
{
|
||||
pauseMenu.Update(0.016f);
|
||||
pauseMenu.Update(deltaTime);
|
||||
}
|
||||
|
||||
if (settingsMenuOpen)
|
||||
{
|
||||
GameMain.Config.SettingsFrame.Update(0.016f);
|
||||
GameMain.Config.SettingsFrame.Update(deltaTime);
|
||||
}
|
||||
|
||||
if (GUIMessageBox.MessageBoxes.Count > 0)
|
||||
|
||||
@@ -287,6 +287,36 @@ namespace Barotrauma
|
||||
{
|
||||
scrollBar.BarScroll -= (PlayerInput.ScrollWheelSpeed / 500.0f) * BarSize;
|
||||
}
|
||||
|
||||
for (int i = 0; i < children.Count; i++)
|
||||
{
|
||||
GUIComponent child = children[i];
|
||||
if (child == frame || !child.Visible) continue;
|
||||
|
||||
if (enabled && child.CanBeFocused &&
|
||||
(MouseOn == this || (MouseOn != null && this.IsParentOf(MouseOn))) && child.Rect.Contains(PlayerInput.MousePosition))
|
||||
{
|
||||
child.State = ComponentState.Hover;
|
||||
if (PlayerInput.LeftButtonClicked())
|
||||
{
|
||||
Debug.WriteLine("clicked");
|
||||
Select(i);
|
||||
}
|
||||
}
|
||||
else if (selected.Contains(child))
|
||||
{
|
||||
child.State = ComponentState.Selected;
|
||||
|
||||
if (CheckSelected != null)
|
||||
{
|
||||
if (CheckSelected() != child.UserData) selected.Remove(child);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
child.State = ComponentState.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Select(int childIndex, bool force = false)
|
||||
@@ -448,7 +478,7 @@ namespace Barotrauma
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
child.Draw(spriteBatch);
|
||||
}
|
||||
|
||||
|
||||
@@ -217,6 +217,24 @@ namespace Barotrauma
|
||||
if (flashTimer > 0.0f) flashTimer -= deltaTime;
|
||||
if (!Enabled) 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;
|
||||
|
||||
if (CaretEnabled)
|
||||
{
|
||||
caretTimer += deltaTime;
|
||||
@@ -248,24 +266,6 @@ 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;
|
||||
@@ -279,7 +279,6 @@ namespace Barotrauma
|
||||
new Vector2((int)caretPos.X + 2, caretPos.Y + Font.MeasureString("I").Y - 3),
|
||||
textBlock.TextColor * (textBlock.TextColor.A / 255.0f));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void ReceiveTextInput(char inputChar)
|
||||
|
||||
@@ -127,9 +127,13 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
spriteBatch.DrawString(GUI.LargeFont, loadText,
|
||||
new Vector2(GameMain.GraphicsWidth/2.0f - GUI.LargeFont.MeasureString(loadText).X/2.0f, GameMain.GraphicsHeight*0.8f),
|
||||
Color.White);
|
||||
if (GUI.LargeFont!=null)
|
||||
{
|
||||
spriteBatch.DrawString(GUI.LargeFont, loadText,
|
||||
new Vector2(GameMain.GraphicsWidth/2.0f - GUI.LargeFont.MeasureString(loadText).X/2.0f, GameMain.GraphicsHeight*0.8f),
|
||||
Color.White);
|
||||
}
|
||||
|
||||
}
|
||||
spriteBatch.End();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user