(fdce94d18) Fixed steam workshop menu being way too tinty & moved text changes to the end of the text xml
This commit is contained in:
@@ -66,121 +66,6 @@ namespace Barotrauma
|
|||||||
CanBeFocused = false
|
CanBeFocused = false
|
||||||
};
|
};
|
||||||
|
|
||||||
Point scrollButtonSize = new Point((int)(200 * GUI.Scale), (int)(30 * GUI.Scale));
|
|
||||||
|
|
||||||
crewArea = new GUIFrame(HUDLayoutSettings.ToRectTransform(HUDLayoutSettings.CrewArea, guiFrame.RectTransform), "", Color.Transparent)
|
|
||||||
{
|
|
||||||
CanBeFocused = false
|
|
||||||
};
|
|
||||||
toggleCrewButton = new GUIButton(new RectTransform(new Point((int)(30 * GUI.Scale), HUDLayoutSettings.CrewArea.Height), guiFrame.RectTransform)
|
|
||||||
{ AbsoluteOffset = HUDLayoutSettings.CrewArea.Location },
|
|
||||||
"", style: "UIToggleButton");
|
|
||||||
toggleCrewButton.OnClicked += (GUIButton btn, object userdata) =>
|
|
||||||
{
|
|
||||||
toggleCrewAreaOpen = !toggleCrewAreaOpen;
|
|
||||||
foreach (GUIComponent child in btn.Children)
|
|
||||||
{
|
|
||||||
child.SpriteEffects = toggleCrewAreaOpen ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
characterListBox = new GUIListBox(new RectTransform(new Point(100, (int)(crewArea.Rect.Height - scrollButtonSize.Y * 1.6f)), crewArea.RectTransform, Anchor.CenterLeft), false, Color.Transparent, null)
|
|
||||||
{
|
|
||||||
//Spacing = (int)(3 * GUI.Scale),
|
|
||||||
ScrollBarEnabled = false,
|
|
||||||
ScrollBarVisible = false,
|
|
||||||
CanBeFocused = false
|
|
||||||
};
|
|
||||||
|
|
||||||
scrollButtonUp = new GUIButton(new RectTransform(scrollButtonSize, crewArea.RectTransform, Anchor.TopLeft, Pivot.TopLeft), "", Alignment.Center, "GUIButtonVerticalArrow")
|
|
||||||
{
|
|
||||||
Visible = false,
|
|
||||||
UserData = -1,
|
|
||||||
OnClicked = ScrollCharacterList
|
|
||||||
};
|
|
||||||
scrollButtonDown = new GUIButton(new RectTransform(scrollButtonSize, crewArea.RectTransform, Anchor.BottomLeft, Pivot.BottomLeft), "", Alignment.Center, "GUIButtonVerticalArrow")
|
|
||||||
{
|
|
||||||
Visible = false,
|
|
||||||
UserData = 1,
|
|
||||||
OnClicked = ScrollCharacterList
|
|
||||||
};
|
|
||||||
scrollButtonDown.Children.ForEach(c => c.SpriteEffects = SpriteEffects.FlipVertically);
|
|
||||||
|
|
||||||
if (isSinglePlayer)
|
|
||||||
{
|
|
||||||
chatBox = new ChatBox(guiFrame, isSinglePlayer: true)
|
|
||||||
{
|
|
||||||
OnEnterMessage = (textbox, text) =>
|
|
||||||
{
|
|
||||||
if (Character.Controlled?.Info == null)
|
|
||||||
{
|
|
||||||
textbox.Deselect();
|
|
||||||
textbox.Text = "";
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
textbox.TextColor = ChatMessage.MessageColor[(int)ChatMessageType.Default];
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(text))
|
|
||||||
{
|
|
||||||
string msgCommand = ChatMessage.GetChatMessageCommand(text, out string msg);
|
|
||||||
AddSinglePlayerChatMessage(
|
|
||||||
Character.Controlled.Info.Name,
|
|
||||||
msg,
|
|
||||||
((msgCommand == "r" || msgCommand == "radio") && ChatMessage.CanUseRadio(Character.Controlled)) ? ChatMessageType.Radio : ChatMessageType.Default,
|
|
||||||
Character.Controlled);
|
|
||||||
var headset = GetHeadset(Character.Controlled, true);
|
|
||||||
if (headset != null && headset.CanTransmit())
|
|
||||||
{
|
|
||||||
headset.TransmitSignal(stepsTaken: 0, signal: msg, source: headset.Item, sender: Character.Controlled, sendToChat: false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
textbox.Deselect();
|
|
||||||
textbox.Text = "";
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
chatBox.InputBox.OnTextChanged += chatBox.TypingChatMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
var reports = Order.PrefabList.FindAll(o => o.TargetAllCharacters && o.SymbolSprite != null);
|
|
||||||
reportButtonFrame = new GUILayoutGroup(new RectTransform(
|
|
||||||
new Point((HUDLayoutSettings.CrewArea.Height - (int)((reports.Count - 1) * 5 * GUI.Scale)) / reports.Count, HUDLayoutSettings.CrewArea.Height), guiFrame.RectTransform))
|
|
||||||
{
|
|
||||||
AbsoluteSpacing = (int)(5 * GUI.Scale),
|
|
||||||
UserData = "reportbuttons",
|
|
||||||
CanBeFocused = false
|
|
||||||
};
|
|
||||||
|
|
||||||
//report buttons
|
|
||||||
foreach (Order order in reports)
|
|
||||||
{
|
|
||||||
if (!order.TargetAllCharacters || order.SymbolSprite == null) continue;
|
|
||||||
var btn = new GUIButton(new RectTransform(new Point(reportButtonFrame.Rect.Width), reportButtonFrame.RectTransform), style: null)
|
|
||||||
{
|
|
||||||
OnClicked = (GUIButton button, object userData) =>
|
|
||||||
{
|
|
||||||
if (Character.Controlled == null || Character.Controlled.SpeechImpediment >= 100.0f) return false;
|
|
||||||
SetCharacterOrder(null, order, null, Character.Controlled);
|
|
||||||
HumanAIController.PropagateHullSafety(Character.Controlled, Character.Controlled.CurrentHull);
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
UserData = order,
|
|
||||||
ToolTip = order.Name
|
|
||||||
};
|
|
||||||
|
|
||||||
new GUIFrame(new RectTransform(new Vector2(1.5f), btn.RectTransform, Anchor.Center), "OuterGlow")
|
|
||||||
{
|
|
||||||
Color = Color.Red * 0.8f,
|
|
||||||
HoverColor = Color.Red * 1.0f,
|
|
||||||
PressedColor = Color.Red * 0.6f,
|
|
||||||
UserData = "highlighted",
|
|
||||||
CanBeFocused = false,
|
|
||||||
Visible = false
|
|
||||||
};
|
|
||||||
|
|
||||||
var characterInfo = new CharacterInfo(subElement);
|
var characterInfo = new CharacterInfo(subElement);
|
||||||
characterInfos.Add(characterInfo);
|
characterInfos.Add(characterInfo);
|
||||||
foreach (XElement invElement in subElement.Elements())
|
foreach (XElement invElement in subElement.Elements())
|
||||||
|
|||||||
@@ -45,11 +45,9 @@ namespace Barotrauma
|
|||||||
int width = Math.Min(GameMain.GraphicsWidth - 160, 1000);
|
int width = Math.Min(GameMain.GraphicsWidth - 160, 1000);
|
||||||
int height = Math.Min(GameMain.GraphicsHeight - 160, 700);
|
int height = Math.Min(GameMain.GraphicsHeight - 160, 700);
|
||||||
|
|
||||||
Rectangle panelRect = new Rectangle(0, 0, width, height);
|
|
||||||
|
|
||||||
tabs = new GUIFrame[Enum.GetValues(typeof(Tab)).Length];
|
tabs = new GUIFrame[Enum.GetValues(typeof(Tab)).Length];
|
||||||
|
|
||||||
menu = new GUIFrame(new RectTransform(new Vector2(0.4f, 0.5f), GUI.Canvas, Anchor.Center));
|
menu = new GUIFrame(new RectTransform(new Vector2(0.4f, 0.5f), GUI.Canvas, Anchor.Center) { MinSize = new Point(width, height) });
|
||||||
|
|
||||||
var container = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.9f), menu.RectTransform, Anchor.Center) { RelativeOffset = new Vector2(0.0f, 0.05f) }) { Stretch = true };
|
var container = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.9f), menu.RectTransform, Anchor.Center) { RelativeOffset = new Vector2(0.0f, 0.05f) }) { Stretch = true };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user