(683b11c00) High-res shuttle preview images + merge fix
This commit is contained in:
@@ -75,82 +75,9 @@ namespace Barotrauma
|
||||
public CrewManager(XElement element, bool isSinglePlayer)
|
||||
: this(isSinglePlayer)
|
||||
{
|
||||
guiFrame = new GUIFrame(new RectTransform(Vector2.One, GUICanvas.Instance), null, Color.Transparent)
|
||||
foreach (XElement subElement in element.Elements())
|
||||
{
|
||||
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;
|
||||
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;
|
||||
}
|
||||
};
|
||||
if (subElement.Name.ToString().ToLowerInvariant() != "character") continue;
|
||||
|
||||
var characterInfo = new CharacterInfo(subElement);
|
||||
characterInfos.Add(characterInfo);
|
||||
@@ -312,12 +239,12 @@ namespace Barotrauma
|
||||
|
||||
public IEnumerable<Character> GetCharacters()
|
||||
{
|
||||
return characterListBox.Rect;
|
||||
return characters;
|
||||
}
|
||||
|
||||
public IEnumerable<CharacterInfo> GetCharacterInfos()
|
||||
{
|
||||
return characterListBox.Rect;
|
||||
return characterInfos;
|
||||
}
|
||||
|
||||
public void AddCharacter(Character character)
|
||||
@@ -692,19 +619,7 @@ namespace Barotrauma
|
||||
characterListBox.BarScroll = roundedPos;
|
||||
}
|
||||
|
||||
CreateCharacterFrame(character, characterListBox.Content);
|
||||
characterListBox.Content.RectTransform.SortChildren((c1, c2) => { return c2.NonScaledSize.X - c1.NonScaledSize.X; });
|
||||
|
||||
if (character is AICharacter)
|
||||
{
|
||||
var ai = character.AIController as HumanAIController;
|
||||
if (ai == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Error in crewmanager - attempted to give orders to a character with no HumanAIController");
|
||||
return;
|
||||
}
|
||||
character.SetOrder(ai.CurrentOrder, "", null, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private IEnumerable<object> KillCharacterAnim(GUIComponent component)
|
||||
|
||||
@@ -9,8 +9,6 @@ namespace Barotrauma
|
||||
{
|
||||
class SinglePlayerCampaign : CampaignMode
|
||||
{
|
||||
public ContextualTutorial ContextualTutorial;
|
||||
|
||||
private GUIButton endRoundButton;
|
||||
|
||||
private bool crewDead;
|
||||
@@ -41,13 +39,6 @@ namespace Barotrauma
|
||||
CrewManager.AddCharacterInfo(new CharacterInfo(Character.HumanConfigFile, "", jobPrefab));
|
||||
}
|
||||
}
|
||||
|
||||
ContextualTutorial = Tutorial.Tutorials.Find(t => t is ContextualTutorial) as ContextualTutorial;
|
||||
|
||||
if (ContextualTutorial.Selected) // Selected when starting a new game -> initialize
|
||||
{
|
||||
ContextualTutorial.Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
@@ -157,11 +148,6 @@ namespace Barotrauma
|
||||
base.AddToGUIUpdateList();
|
||||
CrewManager.AddToGUIUpdateList();
|
||||
endRoundButton.AddToGUIUpdateList();
|
||||
|
||||
if (ContextualTutorial.Initialized)
|
||||
{
|
||||
ContextualTutorial.AddToGUIUpdateList();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
@@ -306,7 +292,6 @@ namespace Barotrauma
|
||||
TextManager.Get("QuitButton"));
|
||||
quitButton.OnClicked += GameMain.LobbyScreen.QuitToMainMenu;
|
||||
quitButton.OnClicked += (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Remove(GUIMessageBox.VisibleBox); return true; };
|
||||
quitButton.OnClicked += (GUIButton button, object obj) => { if (ContextualTutorial.Initialized) ContextualTutorial.Stop(); return true; };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,10 +376,6 @@ namespace Barotrauma
|
||||
case "map":
|
||||
campaign.map = Map.LoadNew(subElement);
|
||||
break;
|
||||
case "contextualtutorial":
|
||||
campaign.ContextualTutorial.Initialize(); // Initialize when saved element found
|
||||
campaign.ContextualTutorial.LoadPartiallyComplete(subElement);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user