Barotrauma Client Doc
Barotrauma.CrewManager Class Reference

Classes

class  ActiveOrder
 
struct  MinimapNodeData
 

Public Member Functions

IEnumerable< CharacterGetCharacters ()
 
IEnumerable< CharacterInfoGetCharacterInfos ()
 
 CrewManager (bool isSinglePlayer)
 
bool AddOrder (Order order, float? fadeOutTime)
 
void AddCharacterElements (XElement element)
 
void RemoveCharacterInfo (CharacterInfo characterInfo)
 Remove info of a selected character. The character will not be visible in any menus or the round summary. More...
 
void AddCharacter (Character character, bool sortCrewList=true)
 
void RemoveCharacter (Character character, bool removeInfo=false, bool resetCrewListIndex=true)
 Remove the character from the crew (and crew menus). More...
 
void AddCharacterInfo (CharacterInfo characterInfo)
 
void InitRound ()
 
void RenameCharacter (CharacterInfo characterInfo, string newName)
 
void FireCharacter (CharacterInfo characterInfo)
 
void ClearCurrentOrders ()
 
void Update (float deltaTime)
 
void AddConversation (List<(Character speaker, string line)> conversationLines)
 
void SaveActiveOrders (XElement element)
 
void LoadActiveOrders (XElement element)
 
bool AutoShowCrewList ()
 
void AutoHideCrewList ()
 
void ResetCrewList ()
 
 CrewManager (XElement element, bool isSinglePlayer)
 
Rectangle GetActiveCrewArea ()
 
GUIComponent AddCharacterToCrewList (Character character)
 Add character to the list without actually adding it to the crew More...
 
void RemoveCharacterFromCrewList (Character character)
 
bool CharacterClicked (GUIComponent component, object selection)
 Sets which character is selected in the crew UI (highlight effect etc) More...
 
void ReviveCharacter (Character revivedCharacter)
 
void KillCharacter (Character killedCharacter, bool resetCrewListIndex=true)
 
void AddSinglePlayerChatMessage (LocalizedString senderName, LocalizedString text, ChatMessageType messageType, Character sender)
 Adds the message to the single player chatbox. More...
 
void AddSinglePlayerChatMessage (string senderName, string text, ChatMessageType messageType, Character sender)
 
void AddSinglePlayerChatMessage (ChatMessage message)
 
void SetPlayerVoiceIconState (Client client, bool muted, bool mutedLocally)
 
void SetClientSpeaking (Client client)
 
void SetCharacterSpeaking (Character character)
 
void SetCharacterOrder (Character character, Order order, bool isNewOrder=true)
 Sets the character's current order (if it's close enough to receive messages from orderGiver) and displays the order in the crew UI More...
 
void AddCurrentOrderIcon (Character character, Order order)
 Displays the specified order in the crew UI next to the character. More...
 
void AddToGUIUpdateList ()
 
void SelectNextCharacter ()
 
void SelectPreviousCharacter ()
 
void SetOrderHighlight (Character character, Identifier orderIdentifier, Identifier orderOption)
 
void CreateObjectiveIcon (Character character, Identifier identifier, Identifier option, Entity targetEntity)
 
void ToggleCommandUI ()
 
void DisableCommandUI ()
 
void UpdateReports ()
 Enables/disables report buttons when needed More...
 
void InitSinglePlayerRound ()
 
void Reset ()
 
XElement Save (XElement parentElement)
 

Static Public Member Functions

static Character GetCharacterForQuickAssignment (Order order, Character controlledCharacter, IEnumerable< Character > characters, bool includeSelf=false)
 
static IEnumerable< CharacterGetCharactersSortedForOrder (Order order, IEnumerable< Character > characters, Character controlledCharacter, bool includeSelf, IEnumerable< Character > extraCharacters=null)
 
static void CreateReportButtons (CrewManager crewManager, GUIComponent parent, IReadOnlyList< OrderPrefab > reports, bool isHorizontal)
 
static bool DoesItemHaveContextualOrders (Item item)
 
static void ClientReadActiveOrders (IReadMessage inc)
 

Public Attributes

ReadyCheck ActiveReadyCheck
 
OrderPrefab DraggedOrderPrefab
 
bool DragOrder
 
bool AllowCharacterSwitch = true
 
List< GUIButtonOrderOptionButtons = new List<GUIButton>()
 

Static Public Attributes

const int MaxCrewSize = 16
 
static bool PreferCrewMenuOpen = true
 

Properties

List< CharacterInfoCharacterInfos [get]
 
bool HasBots [get, set]
 
List< ActiveOrderActiveOrders = new List<ActiveOrder>() [get]
 
bool IsSinglePlayer [get]
 
GUIComponent ReportButtonFrame [get, set]
 
ChatBox ChatBox [get]
 Present only in single player games. In multiplayer. The chatbox is found from GameSession.Client. More...
 
bool IsCrewMenuOpen [get, set]
 This property stores the preference in settings. Don't use for automatic logic. Use AutoShowCrewList(), AutoHideCrewList(), and ResetCrewList(). More...
 
static bool? IsCommandInterfaceOpen [get]
 
static bool? CanIssueOrders [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ CrewManager() [1/2]

Barotrauma.CrewManager.CrewManager ( bool  isSinglePlayer)

◆ CrewManager() [2/2]

Barotrauma.CrewManager.CrewManager ( XElement  element,
bool  isSinglePlayer 
)

Member Function Documentation

◆ AddCharacter()

void Barotrauma.CrewManager.AddCharacter ( Character  character,
bool  sortCrewList = true 
)

◆ AddCharacterElements()

void Barotrauma.CrewManager.AddCharacterElements ( XElement  element)

◆ AddCharacterInfo()

void Barotrauma.CrewManager.AddCharacterInfo ( CharacterInfo  characterInfo)

◆ AddCharacterToCrewList()

GUIComponent Barotrauma.CrewManager.AddCharacterToCrewList ( Character  character)

Add character to the list without actually adding it to the crew

Definition at line 300 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

◆ AddConversation()

void Barotrauma.CrewManager.AddConversation ( List<(Character speaker, string line)>  conversationLines)

◆ AddCurrentOrderIcon()

void Barotrauma.CrewManager.AddCurrentOrderIcon ( Character  character,
Order  order 
)

Displays the specified order in the crew UI next to the character.

Definition at line 869 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

◆ AddOrder()

bool Barotrauma.CrewManager.AddOrder ( Order  order,
float?  fadeOutTime 
)

◆ AddSinglePlayerChatMessage() [1/3]

void Barotrauma.CrewManager.AddSinglePlayerChatMessage ( ChatMessage  message)

◆ AddSinglePlayerChatMessage() [2/3]

void Barotrauma.CrewManager.AddSinglePlayerChatMessage ( LocalizedString  senderName,
LocalizedString  text,
ChatMessageType  messageType,
Character  sender 
)

Adds the message to the single player chatbox.

Definition at line 680 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

◆ AddSinglePlayerChatMessage() [3/3]

void Barotrauma.CrewManager.AddSinglePlayerChatMessage ( string  senderName,
string  text,
ChatMessageType  messageType,
Character  sender 
)

◆ AddToGUIUpdateList()

void Barotrauma.CrewManager.AddToGUIUpdateList ( )

◆ AutoHideCrewList()

void Barotrauma.CrewManager.AutoHideCrewList ( )

◆ AutoShowCrewList()

bool Barotrauma.CrewManager.AutoShowCrewList ( )

◆ CharacterClicked()

bool Barotrauma.CrewManager.CharacterClicked ( GUIComponent  component,
object  selection 
)

Sets which character is selected in the crew UI (highlight effect etc)

Definition at line 552 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

◆ ClearCurrentOrders()

void Barotrauma.CrewManager.ClearCurrentOrders ( )

◆ ClientReadActiveOrders()

static void Barotrauma.CrewManager.ClientReadActiveOrders ( IReadMessage  inc)
static

◆ CreateObjectiveIcon()

void Barotrauma.CrewManager.CreateObjectiveIcon ( Character  character,
Identifier  identifier,
Identifier  option,
Entity  targetEntity 
)

◆ CreateReportButtons()

static void Barotrauma.CrewManager.CreateReportButtons ( CrewManager  crewManager,
GUIComponent  parent,
IReadOnlyList< OrderPrefab reports,
bool  isHorizontal 
)
static

◆ DisableCommandUI()

void Barotrauma.CrewManager.DisableCommandUI ( )

◆ DoesItemHaveContextualOrders()

static bool Barotrauma.CrewManager.DoesItemHaveContextualOrders ( Item  item)
static

◆ FireCharacter()

void Barotrauma.CrewManager.FireCharacter ( CharacterInfo  characterInfo)

◆ GetActiveCrewArea()

Rectangle Barotrauma.CrewManager.GetActiveCrewArea ( )

◆ GetCharacterForQuickAssignment()

static Character Barotrauma.CrewManager.GetCharacterForQuickAssignment ( Order  order,
Character  controlledCharacter,
IEnumerable< Character characters,
bool  includeSelf = false 
)
static

◆ GetCharacterInfos()

IEnumerable<CharacterInfo> Barotrauma.CrewManager.GetCharacterInfos ( )

◆ GetCharacters()

IEnumerable<Character> Barotrauma.CrewManager.GetCharacters ( )

◆ GetCharactersSortedForOrder()

static IEnumerable<Character> Barotrauma.CrewManager.GetCharactersSortedForOrder ( Order  order,
IEnumerable< Character characters,
Character  controlledCharacter,
bool  includeSelf,
IEnumerable< Character extraCharacters = null 
)
static

◆ InitRound()

void Barotrauma.CrewManager.InitRound ( )

◆ InitSinglePlayerRound()

void Barotrauma.CrewManager.InitSinglePlayerRound ( )

◆ KillCharacter()

void Barotrauma.CrewManager.KillCharacter ( Character  killedCharacter,
bool  resetCrewListIndex = true 
)

◆ LoadActiveOrders()

void Barotrauma.CrewManager.LoadActiveOrders ( XElement  element)

◆ RemoveCharacter()

void Barotrauma.CrewManager.RemoveCharacter ( Character  character,
bool  removeInfo = false,
bool  resetCrewListIndex = true 
)

Remove the character from the crew (and crew menus).

Parameters
characterThe character to remove
removeInfoIf the character info is also removed, the character will not be visible in the round summary.

Definition at line 206 of file BarotraumaShared/SharedSource/GameSession/CrewManager.cs.

◆ RemoveCharacterFromCrewList()

void Barotrauma.CrewManager.RemoveCharacterFromCrewList ( Character  character)

◆ RemoveCharacterInfo()

void Barotrauma.CrewManager.RemoveCharacterInfo ( CharacterInfo  characterInfo)

Remove info of a selected character. The character will not be visible in any menus or the round summary.

Parameters
characterInfo

Definition at line 151 of file BarotraumaShared/SharedSource/GameSession/CrewManager.cs.

◆ RenameCharacter()

void Barotrauma.CrewManager.RenameCharacter ( CharacterInfo  characterInfo,
string  newName 
)

◆ Reset()

void Barotrauma.CrewManager.Reset ( )

◆ ResetCrewList()

void Barotrauma.CrewManager.ResetCrewList ( )

◆ ReviveCharacter()

void Barotrauma.CrewManager.ReviveCharacter ( Character  revivedCharacter)

◆ Save()

XElement Barotrauma.CrewManager.Save ( XElement  parentElement)

◆ SaveActiveOrders()

void Barotrauma.CrewManager.SaveActiveOrders ( XElement  element)

◆ SelectNextCharacter()

void Barotrauma.CrewManager.SelectNextCharacter ( )

◆ SelectPreviousCharacter()

void Barotrauma.CrewManager.SelectPreviousCharacter ( )

◆ SetCharacterOrder()

void Barotrauma.CrewManager.SetCharacterOrder ( Character  character,
Order  order,
bool  isNewOrder = true 
)

Sets the character's current order (if it's close enough to receive messages from orderGiver) and displays the order in the crew UI

Definition at line 790 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

◆ SetCharacterSpeaking()

void Barotrauma.CrewManager.SetCharacterSpeaking ( Character  character)

◆ SetClientSpeaking()

void Barotrauma.CrewManager.SetClientSpeaking ( Client  client)

◆ SetOrderHighlight()

void Barotrauma.CrewManager.SetOrderHighlight ( Character  character,
Identifier  orderIdentifier,
Identifier  orderOption 
)

◆ SetPlayerVoiceIconState()

void Barotrauma.CrewManager.SetPlayerVoiceIconState ( Client  client,
bool  muted,
bool  mutedLocally 
)

◆ ToggleCommandUI()

void Barotrauma.CrewManager.ToggleCommandUI ( )

◆ Update()

void Barotrauma.CrewManager.Update ( float  deltaTime)

◆ UpdateReports()

void Barotrauma.CrewManager.UpdateReports ( )

Enables/disables report buttons when needed

Definition at line 3588 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

Member Data Documentation

◆ ActiveReadyCheck

ReadyCheck Barotrauma.CrewManager.ActiveReadyCheck

◆ AllowCharacterSwitch

bool Barotrauma.CrewManager.AllowCharacterSwitch = true

◆ DraggedOrderPrefab

OrderPrefab Barotrauma.CrewManager.DraggedOrderPrefab

◆ DragOrder

bool Barotrauma.CrewManager.DragOrder

◆ MaxCrewSize

const int Barotrauma.CrewManager.MaxCrewSize = 16
static

◆ OrderOptionButtons

List<GUIButton> Barotrauma.CrewManager.OrderOptionButtons = new List<GUIButton>()

◆ PreferCrewMenuOpen

bool Barotrauma.CrewManager.PreferCrewMenuOpen = true
static

Property Documentation

◆ ActiveOrders

List<ActiveOrder> Barotrauma.CrewManager.ActiveOrders = new List<ActiveOrder>()
get

◆ CanIssueOrders

bool? Barotrauma.CrewManager.CanIssueOrders
staticget

◆ CharacterInfos

List<CharacterInfo> Barotrauma.CrewManager.CharacterInfos
get

◆ ChatBox

ChatBox Barotrauma.CrewManager.ChatBox
get

Present only in single player games. In multiplayer. The chatbox is found from GameSession.Client.

Definition at line 42 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

◆ HasBots

bool Barotrauma.CrewManager.HasBots
getset

◆ IsCommandInterfaceOpen

bool? Barotrauma.CrewManager.IsCommandInterfaceOpen
staticget

◆ IsCrewMenuOpen

bool Barotrauma.CrewManager.IsCrewMenuOpen
getset

This property stores the preference in settings. Don't use for automatic logic. Use AutoShowCrewList(), AutoHideCrewList(), and ResetCrewList().

Definition at line 52 of file BarotraumaClient/ClientSource/GameSession/CrewManager.cs.

◆ IsSinglePlayer

bool Barotrauma.CrewManager.IsSinglePlayer
get

◆ ReportButtonFrame

GUIComponent Barotrauma.CrewManager.ReportButtonFrame
getset