(a5643136e) Removed the separate "my character panel" from the top right corner of the screen in MP (not needed anymore because the job preferences etc can be edited in the info menu), removed the radio button below the chatbox (looks bad and not necessary now that we have a dedicated chat hotkey)

This commit is contained in:
Joonas Rikkonen
2019-04-18 12:03:37 +03:00
parent c85cf63494
commit 8b4c5b8cd7
3 changed files with 10 additions and 99 deletions
@@ -19,8 +19,6 @@ namespace Barotrauma
private GUIButton toggleButton; private GUIButton toggleButton;
private GUIButton radioButton;
private Point screenResolution; private Point screenResolution;
private bool isSinglePlayer; private bool isSinglePlayer;
@@ -61,11 +59,6 @@ namespace Barotrauma
get { return guiFrame; } get { return guiFrame; }
} }
public GUIButton RadioButton
{
get { return radioButton; }
}
public GUITextBox InputBox public GUITextBox InputBox
{ {
get { return inputBox; } get { return inputBox; }
@@ -110,30 +103,6 @@ namespace Barotrauma
gui.Text = ""; gui.Text = "";
}; };
radioButton = new GUIButton(new RectTransform(new Vector2(0.1f, 2.0f), inputBox.RectTransform,
HUDLayoutSettings.ChatBoxAlignment == Alignment.Right ? Anchor.BottomRight : Anchor.BottomLeft,
HUDLayoutSettings.ChatBoxAlignment == Alignment.Right ? Pivot.TopRight : Pivot.TopLeft),
style: null);
new GUIImage(new RectTransform(Vector2.One, radioButton.RectTransform), radioIcon, scaleToFit: true);
radioButton.OnClicked = (GUIButton btn, object userData) =>
{
if (inputBox.Selected)
{
inputBox.Text = "";
inputBox.Deselect();
}
else
{
inputBox.Select();
var radioItem = Character.Controlled?.Inventory?.Items.FirstOrDefault(i => i?.GetComponent<WifiComponent>() != null);
if (radioItem != null && Character.Controlled.HasEquippedItem(radioItem) && radioItem.GetComponent<WifiComponent>().CanTransmit())
{
inputBox.Text = "r; ";
}
}
return true;
};
ToggleOpen = GameMain.Config.ChatOpen; ToggleOpen = GameMain.Config.ChatOpen;
} }
@@ -368,7 +337,6 @@ namespace Barotrauma
} }
openState = MathHelper.Clamp(openState, 0.0f, 1.0f); openState = MathHelper.Clamp(openState, 0.0f, 1.0f);
int hiddenBoxOffset = guiFrame.Rect.Width + toggleButton.Rect.Width; int hiddenBoxOffset = guiFrame.Rect.Width + toggleButton.Rect.Width;
if (radioButton != null) hiddenBoxOffset += (int)(radioButton.Rect.Width * 1.5f);
guiFrame.RectTransform.AbsoluteOffset = guiFrame.RectTransform.AbsoluteOffset =
new Point((int)MathHelper.SmoothStep(hiddenBoxOffset * (HUDLayoutSettings.ChatBoxAlignment == Alignment.Left ? -1 : 1), 0, openState), 0); new Point((int)MathHelper.SmoothStep(hiddenBoxOffset * (HUDLayoutSettings.ChatBoxAlignment == Alignment.Left ? -1 : 1), 0, openState), 0);
} }
@@ -26,6 +26,7 @@ namespace Barotrauma.Networking
//TODO: move these to NetLobbyScreen //TODO: move these to NetLobbyScreen
public GUIButton EndRoundButton; public GUIButton EndRoundButton;
public GUITickBox EndVoteTickBox; public GUITickBox EndVoteTickBox;
private GUIComponent buttonContainer;
private NetStats netStats; private NetStats netStats;
@@ -129,7 +130,7 @@ namespace Barotrauma.Networking
chatBox.OnEnterMessage += EnterChatMessage; chatBox.OnEnterMessage += EnterChatMessage;
chatBox.InputBox.OnTextChanged += TypingChatMessage; chatBox.InputBox.OnTextChanged += TypingChatMessage;
var buttonContainer = new GUILayoutGroup(HUDLayoutSettings.ToRectTransform(HUDLayoutSettings.ButtonAreaTop, inGameHUD.RectTransform), buttonContainer = new GUILayoutGroup(HUDLayoutSettings.ToRectTransform(HUDLayoutSettings.ButtonAreaTop, inGameHUD.RectTransform),
isHorizontal: true, childAnchor: Anchor.CenterRight) isHorizontal: true, childAnchor: Anchor.CenterRight)
{ {
AbsoluteSpacing = 5, AbsoluteSpacing = 5,
@@ -635,8 +636,6 @@ namespace Barotrauma.Networking
} }
} }
if (gameStarted) SetRadioButtonColor();
if (ShowNetStats && client?.ServerConnection != null) if (ShowNetStats && client?.ServerConnection != null)
{ {
netStats.AddValue(NetStats.NetStatType.ReceivedBytes, client.ServerConnection.Statistics.ReceivedBytes); netStats.AddValue(NetStats.NetStatType.ReceivedBytes, client.ServerConnection.Statistics.ReceivedBytes);
@@ -2125,8 +2124,6 @@ namespace Barotrauma.Networking
protected ChatBox chatBox; protected ChatBox chatBox;
public GUIButton ShowLogButton; //TODO: move to NetLobbyScreen public GUIButton ShowLogButton; //TODO: move to NetLobbyScreen
private float myCharacterFrameOpenState;
public GUIFrame InGameHUD public GUIFrame InGameHUD
{ {
get { return inGameHUD; } get { return inGameHUD; }
@@ -2137,21 +2134,6 @@ namespace Barotrauma.Networking
get { return chatBox; } get { return chatBox; }
} }
protected void SetRadioButtonColor()
{
if (Character.Controlled == null || Character.Controlled.SpeechImpediment >= 100.0f)
{
chatBox.RadioButton.GetChild<GUIImage>().Color = new Color(60, 60, 60, 255);
}
else
{
var radioItem = Character.Controlled?.Inventory?.Items.FirstOrDefault(i => i?.GetComponent<WifiComponent>() != null);
chatBox.RadioButton.GetChild<GUIImage>().Color =
(radioItem != null && Character.Controlled.HasEquippedItem(radioItem) && radioItem.GetComponent<WifiComponent>().CanTransmit()) ?
Color.White : new Color(60, 60, 60, 255);
}
}
public bool TypingChatMessage(GUITextBox textBox, string text) public bool TypingChatMessage(GUITextBox textBox, string text)
{ {
return chatBox.TypingChatMessage(textBox, text); return chatBox.TypingChatMessage(textBox, text);
@@ -2183,11 +2165,6 @@ namespace Barotrauma.Networking
Screen.Selected == GameMain.GameScreen) Screen.Selected == GameMain.GameScreen)
{ {
inGameHUD.AddToGUIUpdateList(); inGameHUD.AddToGUIUpdateList();
if (Character.Controlled == null)
{
GameMain.NetLobbyScreen.MyCharacterFrame.AddToGUIUpdateList();
}
} }
} }
@@ -2212,18 +2189,6 @@ namespace Barotrauma.Networking
chatBox.Update(deltaTime); chatBox.Update(deltaTime);
cameraFollowsSub.Visible = Character.Controlled == null; cameraFollowsSub.Visible = Character.Controlled == null;
if (Character.Controlled == null)
{
myCharacterFrameOpenState = GameMain.NetLobbyScreen.MyCharacterFrameOpen ? myCharacterFrameOpenState + deltaTime * 5 : myCharacterFrameOpenState - deltaTime * 5;
myCharacterFrameOpenState = MathHelper.Clamp(myCharacterFrameOpenState, 0.0f, 1.0f);
var myCharFrame = GameMain.NetLobbyScreen.MyCharacterFrame;
int padding = GameMain.GraphicsWidth - myCharFrame.Parent.Rect.Right;
myCharFrame.RectTransform.AbsoluteOffset =
Vector2.SmoothStep(new Vector2(-myCharFrame.Rect.Width - padding, 0.0f), new Vector2(-padding, 0), myCharacterFrameOpenState).ToPoint();
}
} }
if (Character.Controlled == null || Character.Controlled.IsDead) if (Character.Controlled == null || Character.Controlled.IsDead)
{ {
@@ -159,13 +159,6 @@ namespace Barotrauma
private set; private set;
} }
public GUIFrame MyCharacterFrame
{
get { return myCharacterFrame; }
}
public bool MyCharacterFrameOpen;
public GUIFrame InfoFrame public GUIFrame InfoFrame
{ {
get { return infoFrame; } get { return infoFrame; }
@@ -301,17 +294,6 @@ namespace Barotrauma
UserData = "playyourself" UserData = "playyourself"
}; };
var toggleMyPlayerFrame = new GUIButton(new RectTransform(new Point(25, 70), myCharacterFrame.RectTransform, Anchor.TopLeft, Pivot.TopRight), "", style: "GUIButtonHorizontalArrow");
toggleMyPlayerFrame.OnClicked += (GUIButton btn, object userdata) =>
{
MyCharacterFrameOpen = !MyCharacterFrameOpen;
foreach (GUIComponent child in btn.Children)
{
child.SpriteEffects = MyCharacterFrameOpen ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
}
return true;
};
//player list ------------------------------------------------------------------ //player list ------------------------------------------------------------------
playerListFrame = new GUIFrame(new RectTransform(new Vector2(0.3f - panelSpacing, 0.35f - panelSpacing), defaultModeContainer.RectTransform, Anchor.BottomRight)); playerListFrame = new GUIFrame(new RectTransform(new Vector2(0.3f - panelSpacing, 0.35f - panelSpacing), defaultModeContainer.RectTransform, Anchor.BottomRight));
@@ -698,7 +680,6 @@ namespace Barotrauma
public override void Deselect() public override void Deselect()
{ {
textBox.Deselect(); textBox.Deselect();
myCharacterFrame.GetChild<GUIButton>().Visible = true;
CampaignCharacterDiscarded = false; CampaignCharacterDiscarded = false;
} }
@@ -714,9 +695,6 @@ namespace Barotrauma
textBox.OnEnterPressed = GameMain.Client.EnterChatMessage; textBox.OnEnterPressed = GameMain.Client.EnterChatMessage;
textBox.OnTextChanged += GameMain.Client.TypingChatMessage; textBox.OnTextChanged += GameMain.Client.TypingChatMessage;
myCharacterFrame.RectTransform.AbsoluteOffset = new Point(0, 0);
myCharacterFrame.GetChild<GUIButton>().Visible = false;
subList.Enabled = AllowSubSelection;// || GameMain.Server != null; subList.Enabled = AllowSubSelection;// || GameMain.Server != null;
shuttleList.Enabled = AllowSubSelection;// || GameMain.Server != null; shuttleList.Enabled = AllowSubSelection;// || GameMain.Server != null;