Crew commands

This commit is contained in:
Regalis
2015-11-26 23:04:02 +02:00
parent f1e1b0b4f0
commit c9cc94f701
19 changed files with 406 additions and 69 deletions
+19 -1
View File
@@ -39,6 +39,19 @@ namespace Barotrauma
}
}
public override Color SelectedColor
{
get
{
return base.SelectedColor;
}
set
{
base.SelectedColor = value;
frame.SelectedColor = value;
}
}
public override Color OutlineColor
{
get { return base.OutlineColor; }
@@ -120,7 +133,7 @@ namespace Barotrauma
{
if (!Visible) return;
if (rect.Contains(PlayerInput.MousePosition) && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn)))
if (rect.Contains(PlayerInput.MousePosition) && CanBeSelected && Enabled && (MouseOn == null || MouseOn == this || IsParentOf(MouseOn)))
{
state = ComponentState.Hover;
if (PlayerInput.GetMouseState.LeftButton == ButtonState.Pressed)
@@ -136,6 +149,11 @@ namespace Barotrauma
{
if (OnClicked(this, UserData) && CanBeSelected) state = ComponentState.Selected;
}
else
{
Selected = !Selected;
// state = state == ComponentState.Selected ? ComponentState.None : ComponentState.Selected;
}
}
}
else