Barotrauma Client Doc
Barotrauma.SubEditorScreen Class Reference
Inheritance diagram for Barotrauma.SubEditorScreen:
Barotrauma.EditorScreen Barotrauma.Screen

Public Types

enum class  Mode { Default , Wiring }
 
enum class  WarningType {
  NoWaypoints , NoHulls , DisconnectedVents , NoHumanSpawnpoints ,
  NoCargoSpawnpoints , NoBallastTag , NonLinkedGaps , NoHiddenContainers ,
  StructureCount , WallCount , ItemCount , LightCount ,
  ShadowCastingLightCount , WaterInHulls
}
 

Public Member Functions

 SubEditorScreen ()
 
void ClearBackedUpSubInfo ()
 
override void Select ()
 
void Select (bool enableAutoSave=true)
 
override void OnFileDropped (string filePath, string extension)
 
void LoadSub (SubmarineInfo info, bool checkIdConflicts=true)
 
void SetMode (Mode newMode)
 
void AutoHull ()
 
override void AddToGUIUpdateList ()
 By default, creates a new frame for the screen and adds all elements to the gui update list. More...
 
bool IsMouseOnEditorGUI ()
 GUI.MouseOn doesn't get updated while holding primary mouse and we need it to More...
 
void UpdateUndoHistoryPanel ()
 
override void Update (double deltaTime)
 Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio. More...
 
override void Draw (double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
 This is called when the game should draw itself. More...
 
void SaveScreenShot (int width, int height, string filePath)
 
bool IsSubcategoryHidden (string subcategory)
 
- Public Member Functions inherited from Barotrauma.EditorScreen
override sealed void Deselect ()
 
void CreateBackgroundColorPicker ()
 
- Public Member Functions inherited from Barotrauma.Screen
void ColorFade (Color from, Color to, float duration)
 
virtual void Release ()
 

Static Public Member Functions

static Type DetermineSubFileType (SubmarineType type)
 
static GUIMessageBox CreatePropertyColorPicker (Color originalColor, SerializableProperty property, ISerializableEntity entity)
 
static GUIFrame CreateWiringPanel (Point offset, GUIListBox.OnSelectedHandler onWireSelected)
 
static void StoreCommand (Command command)
 
static void DrawGrid (SpriteBatch spriteBatch, Camera cam, float sizeX, float sizeY, bool zoomTreshold)
 
static void DrawOutOfBoundsArea (SpriteBatch spriteBatch, Camera cam, float playableAreaSize, Color color)
 
static bool IsSubEditor ()
 
static bool IsWiringMode ()
 
static bool IsLayerVisible (MapEntity entity)
 
static bool IsLayerLinked (MapEntity entity)
 
static ImmutableHashSet< MapEntityGetEntitiesInSameLayer (MapEntity entity)
 
- Static Public Member Functions inherited from Barotrauma.Screen
static void SelectNull ()
 

Public Attributes

GUIComponent TopPanel
 
GUIComponent showEntitiesPanel
 
GUIComponent EntityMenu
 

Static Public Attributes

const int MaxStructures = 2000
 
const int MaxWalls = 500
 
const int MaxItems = 5000
 
const int MaxLights = 600
 
const int MaxShadowCastingLights = 60
 
static Vector2 MouseDragStart = Vector2.Zero
 
static readonly object ItemAddMutex = new object()
 
static bool TransparentWiringMode = true
 
static bool SkipInventorySlotUpdate
 
static List< AddOrDeleteCommand > BulkItemBuffer = new List<AddOrDeleteCommand>()
 
static List< WarningTypeSuppressedWarnings = new List<WarningType>()
 
static readonly EditorImageManager ImageManager = new EditorImageManager()
 
static bool ShouldDrawGrid = false
 
static MapEntityPrefab DraggedItemPrefab
 Prefab used for dragging from the item catalog into inventories GUI.Draw More...
 
static readonly List< Command > Commands = new List<Command>()
 Global undo/redo state for the sub editor and a selector index for it Command More...
 
static XDocument AutoSaveInfo
 
- Static Public Attributes inherited from Barotrauma.EditorScreen
static Color BackgroundColor = GameSettings.CurrentConfig.SubEditorBackground
 

Protected Member Functions

override void DeselectEditorSpecific ()
 

Properties

bool ShowThalamus = true [get]
 
GUIButton ToggleEntityMenuButton [get]
 
static object BulkItemBufferInUse [get, set]
 
override Camera Cam [get]
 
bool DrawCharacterInventory [get]
 
bool WiringMode [get]
 
- Properties inherited from Barotrauma.EditorScreen
override bool IsEditor [get]
 
- Properties inherited from Barotrauma.Screen
static Screen Selected [get]
 
virtual Camera Cam [get]
 
virtual bool IsEditor [get]
 
GUIFrame Frame [get]
 

Detailed Description

Definition at line 17 of file SubEditorScreen.cs.

Member Enumeration Documentation

◆ Mode

Enumerator
Default 
Wiring 

Definition at line 63 of file SubEditorScreen.cs.

◆ WarningType

Enumerator
NoWaypoints 
NoHulls 
DisconnectedVents 
NoHumanSpawnpoints 
NoCargoSpawnpoints 
NoBallastTag 
NonLinkedGaps 
NoHiddenContainers 
StructureCount 
WallCount 
ItemCount 
LightCount 
ShadowCastingLightCount 
WaterInHulls 

Definition at line 69 of file SubEditorScreen.cs.

Constructor & Destructor Documentation

◆ SubEditorScreen()

Barotrauma.SubEditorScreen.SubEditorScreen ( )

Definition at line 292 of file SubEditorScreen.cs.

Member Function Documentation

◆ AddToGUIUpdateList()

override void Barotrauma.SubEditorScreen.AddToGUIUpdateList ( )
virtual

By default, creates a new frame for the screen and adds all elements to the gui update list.

Reimplemented from Barotrauma.Screen.

Definition at line 4951 of file SubEditorScreen.cs.

◆ AutoHull()

void Barotrauma.SubEditorScreen.AutoHull ( )

Definition at line 4649 of file SubEditorScreen.cs.

◆ ClearBackedUpSubInfo()

void Barotrauma.SubEditorScreen.ClearBackedUpSubInfo ( )

Definition at line 1076 of file SubEditorScreen.cs.

◆ CreatePropertyColorPicker()

static GUIMessageBox Barotrauma.SubEditorScreen.CreatePropertyColorPicker ( Color  originalColor,
SerializableProperty  property,
ISerializableEntity  entity 
)
static

Definition at line 4070 of file SubEditorScreen.cs.

◆ CreateWiringPanel()

static GUIFrame Barotrauma.SubEditorScreen.CreateWiringPanel ( Point  offset,
GUIListBox.OnSelectedHandler  onWireSelected 
)
static

Definition at line 4341 of file SubEditorScreen.cs.

◆ DeselectEditorSpecific()

override void Barotrauma.SubEditorScreen.DeselectEditorSpecific ( )
protectedvirtual

Reimplemented from Barotrauma.EditorScreen.

Definition at line 1553 of file SubEditorScreen.cs.

◆ DetermineSubFileType()

static Type Barotrauma.SubEditorScreen.DetermineSubFileType ( SubmarineType  type)
static

◆ Draw()

override void Barotrauma.SubEditorScreen.Draw ( double  deltaTime,
GraphicsDevice  graphics,
SpriteBatch  spriteBatch 
)
virtual

This is called when the game should draw itself.

Reimplemented from Barotrauma.Screen.

Definition at line 5889 of file SubEditorScreen.cs.

◆ DrawGrid()

static void Barotrauma.SubEditorScreen.DrawGrid ( SpriteBatch  spriteBatch,
Camera  cam,
float  sizeX,
float  sizeY,
bool  zoomTreshold 
)
static

Definition at line 6095 of file SubEditorScreen.cs.

◆ DrawOutOfBoundsArea()

static void Barotrauma.SubEditorScreen.DrawOutOfBoundsArea ( SpriteBatch  spriteBatch,
Camera  cam,
float  playableAreaSize,
Color  color 
)
static

Definition at line 6125 of file SubEditorScreen.cs.

◆ GetEntitiesInSameLayer()

static ImmutableHashSet<MapEntity> Barotrauma.SubEditorScreen.GetEntitiesInSameLayer ( MapEntity  entity)
static

Definition at line 6218 of file SubEditorScreen.cs.

◆ IsLayerLinked()

static bool Barotrauma.SubEditorScreen.IsLayerLinked ( MapEntity  entity)
static

Definition at line 6205 of file SubEditorScreen.cs.

◆ IsLayerVisible()

static bool Barotrauma.SubEditorScreen.IsLayerVisible ( MapEntity  entity)
static

Definition at line 6192 of file SubEditorScreen.cs.

◆ IsMouseOnEditorGUI()

bool Barotrauma.SubEditorScreen.IsMouseOnEditorGUI ( )

GUI.MouseOn doesn't get updated while holding primary mouse and we need it to

Definition at line 4999 of file SubEditorScreen.cs.

◆ IsSubcategoryHidden()

bool Barotrauma.SubEditorScreen.IsSubcategoryHidden ( string  subcategory)

Definition at line 6180 of file SubEditorScreen.cs.

◆ IsSubEditor()

static bool Barotrauma.SubEditorScreen.IsSubEditor ( )
static

◆ IsWiringMode()

static bool Barotrauma.SubEditorScreen.IsWiringMode ( )
static

◆ LoadSub()

void Barotrauma.SubEditorScreen.LoadSub ( SubmarineInfo  info,
bool  checkIdConflicts = true 
)

Definition at line 3587 of file SubEditorScreen.cs.

◆ OnFileDropped()

override void Barotrauma.SubEditorScreen.OnFileDropped ( string  filePath,
string  extension 
)
virtual

Reimplemented from Barotrauma.Screen.

Definition at line 1472 of file SubEditorScreen.cs.

◆ SaveScreenShot()

void Barotrauma.SubEditorScreen.SaveScreenShot ( int  width,
int  height,
string  filePath 
)

Definition at line 6173 of file SubEditorScreen.cs.

◆ Select() [1/2]

override void Barotrauma.SubEditorScreen.Select ( )
virtual

Reimplemented from Barotrauma.Screen.

Definition at line 1344 of file SubEditorScreen.cs.

◆ Select() [2/2]

void Barotrauma.SubEditorScreen.Select ( bool  enableAutoSave = true)

Definition at line 1351 of file SubEditorScreen.cs.

◆ SetMode()

void Barotrauma.SubEditorScreen.SetMode ( Mode  newMode)

Definition at line 3818 of file SubEditorScreen.cs.

◆ StoreCommand()

static void Barotrauma.SubEditorScreen.StoreCommand ( Command  command)
static

Definition at line 5045 of file SubEditorScreen.cs.

◆ Update()

override void Barotrauma.SubEditorScreen.Update ( double  deltaTime)
virtual

Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio.

Reimplemented from Barotrauma.Screen.

Definition at line 5203 of file SubEditorScreen.cs.

◆ UpdateUndoHistoryPanel()

void Barotrauma.SubEditorScreen.UpdateUndoHistoryPanel ( )

Definition at line 5150 of file SubEditorScreen.cs.

Member Data Documentation

◆ AutoSaveInfo

XDocument Barotrauma.SubEditorScreen.AutoSaveInfo
static

Definition at line 239 of file SubEditorScreen.cs.

◆ BulkItemBuffer

List<AddOrDeleteCommand> Barotrauma.SubEditorScreen.BulkItemBuffer = new List<AddOrDeleteCommand>()
static

Definition at line 177 of file SubEditorScreen.cs.

◆ Commands

readonly List<Command> Barotrauma.SubEditorScreen.Commands = new List<Command>()
static

Global undo/redo state for the sub editor and a selector index for it Command

Definition at line 208 of file SubEditorScreen.cs.

◆ DraggedItemPrefab

MapEntityPrefab Barotrauma.SubEditorScreen.DraggedItemPrefab
static

Prefab used for dragging from the item catalog into inventories GUI.Draw

Definition at line 192 of file SubEditorScreen.cs.

◆ EntityMenu

GUIComponent Barotrauma.SubEditorScreen.EntityMenu

Definition at line 116 of file SubEditorScreen.cs.

◆ ImageManager

readonly EditorImageManager Barotrauma.SubEditorScreen.ImageManager = new EditorImageManager()
static

Definition at line 181 of file SubEditorScreen.cs.

◆ ItemAddMutex

readonly object Barotrauma.SubEditorScreen.ItemAddMutex = new object()
static

Definition at line 156 of file SubEditorScreen.cs.

◆ MaxItems

const int Barotrauma.SubEditorScreen.MaxItems = 5000
static

Definition at line 21 of file SubEditorScreen.cs.

◆ MaxLights

const int Barotrauma.SubEditorScreen.MaxLights = 600
static

Definition at line 22 of file SubEditorScreen.cs.

◆ MaxShadowCastingLights

const int Barotrauma.SubEditorScreen.MaxShadowCastingLights = 60
static

Definition at line 23 of file SubEditorScreen.cs.

◆ MaxStructures

const int Barotrauma.SubEditorScreen.MaxStructures = 2000
static

Definition at line 19 of file SubEditorScreen.cs.

◆ MaxWalls

const int Barotrauma.SubEditorScreen.MaxWalls = 500
static

Definition at line 20 of file SubEditorScreen.cs.

◆ MouseDragStart

Vector2 Barotrauma.SubEditorScreen.MouseDragStart = Vector2.Zero
static

Definition at line 87 of file SubEditorScreen.cs.

◆ ShouldDrawGrid

bool Barotrauma.SubEditorScreen.ShouldDrawGrid = false
static

Definition at line 183 of file SubEditorScreen.cs.

◆ showEntitiesPanel

GUIComponent Barotrauma.SubEditorScreen.showEntitiesPanel

Definition at line 105 of file SubEditorScreen.cs.

◆ SkipInventorySlotUpdate

bool Barotrauma.SubEditorScreen.SkipInventorySlotUpdate
static

Definition at line 160 of file SubEditorScreen.cs.

◆ SuppressedWarnings

List<WarningType> Barotrauma.SubEditorScreen.SuppressedWarnings = new List<WarningType>()
static

Definition at line 179 of file SubEditorScreen.cs.

◆ TopPanel

GUIComponent Barotrauma.SubEditorScreen.TopPanel

Definition at line 104 of file SubEditorScreen.cs.

◆ TransparentWiringMode

bool Barotrauma.SubEditorScreen.TransparentWiringMode = true
static

Definition at line 158 of file SubEditorScreen.cs.

Property Documentation

◆ BulkItemBufferInUse

object Barotrauma.SubEditorScreen.BulkItemBufferInUse
staticgetset

Definition at line 164 of file SubEditorScreen.cs.

◆ Cam

override Camera Barotrauma.SubEditorScreen.Cam
get

Definition at line 235 of file SubEditorScreen.cs.

◆ DrawCharacterInventory

bool Barotrauma.SubEditorScreen.DrawCharacterInventory
get

Definition at line 237 of file SubEditorScreen.cs.

◆ ShowThalamus

bool Barotrauma.SubEditorScreen.ShowThalamus = true
get

Definition at line 111 of file SubEditorScreen.cs.

◆ ToggleEntityMenuButton

GUIButton Barotrauma.SubEditorScreen.ToggleEntityMenuButton
get

Definition at line 121 of file SubEditorScreen.cs.

◆ WiringMode

bool Barotrauma.SubEditorScreen.WiringMode
get

Definition at line 288 of file SubEditorScreen.cs.