C# Class Sphere_Editor.EditorComponents.MapEditorControl

Inheritance: System.Windows.Forms.UserControl
Datei anzeigen Open project: Radnen/spherestudio

Public Properties

Property Type Description
Autoset AutosetEditor
Entities List
EntityStatusLabel System.Windows.Forms.ToolStripStatusLabel
Layers List
TileStatusLabel System.Windows.Forms.ToolStripStatusLabel
Tileset TilesetControl
zone_brush System.Drawing.Brush
zone_pen System.Drawing.Pen

Public Methods

Method Description
AddLayer ( string name ) : Layer

Adds a blank layer to the map

AddLayer ( BinaryReader stream ) : void

Adds a Layer from a stream object. In this case a Binary Reader.

DoAllLayerAdjustment ( int startIndex, short count ) : void

Handles adjustment of tile insertion and deletion.

LoadMap ( string filename ) : void
MapEditorControl ( ) : System
RedoAction ( ) : void

Restores the next stored layer and ests the current undo position.

RemoveLayer ( short index ) : void

Removes a layer from the map.

ResizeAllLayers ( short width, short height ) : void
SaveMap ( string filename ) : bool
SetLayerTile ( int x, int y ) : void
SetSize ( int width, int height ) : void

Sets the size of the drawing portion of the map:

SetStampMap ( short indicies, int map_w, int map_h ) : void
SetTileSize ( short width, short height ) : void
SetTileSize ( short width, short height, bool rescale ) : void
SetZoomLevel ( int num ) : void

Set's the zoom of the map.

UndoAction ( ) : void

Draws the previously stored layer set and sets the current undo position.

UpdateAllLayers ( ) : void

Forces all layers to "redraw" and draws them to screen.

UpdateControl ( ) : void

Positions the object in the middle of its container. Also toggles scrollbars where apropriate.

UpdateScrollbars ( ) : void

Protected Methods

Method Description
OnScroll ( ScrollEventArgs se ) : void
ScrollToControl ( Control activeControl ) : Point

Private Methods

Method Description
CheckFloodPoint ( Stack points, int x, int y, int old_index ) : void
CloneAllLayers ( ) : List

Returns a shallow clone of the layers.

CopyEntityItem_Click ( object sender, EventArgs e ) : void
DeleteEntityItem_Click ( object sender, EventArgs e ) : void
DoAutoStamp ( int cx, int cy ) : void
DoTool ( ) : void
DrawEntities ( Graphics g ) : void
DrawTileLine ( int x0, int y0, int x1, int y1 ) : void
DrawTileSelector ( Graphics g, Pen pen, int mid_x, int mid_y ) : void
DrawTool ( Graphics g ) : void
EditEntityItem_Click ( object sender, EventArgs e ) : void
FloodTiles ( int x, int y ) : void

Implemented using a virtual stack, rather than by recursion.

GetEntityAt ( int x, int y ) : System.Entity
InvalidateSelectorArea ( ) : void
LayerSubItemClick ( object sender, EventArgs e ) : void
MapContextStrip_Opened ( object sender, EventArgs e ) : void
MapEditorControl_Enter ( object sender, EventArgs e ) : void
MapEditorControl_KeyDown ( object sender, KeyEventArgs e ) : void
MapEditorControl_KeyUp ( object sender, KeyEventArgs e ) : void
MapEditorControl_Leave ( object sender, EventArgs e ) : void
MapEditorControl_MouseDown ( object sender, MouseEventArgs e ) : void
MapEditorControl_MouseLeave ( object sender, EventArgs e ) : void
MapEditorControl_MouseMove ( object sender, MouseEventArgs e ) : void
MapEditorControl_MouseUp ( object sender, MouseEventArgs e ) : void
MapEditorControl_Paint ( object sender, PaintEventArgs e ) : void
PasteEntityItem_Click ( object sender, EventArgs e ) : void
PersonItem_Click ( object sender, EventArgs e ) : void
ResetHistory ( ) : void

Cheap reset of the undo chain. Sorry, I'm lazy to not make something More beneficial. Something that restores destroyed layers.

SelectTileItem_Click ( object sender, EventArgs e ) : void
StampMap ( ) : void
StartLocationItem_Click ( object sender, EventArgs e ) : void
TriggerItem_Click ( object sender, EventArgs e ) : void
UpdateControlSize ( ) : void
UpdateCurrentLayer ( ) : void

"Redraws" the current layer image, but does not draw it to screen.

myzone_Deleted ( object sender, EventArgs e ) : void

Method Details

AddLayer() public method

Adds a blank layer to the map
public AddLayer ( string name ) : Layer
name string The name of the layer
return Layer

AddLayer() public method

Adds a Layer from a stream object. In this case a Binary Reader.
public AddLayer ( BinaryReader stream ) : void
stream System.IO.BinaryReader The stream in which to extrapolate the layer data from
return void

DoAllLayerAdjustment() public method

Handles adjustment of tile insertion and deletion.
public DoAllLayerAdjustment ( int startIndex, short count ) : void
startIndex int The index to begin modifying.
count short The amount to modify by, either + or -.
return void

LoadMap() public method

public LoadMap ( string filename ) : void
filename string
return void

MapEditorControl() public method

public MapEditorControl ( ) : System
return System

OnScroll() protected method

protected OnScroll ( ScrollEventArgs se ) : void
se System.Windows.Forms.ScrollEventArgs
return void

RedoAction() public method

Restores the next stored layer and ests the current undo position.
public RedoAction ( ) : void
return void

RemoveLayer() public method

Removes a layer from the map.
public RemoveLayer ( short index ) : void
index short Index number of layer to remove.
return void

ResizeAllLayers() public method

public ResizeAllLayers ( short width, short height ) : void
width short
height short
return void

SaveMap() public method

public SaveMap ( string filename ) : bool
filename string
return bool

ScrollToControl() protected method

protected ScrollToControl ( Control activeControl ) : Point
activeControl System.Windows.Forms.Control
return Point

SetLayerTile() public method

public SetLayerTile ( int x, int y ) : void
x int
y int
return void

SetSize() public method

Sets the size of the drawing portion of the map:
public SetSize ( int width, int height ) : void
width int width in tiles
height int height in tiles
return void

SetStampMap() public method

public SetStampMap ( short indicies, int map_w, int map_h ) : void
indicies short
map_w int
map_h int
return void

SetTileSize() public method

public SetTileSize ( short width, short height ) : void
width short
height short
return void

SetTileSize() public method

public SetTileSize ( short width, short height, bool rescale ) : void
width short
height short
rescale bool
return void

SetZoomLevel() public method

Set's the zoom of the map.
public SetZoomLevel ( int num ) : void
num int The level of zoom.
return void

UndoAction() public method

Draws the previously stored layer set and sets the current undo position.
public UndoAction ( ) : void
return void

UpdateAllLayers() public method

Forces all layers to "redraw" and draws them to screen.
public UpdateAllLayers ( ) : void
return void

UpdateControl() public method

Positions the object in the middle of its container. Also toggles scrollbars where apropriate.
public UpdateControl ( ) : void
return void

UpdateScrollbars() public method

public UpdateScrollbars ( ) : void
return void

Property Details

Autoset public_oe property

public AutosetEditor Autoset
return AutosetEditor

Entities public_oe property

public List Entities
return List

EntityStatusLabel public_oe property

public ToolStripStatusLabel,System.Windows.Forms EntityStatusLabel
return System.Windows.Forms.ToolStripStatusLabel

Layers public_oe property

public List Layers
return List

TileStatusLabel public_oe property

public ToolStripStatusLabel,System.Windows.Forms TileStatusLabel
return System.Windows.Forms.ToolStripStatusLabel

Tileset public_oe property

public TilesetControl,Sphere_Editor.EditorComponents Tileset
return TilesetControl

zone_brush public_oe static_oe property

public static Brush,System.Drawing zone_brush
return System.Drawing.Brush

zone_pen public_oe static_oe property

public static Pen,System.Drawing zone_pen
return System.Drawing.Pen