BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
BrawlCrate.UI.CollisionEditor Class Reference
Inheritance diagram for BrawlCrate.UI.CollisionEditor:
BrawlCrate.UI.AdvancedCollisionEditor

Public Member Functions

 CollisionEditor ()
 
void UpdateTools ()
 

Public Attributes

ModelPanel _modelPanel
 

Protected Member Functions

void InitializeComponent ()
 
void TargetChanged (CollisionNode node)
 
virtual void SelectionModified ()
 
virtual void UpdatePropPanels ()
 
void PopulateModelList ()
 
void PopulateObjectList ()
 
void lstObjects_MouseDown (object sender, MouseEventArgs e)
 
void lstObjects_SelectedValueChanged (object sender, EventArgs e)
 
void snapToolStripMenuItem_Click (object sender, EventArgs e)
 
void _deleteToolStripMenuItem_Click (object sender, EventArgs e)
 
void newObjectToolStripMenuItem_Click (object sender, EventArgs e)
 
void ObjectSelected ()
 
void SnapObject ()
 
void lstObjects_ItemCheck (object sender, ItemCheckEventArgs e)
 
void ClearSelection ()
 
void UpdateSelection (bool finish)
 
void _treeObjects_AfterCheck (object sender, TreeViewEventArgs e)
 
void chkAllModels_CheckedChanged (object sender, EventArgs e)
 
void BeginHover (Vector3 point)
 
void UpdateHover (int x, int y)
 
void CancelHover ()
 
void FinishHover ()
 
void BeginSelection (Vector3 point, bool inverse)
 
void CancelSelection ()
 
void FinishSelection ()
 
void _modelPanel_MouseDown (object sender, MouseEventArgs e)
 
void _modelPanel_MouseUp (object sender, MouseEventArgs e)
 
void _modelPanel_MouseMove (object sender, MouseEventArgs e)
 
bool PointCollides (Vector3 point)
 
bool PointCollides (Vector3 point, out float y_result)
 
void _modelPanel_PreRender (object sender)
 
void _modelPanel_PostRender (object sender)
 
void btnSplit_Click (object sender, EventArgs e)
 
void btnMerge_Click (object sender, EventArgs e)
 
void trackBar1_Scroll (object sender, EventArgs e)
 
void btnResetRot_Click (object sender, EventArgs e)
 
void btnResetCam_Click (object sender, EventArgs e)
 
void btnPerspectiveCam_Click (object sender, EventArgs e)
 
void btnOrthographicCam_Click (object sender, EventArgs e)
 
void btnSpawns_Click (object sender, EventArgs e)
 
void btnItems_Click (object sender, EventArgs e)
 
void btnBoundaries_Click (object sender, EventArgs e)
 
void _modelPanel_KeyDown (object sender, KeyEventArgs e)
 
void cboMaterial_SelectedIndexChanged (object sender, EventArgs e)
 
void cboType_SelectedIndexChanged (object sender, EventArgs e)
 
void chkTypeCharacters_CheckedChanged (object sender, EventArgs e)
 
void chkTypeItems_CheckedChanged (object sender, EventArgs e)
 
void chkTypePokemonTrainer_CheckedChanged (object sender, EventArgs e)
 
void chkTypeRotating_CheckedChanged (object sender, EventArgs e)
 
void chkFallThrough_CheckedChanged (object sender, EventArgs e)
 
void chkLeftLedge_CheckedChanged (object sender, EventArgs e)
 
void chkRightLedge_CheckedChanged (object sender, EventArgs e)
 
void chkNoWalljump_CheckedChanged (object sender, EventArgs e)
 
void chkTypeCharacters_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkTypeItems_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkTypePokemonTrainer_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkTypeRotating_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkFallThrough_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkLeftLedge_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkRightLedge_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkNoWalljump_CheckedChanged_NoErrorHandling (object sender, EventArgs e)
 
void chkFlagCrush_CheckedChanged (object sender, EventArgs e)
 
void chkFlagBucculus_CheckedChanged (object sender, EventArgs e)
 
void chkFlagSuperSoft_CheckedChanged (object sender, EventArgs e)
 
void numX_ValueChanged (object sender, EventArgs e)
 
void numY_ValueChanged (object sender, EventArgs e)
 
void transformToolStripMenuItem_Click (object sender, EventArgs e)
 
void btnSameX_Click (object sender, EventArgs e)
 
void btnSameY_Click (object sender, EventArgs e)
 
void chkPoly_CheckStateChanged (object sender, EventArgs e)
 
void chkBones_CheckedChanged (object sender, EventArgs e)
 
void modelTree_AfterCheck (object sender, TreeViewEventArgs e)
 
void modelTree_AfterSelect (object sender, TreeViewEventArgs e)
 
void modelTree_BeforeSelect (object sender, TreeViewCancelEventArgs e)
 
void btnRelink_Click (object sender, EventArgs e)
 
void btnRelinkNoMove_Click (object sender, EventArgs e)
 
void btnUnlink_Click (object sender, EventArgs e)
 
void btnUnlinkNoMove_Click (object sender, EventArgs e)
 
void btnDelete_Click (object sender, EventArgs e)
 
void contextMenuStrip2_Opening (object sender, CancelEventArgs e)
 
void contextMenuStrip1_Opening (object sender, CancelEventArgs e)
 
void contextMenuStrip3_Opening (object sender, CancelEventArgs e)
 
void snapToolStripMenuItem1_Click (object sender, EventArgs e)
 
void btnResetSnap_Click (object sender, EventArgs e)
 
void btnFlipColl_Click (object sender, EventArgs e)
 
void CreateUndo ()
 
void CheckSaveIndex ()
 
void ClearUndoBuffer ()
 
void Undo (object sender, EventArgs e)
 
void Redo (object sender, EventArgs e)
 
void chkObjUnk_CheckedChanged (object sender, EventArgs e)
 
void chkObjIndep_CheckedChanged (object sender, EventArgs e)
 
void chkObjModule_CheckedChanged (object sender, EventArgs e)
 
void chkObjSSEUnk_CheckedChanged (object sender, EventArgs e)
 
void btnPlayAnims_Click (object sender, EventArgs e)
 
void btnPrevFrame_Click (object sender, EventArgs e)
 
void btnNextFrame_Click (object sender, EventArgs e)
 
void btnHelp_Click (object sender, EventArgs e)
 
void btnTranslateAll_Click (object sender, EventArgs e)
 

Protected Attributes

SplitContainer undoToolStrip
 
SplitContainer redoToolStrip
 
CheckBox chkAllModels
 
Panel pnlPlaneProps
 
Label label5
 
Label labelType
 
ComboBox cboMaterial
 
Panel pnlObjProps
 
ToolStrip toolStrip1
 
ToolStripButton btnTransform
 
ToolStripButton btnSplit
 
ToolStripButton btnMerge
 
ToolStripButton btnDelete
 
ContextMenuStrip contextMenuStrip1
 
ContextMenuStrip contextMenuStrip3
 
ToolStripMenuItem snapToolStripMenuItem
 
Panel panel1
 
TrackBar trackBar1
 
Button btnResetRot
 
ToolStripButton btnResetCam
 
GroupBox groupBoxFlags1
 
CheckBox chkFallThrough
 
GroupBox groupBoxFlags2
 
CheckBox chkNoWalljump
 
CheckBox chkRightLedge
 
CheckBox chkTypeCharacters
 
CheckBox chkTypeItems
 
CheckBox chkTypePokemonTrainer
 
CheckBox chkTypeRotating
 
CheckBox chkFlagCrush
 
CheckBox chkFlagSuperSoft
 
CheckBox chkFlagBucculus
 
GroupBox groupBoxTargets
 
Panel pnlPointProps
 
NumericInputBox numX
 
Label label2
 
NumericInputBox numY
 
Label label1
 
ToolStripSeparator toolStripSeparator1
 
ToolStripButton btnSameX
 
ToolStripButton btnSameY
 
ToolStripMenuItem newObjectToolStripMenuItem
 
ToolStripSeparator toolStripMenuItem2
 
ToolStripSeparator toolStripMenuItem3
 
ToolStripSeparator assignSeperatorToolStripMenuItem
 
ToolStripSeparator toolStripMenuItem1
 
ToolStripMenuItem _deleteToolStripMenuItem
 
TextBox txtModel
 
Label label3
 
Panel panel2
 
CheckBox chkPoly
 
Button btnRelink
 
TextBox txtBone
 
Label label4
 
CheckBox chkBones
 
CheckBox chkLeftLedge
 
ComboBox cboType
 
TreeView modelTree
 
Button btnUnlink
 
ContextMenuStrip contextMenuStrip2
 
ToolStripMenuItem assignToolStripMenuItem
 
ToolStripMenuItem assignNoMoveToolStripMenuItem
 
ToolStripMenuItem unlinkToolStripMenuItem
 
ToolStripMenuItem unlinkNoMoveToolStripMenuItem
 
ToolStripMenuItem snapToolStripMenuItem1
 
ToolStripSeparator toolStripSeparator2
 
ToolStripButton btnResetSnap
 
ToolStripButton btnUndo
 
ToolStripButton btnRedo
 
ToolStripSeparator toolStripSeparator3
 
CheckBox chkObjModule
 
CheckBox chkObjUnk
 
CheckBox chkObjSSEUnk
 
Button btnPlayAnims
 
Panel panel4
 
Panel panel3
 
Button btnPrevFrame
 
Button btnNextFrame
 
ToolStripButton btnHelp
 
CheckedListBox lstObjects
 
ToolStripSeparator toolStripSeparatorCamera
 
ToolStripButton btnPerspectiveCam
 
ToolStripButton btnFlipColl
 
ToolStripButton btnOrthographicCam
 
ToolStripButton btnBoundaries
 
ToolStripButton btnSpawns
 
ToolStripButton btnItems
 
ToolStripSeparator toolStripSeparatorOverlays
 
CollisionNode _targetNode
 
bool _updating
 
CollisionObject _selectedObject
 
Matrix _snapMatrix
 
bool _hovering
 
List< CollisionLink_selectedLinks = new List<CollisionLink>()
 
List< CollisionPlane_selectedPlanes = new List<CollisionPlane>()
 
bool _selecting
 
bool _selectInverse
 
Vector3 _selectStart
 
Vector3 _selectLast
 
Vector3 _selectEnd
 
bool _creating
 
CollisionState save
 
List< CollisionStateundoSaves = new List<CollisionState>()
 
List< CollisionStateredoSaves = new List<CollisionState>()
 
int saveIndex
 
bool hasMoved
 
List< IModel_models = new List<IModel>()
 

Static Protected Attributes

const float SelectWidth = 7.0f
 
const float PointSelectRadius = 1.5f
 
const float SmallIncrement = 0.5f
 
const float LargeIncrement = 3.0f
 

Properties

virtual bool ErrorChecking [get]
 
CollisionNode TargetNode [get, set]
 

Constructor & Destructor Documentation

◆ CollisionEditor()

BrawlCrate.UI.CollisionEditor.CollisionEditor ( )
inline
1361 {
1363
1365
1366 _modelPanel.CurrentViewport.DefaultTranslate = new Vector3(0.0f, 10.0f, 250.0f);
1367 _modelPanel.CurrentViewport.AllowSelection = false;
1368 _modelPanel.CurrentViewport.BackgroundColor = Color.Black;
1369
1370 pnlObjProps.Dock = DockStyle.Fill;
1371 pnlPlaneProps.Dock = DockStyle.Fill;
1372 pnlPointProps.Dock = DockStyle.Fill;
1373
1374 _updating = true;
1375 cboMaterial.DataSource = CollisionTerrain.Terrains.Take(0x20).ToList(); // Take unexpanded collisions
1376 cboType.DataSource = Enum.GetValues(typeof(CollisionPlaneType));
1377 _updating = false;
1378 }
bool _updating
Definition: CollisionEditor.cs:1342
ModelPanel _modelPanel
Definition: CollisionEditor.cs:26
void InitializeComponent()
Definition: CollisionEditor.cs:129
static new ModelPanelViewport DefaultPerspective
Definition: modelpanelviewport.cs:1242
void AddViewport(GLViewport v)
Definition: GLPanel.cs:116
Definition: CollisionDef.cs:213
static readonly CollisionTerrain[] Terrains
Definition: CollisionDef.cs:335
CollisionPlaneType
Definition: CollisionDef.cs:626
Definition: Vector3.cs:40

Member Function Documentation

◆ _deleteToolStripMenuItem_Click()

void BrawlCrate.UI.CollisionEditor._deleteToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
inlineprotected
1594 {
1595 if (_selectedObject == null)
1596 {
1597 return;
1598 }
1599
1600 int index = lstObjects.SelectedIndex;
1601
1603 lstObjects.Items.Remove(_selectedObject);
1604 _selectedObject = null;
1606 if (lstObjects.Items.Count > 0)
1607 {
1608 if (lstObjects.Items.Count > index)
1609 {
1610 lstObjects.SelectedIndex = index;
1611 }
1612 else if (index > 0)
1613 {
1614 lstObjects.SelectedIndex = index - 1;
1615 }
1616
1618 }
1619
1620 _modelPanel.Invalidate();
1622 }
void ClearSelection()
Definition: CollisionEditor.cs:1713
void ObjectSelected()
Definition: CollisionEditor.cs:1633
CollisionNode _targetNode
Definition: CollisionEditor.cs:1333
CheckedListBox lstObjects
Definition: CollisionEditor.cs:108
CollisionObject _selectedObject
Definition: CollisionEditor.cs:1343
CollisionNode TargetNode
Definition: CollisionEditor.cs:1337
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313
virtual void RemoveChild(ResourceNode child)
Definition: ResourceNode.cs:746

◆ _modelPanel_KeyDown()

void BrawlCrate.UI.CollisionEditor._modelPanel_KeyDown ( object  sender,
KeyEventArgs  e 
)
inlineprotected
2699 {
2700 if (e.KeyCode == Keys.Escape)
2701 {
2702 if (_hovering)
2703 {
2704 CancelHover();
2705 }
2706 else if (_selecting)
2707 {
2709 }
2710 else
2711 {
2713 _modelPanel.Invalidate();
2714 }
2715 }
2716 else if (e.KeyCode == Keys.Delete)
2717 {
2718 if (_selectedPlanes.Count > 0)
2719 {
2720 foreach (CollisionPlane plane in _selectedPlanes)
2721 {
2722 plane.Delete();
2723 }
2724
2726 }
2727 else if (_selectedLinks.Count > 0)
2728 {
2729 for (int i = 0; i < _selectedLinks.Count; i++)
2730 {
2731 _selectedLinks[i].Pop();
2732 }
2733
2735 }
2736
2739 _modelPanel.Invalidate();
2740 }
2741 else if (ModifierKeys == Keys.Control)
2742 {
2743 if (e.KeyCode == Keys.Z)
2744 {
2745 if (_hovering)
2746 {
2747 CancelHover();
2748 }
2749 else if (btnUndo.Enabled)
2750 {
2751 Undo(this, null);
2752 }
2753 }
2754 else if (e.KeyCode == Keys.Y)
2755 {
2756 if (_hovering)
2757 {
2758 CancelHover();
2759 }
2760 else if (btnRedo.Enabled)
2761 {
2762 Redo(this, null);
2763 }
2764 }
2765 }
2766 else if (e.KeyCode == Keys.OemOpenBrackets)
2767 {
2768 CollisionLink link = null;
2769 bool two = false;
2770
2771 if (_selectedPlanes.Count == 1)
2772 {
2773 link = _selectedPlanes[0]._linkLeft;
2774 two = true;
2775 }
2776 else if (_selectedLinks.Count == 1)
2777 {
2778 link = _selectedLinks[0];
2779 }
2780
2781 if (link != null)
2782 {
2783 foreach (CollisionPlane p in link._members)
2784 {
2785 if (p._linkRight == link)
2786 {
2788
2790 p._linkLeft._highlight = true;
2791 if (two)
2792 {
2794 p._linkRight._highlight = true;
2795 }
2796
2798 _modelPanel.Invalidate();
2799 break;
2800 }
2801 }
2802 }
2803 }
2804 else if (e.KeyCode == Keys.OemCloseBrackets)
2805 {
2806 CollisionLink link = null;
2807 bool two = false;
2808
2809 if (_selectedPlanes.Count == 1)
2810 {
2811 link = _selectedPlanes[0]._linkRight;
2812 two = true;
2813 }
2814 else if (_selectedLinks.Count == 1)
2815 {
2816 link = _selectedLinks[0];
2817 }
2818
2819 if (link != null)
2820 {
2821 foreach (CollisionPlane p in link._members)
2822 {
2823 if (p._linkLeft == link)
2824 {
2826
2828 p._linkRight._highlight = true;
2829 if (two)
2830 {
2832 p._linkLeft._highlight = true;
2833 }
2834
2836
2837 _modelPanel.Invalidate();
2838 break;
2839 }
2840 }
2841 }
2842 }
2843 else if (e.KeyCode == Keys.W)
2844 {
2845 CreateUndo();
2846 float amount = ModifierKeys == Keys.Shift ? LargeIncrement : SmallIncrement;
2847 foreach (CollisionLink link in _selectedLinks)
2848 {
2849 link._rawValue._y += amount;
2850 }
2851
2853 _modelPanel.Invalidate();
2855 }
2856 else if (e.KeyCode == Keys.S)
2857 {
2858 CreateUndo();
2859 float amount = ModifierKeys == Keys.Shift ? LargeIncrement : SmallIncrement;
2860 foreach (CollisionLink link in _selectedLinks)
2861 {
2862 link._rawValue._y -= amount;
2863 }
2864
2866 _modelPanel.Invalidate();
2868 }
2869 else if (e.KeyCode == Keys.A)
2870 {
2871 CreateUndo();
2872 float amount = ModifierKeys == Keys.Shift ? LargeIncrement : SmallIncrement;
2873 foreach (CollisionLink link in _selectedLinks)
2874 {
2875 link._rawValue._x -= amount;
2876 }
2877
2879 _modelPanel.Invalidate();
2881 }
2882 else if (e.KeyCode == Keys.D)
2883 {
2884 CreateUndo();
2885 float amount = ModifierKeys == Keys.Shift ? LargeIncrement : SmallIncrement;
2886 foreach (CollisionLink link in _selectedLinks)
2887 {
2888 link._rawValue._x += amount;
2889 }
2890
2892 _modelPanel.Invalidate();
2894 }
2895 }
virtual void SelectionModified()
Definition: CollisionEditor.cs:1406
void Undo(object sender, EventArgs e)
Definition: CollisionEditor.cs:4130
const float LargeIncrement
Definition: CollisionEditor.cs:1331
void Redo(object sender, EventArgs e)
Definition: CollisionEditor.cs:4167
void CreateUndo()
Definition: CollisionEditor.cs:4081
const float SmallIncrement
Definition: CollisionEditor.cs:1330
virtual void UpdatePropPanels()
Definition: CollisionEditor.cs:1441
ToolStripButton btnUndo
Definition: CollisionEditor.cs:96
void CancelHover()
Definition: CollisionEditor.cs:1846
List< CollisionPlane > _selectedPlanes
Definition: CollisionEditor.cs:1348
void CancelSelection()
Definition: CollisionEditor.cs:1910
bool _hovering
Definition: CollisionEditor.cs:1346
bool _selecting
Definition: CollisionEditor.cs:1350
ToolStripButton btnRedo
Definition: CollisionEditor.cs:97
List< CollisionLink > _selectedLinks
Definition: CollisionEditor.cs:1347
Definition: CollisionNode.cs:914
CollisionLink _linkRight
Definition: CollisionNode.cs:917
void Delete()
Definition: CollisionNode.cs:1306
CollisionLink _linkLeft
Definition: CollisionNode.cs:917

◆ _modelPanel_MouseDown()

void BrawlCrate.UI.CollisionEditor._modelPanel_MouseDown ( object  sender,
MouseEventArgs  e 
)
inlineprotected
1942 {
1943 if (e.Button == MouseButtons.Left)
1944 {
1945 bool create = ModifierKeys == Keys.Alt;
1946 bool add = ModifierKeys == Keys.Shift;
1947 bool createAndAdd = ModifierKeys == (Keys.Alt | Keys.Shift);
1948 bool subtract = ModifierKeys == Keys.Control;
1949 bool move = ModifierKeys == (Keys.Control | Keys.Shift);
1950
1951 float depth = _modelPanel.GetDepth(e.X, e.Y);
1952 Vector3 target = _modelPanel.CurrentViewport.UnProject(e.X, e.Y, depth);
1953 Vector2 point;
1954
1955 if (!move && depth < 1.0f)
1956 {
1957 point = (Vector2) target;
1958
1959 //Hit-detect points first
1960 foreach (CollisionObject obj in _targetNode.Children)
1961 {
1962 if (obj._render)
1963 {
1964 foreach (CollisionLink p in obj._points)
1965 {
1966 if (p.Value.Contained(point, point, PointSelectRadius))
1967 {
1968 if (create)
1969 {
1970 //Connect all selected links to point
1971 foreach (CollisionLink l in _selectedLinks)
1972 {
1973 l.Connect(p);
1974 }
1975
1976 //Select point
1978 p._highlight = true;
1979 _selectedLinks.Add(p);
1981
1982 _modelPanel.Invalidate();
1983 return;
1984 }
1985
1986 if (subtract)
1987 {
1988 p._highlight = false;
1989 _selectedLinks.Remove(p);
1990 _modelPanel.Invalidate();
1992 }
1993 else if (!_selectedLinks.Contains(p))
1994 {
1995 if (!add)
1996 {
1998 }
1999
2000 _selectedLinks.Add(p);
2001 p._highlight = true;
2002 _modelPanel.Invalidate();
2004 }
2005
2006 if (!add && !subtract)
2007 {
2008 BeginHover(target);
2009 }
2010
2011 //Single Link Selected
2012 return;
2013 }
2014 }
2015 }
2016 }
2017
2018 float dist;
2019 float bestDist = float.MaxValue;
2020 CollisionPlane bestMatch = null;
2021
2022 //Hit-detect planes finding best match
2023 foreach (CollisionObject obj in _targetNode.Children)
2024 {
2025 if (obj._render)
2026 {
2027 foreach (CollisionPlane p in obj._planes)
2028 {
2030 {
2031 dist = point.TrueDistance(p.PointLeft) + point.TrueDistance(p.PointRight) -
2033 if (dist < bestDist)
2034 {
2035 bestDist = dist;
2036 bestMatch = p;
2037 }
2038 }
2039 }
2040 }
2041 }
2042
2043 if (bestMatch != null)
2044 {
2045 if (create)
2046 {
2048
2049 _selectedLinks.Add(bestMatch.Split(point));
2050 _selectedLinks[0]._highlight = true;
2052 _modelPanel.Invalidate();
2053
2054 _creating = true;
2055 BeginHover(target);
2056
2057 return;
2058 }
2059
2060 if (subtract)
2061 {
2062 _selectedLinks.Remove(bestMatch._linkLeft);
2063 _selectedLinks.Remove(bestMatch._linkRight);
2064 bestMatch._linkLeft._highlight = bestMatch._linkRight._highlight = false;
2065 _modelPanel.Invalidate();
2066
2068 return;
2069 }
2070
2071 //Select both points
2072 if (!_selectedLinks.Contains(bestMatch._linkLeft) ||
2073 !_selectedLinks.Contains(bestMatch._linkRight))
2074 {
2075 if (!add)
2076 {
2078 }
2079
2080 _selectedLinks.Add(bestMatch._linkLeft);
2081 _selectedLinks.Add(bestMatch._linkRight);
2082 bestMatch._linkLeft._highlight = bestMatch._linkRight._highlight = true;
2083 _modelPanel.Invalidate();
2084
2086 }
2087
2088 if (!add)
2089 {
2090 BeginHover(target);
2091 }
2092
2093 //Single Platform Selected;
2094 return;
2095 }
2096 }
2097
2098 //Nothing found :(
2099
2100 //Trace ray to Z axis
2101 target = Vector3.IntersectZ(target, _modelPanel.CurrentViewport.UnProject(e.X, e.Y, 0.0f), 0.0f);
2102 point = (Vector2) target;
2103
2104 if (this is AdvancedCollisionEditor && createAndAdd && _selectedLinks.Count == 0)
2105 {
2106 if (_selectedObject == null)
2107 {
2108 return;
2109 }
2110
2111 //Create a single linked collision
2112 CollisionLink point1 = new CollisionLink(_selectedObject, point);
2113
2114 _selectedLinks.Add(point1);
2115 point1._highlight = true;
2116 _selectedPlanes.Add(new CollisionPlane(_selectedObject, point1, point1));
2118 BeginHover(target);
2119 _modelPanel.Invalidate();
2120 return;
2121 }
2122 if (create)
2123 {
2124 if (_selectedLinks.Count == 0)
2125 {
2126 if (_selectedObject == null)
2127 {
2128 return;
2129 }
2130
2131 _creating = true;
2132
2133 //Create two points and hover
2134 CollisionLink point1 = new CollisionLink(_selectedObject, point).Branch(point);
2135
2136 _selectedLinks.Add(point1);
2137 point1._highlight = true;
2138
2140 BeginHover(target);
2141 _modelPanel.Invalidate();
2142 return;
2143 }
2144
2145 if (_selectedLinks.Count == 1)
2146 {
2147 //Create new plane extending to point
2148 CollisionLink link = _selectedLinks[0];
2149 _selectedLinks[0] = link.Branch((Vector2) target);
2150 _selectedLinks[0]._highlight = true;
2151 link._highlight = false;
2153 _modelPanel.Invalidate();
2154
2155 //Hover new point so it can be moved
2156 BeginHover(target);
2157 return;
2158 }
2159
2160 if (_selectedPlanes.Count > 0)
2161 {
2162 //Find two closest points and insert between
2163 CollisionPlane bestMatch = null;
2164 if (_selectedPlanes.Count == 1)
2165 {
2166 bestMatch = _selectedPlanes[0];
2167 }
2168 else
2169 {
2170 float dist;
2171 float bestDist = float.MaxValue;
2172
2173 foreach (CollisionPlane p in _selectedPlanes)
2174 {
2175 dist = point.TrueDistance(p.PointLeft) + point.TrueDistance(p.PointRight) -
2177 if (dist < bestDist)
2178 {
2179 bestDist = dist;
2180 bestMatch = p;
2181 }
2182 }
2183 }
2184
2185 if (bestMatch == null)
2186 {
2187 bestMatch = _selectedPlanes[0];
2188 }
2189
2191 if (bestMatch != null)
2192 {
2193 _selectedLinks.Add(bestMatch.Split(point));
2194 _selectedLinks[0]._highlight = true;
2196 _modelPanel.Invalidate();
2197
2198 _creating = true;
2199 BeginHover(target);
2200 }
2201
2202 return;
2203 }
2204
2205 //Create new planes extending to point
2206 CollisionLink lnk;
2207 List<CollisionLink> links = new List<CollisionLink>();
2208 _creating = true;
2209 foreach (CollisionLink l in _selectedLinks)
2210 {
2211 links.Add(l.Branch((Vector2) target));
2212 l._highlight = false;
2213 }
2214
2215 lnk = links[0];
2216 links.RemoveAt(0);
2217 for (int x = 0; x < links.Count;)
2218 {
2219 if (lnk.Merge(links[x]))
2220 {
2221 links.RemoveAt(x);
2222 }
2223 else
2224 {
2225 x++;
2226 }
2227 }
2228
2229 _selectedLinks.Clear();
2230 _selectedLinks.Add(lnk);
2231 lnk._highlight = true;
2233 _modelPanel.Invalidate();
2234
2235 //Hover new point so it can be moved
2236 BeginHover(target);
2237
2238 return;
2239 }
2240
2241 if (move)
2242 {
2243 if (_selectedLinks.Count > 0)
2244 {
2245 BeginHover(target);
2246 }
2247
2248 return;
2249 }
2250
2251 if (!add && !subtract)
2252 {
2254 }
2255
2256 BeginSelection(target, subtract);
2257 }
2258 else if (e.Button == MouseButtons.Right)
2259 {
2260 _RCstart = DateTime.UtcNow;
2261 }
2262 }
void BeginHover(Vector3 point)
Definition: CollisionEditor.cs:1802
const float PointSelectRadius
Definition: CollisionEditor.cs:1329
void BeginSelection(Vector3 point, bool inverse)
Definition: CollisionEditor.cs:1892
bool _creating
Definition: CollisionEditor.cs:1352
new ModelPanelViewport CurrentViewport
Definition: ModelPanel.cs:108
float GetDepth(Vector2 v)
Definition: GLPanel.cs:357
Vector3 UnProject(Vector3 source)
Input is a full-screen point with a depth value of z. Output is a world point
Definition: GLViewport.cs:167
Definition: CollisionNode.cs:300
List< CollisionLink > _points
Definition: CollisionNode.cs:432
List< CollisionPlane > _planes
Definition: CollisionNode.cs:413
bool _render
Definition: CollisionNode.cs:414
Vector2 PointRight
Definition: CollisionNode.cs:1208
Vector2 PointLeft
Definition: CollisionNode.cs:1207
CollisionLink Split(Vector2 point)
Definition: CollisionNode.cs:1275
List< ResourceNode > Children
Definition: ResourceNode.cs:262
Definition: Vector2.cs:10
bool Contained(Vector2 start, Vector2 end, float expansion)
Definition: Vector2.cs:247
float TrueDistance(Vector2 p)
Definition: Vector2.cs:275
static Vector3 IntersectZ(Vector3 ray1, Vector3 ray2, float z)
Definition: Vector3.cs:486

◆ _modelPanel_MouseMove()

void BrawlCrate.UI.CollisionEditor._modelPanel_MouseMove ( object  sender,
MouseEventArgs  e 
)
inlineprotected
2299 {
2300 if (_selecting) //Selection Box
2301 {
2302 Vector3 ray1 = _modelPanel.CurrentViewport.UnProject(new Vector3(e.X, e.Y, 0.0f));
2303 Vector3 ray2 = _modelPanel.CurrentViewport.UnProject(new Vector3(e.X, e.Y, 1.0f));
2304
2305 _selectEnd = Vector3.IntersectZ(ray1, ray2, 0.0f);
2306 _selectEnd._z += SelectWidth;
2307
2308 //Update selection
2309 UpdateSelection(false);
2310
2311 _modelPanel.Invalidate();
2312 }
2313
2314 UpdateHover(e.X, e.Y);
2315 }
void UpdateHover(int x, int y)
Definition: CollisionEditor.cs:1821
void UpdateSelection(bool finish)
Definition: CollisionEditor.cs:1724
Vector3 _selectEnd
Definition: CollisionEditor.cs:1351
const float SelectWidth
Definition: CollisionEditor.cs:1328

◆ _modelPanel_MouseUp()

void BrawlCrate.UI.CollisionEditor._modelPanel_MouseUp ( object  sender,
MouseEventArgs  e 
)
inlineprotected
2265 {
2266 if (e.Button == MouseButtons.Left)
2267 {
2268 if (saveIndex - 1 > 0 && saveIndex - 1 < undoSaves.Count)
2269 {
2270 if (undoSaves[saveIndex - 1]._collisionLinks[0].Value.ToString() ==
2271 undoSaves[saveIndex - 1]._linkVectors[0].ToString()) //If equal to starting point, remove.
2272 {
2273 undoSaves.RemoveAt(saveIndex - 1);
2274 saveIndex--;
2275 if (saveIndex == 0)
2276 {
2277 btnUndo.Enabled = false;
2278 }
2279 }
2280 }
2281
2282 hasMoved = false;
2284 FinishHover();
2285 UpdateTools();
2286 }
2287 else if (e.Button == MouseButtons.Right)
2288 {
2289 DateTime _RCend = DateTime.UtcNow;
2290 if (_RCend - _RCstart <= TimeSpan.FromSeconds(0.5) && _selectedLinks != null &&
2291 _selectedLinks.Count > 0)
2292 {
2293 //contextMenuStrip3.Show(Cursor.Position);
2294 }
2295 }
2296 }
void UpdateTools()
Definition: CollisionEditor.cs:1764
void FinishHover()
Definition: CollisionEditor.cs:1887
void FinishSelection()
Definition: CollisionEditor.cs:1923
List< CollisionState > undoSaves
Definition: CollisionEditor.cs:1355
bool hasMoved
Definition: CollisionEditor.cs:1358
int saveIndex
Definition: CollisionEditor.cs:1357

◆ _modelPanel_PostRender()

void BrawlCrate.UI.CollisionEditor._modelPanel_PostRender ( object  sender)
inlineprotected
2360 {
2361 //Clear depth buffer so we can hit-detect
2362 GL.Clear(ClearBufferMask.DepthBufferBit);
2363 GL.Enable(EnableCap.DepthTest);
2364
2365 //Render objects
2367
2369 {
2371 {
2372 (o as IModel)?.RenderBones(_modelPanel.CurrentViewport);
2373 }
2374 }
2375
2376 #region RenderOverlays
2377
2378 GL.Disable(EnableCap.DepthTest);
2379 List<MDL0BoneNode> ItemBones = new List<MDL0BoneNode>();
2380
2381 MDL0Node stgPos = null;
2382
2383 MDL0BoneNode CamBone0 = null,
2384 CamBone1 = null,
2385 DeathBone0 = null,
2386 DeathBone1 = null;
2387
2388 foreach (MDL0Node m in _models)
2389 {
2390 if (m.IsStagePosition)
2391 {
2392 stgPos = m;
2393 break;
2394 }
2395 }
2396
2397 if (stgPos != null)
2398 {
2399 foreach (MDL0BoneNode bone in stgPos._linker.BoneCache)
2400 {
2401 if (bone._name == "CamLimit0N")
2402 {
2403 CamBone0 = bone;
2404 }
2405 else if (bone.Name == "CamLimit1N")
2406 {
2407 CamBone1 = bone;
2408 }
2409 else if (bone.Name == "Dead0N")
2410 {
2411 DeathBone0 = bone;
2412 }
2413 else if (bone.Name == "Dead1N")
2414 {
2415 DeathBone1 = bone;
2416 }
2417 else if (bone._name.StartsWith("Player") && bone._name.Length == 8 && btnSpawns.Checked)
2418 {
2419 Vector3 position = bone._frameMatrix.GetPoint();
2420 if (PointCollides(position))
2421 {
2422 GL.Color4(0.0f, 1.0f, 0.0f, 0.5f);
2423 }
2424 else
2425 {
2426 GL.Color4(1.0f, 0.0f, 0.0f, 0.5f);
2427 }
2428
2429 TKContext.DrawSphere(position, 5.0f, 32);
2430 if (int.TryParse(bone._name.Substring(6, 1), out int playernum))
2431 {
2432 _modelPanel.CurrentViewport.NoSettingsScreenText[playernum.ToString()] =
2433 _modelPanel.CurrentViewport.Camera.Project(position) - new Vector3(8.0f, 8.0f, 0);
2434 }
2435 }
2436 else if (bone._name.StartsWith("Rebirth") && bone._name.Length == 9 && btnSpawns.Checked)
2437 {
2438 GL.Color4(1.0f, 1.0f, 1.0f, 0.1f);
2439 TKContext.DrawSphere(bone._frameMatrix.GetPoint(), 5.0f, 32);
2440 if (int.TryParse(bone._name.Substring(7, 1), out int playernum))
2441 {
2442 _modelPanel.CurrentViewport.NoSettingsScreenText[playernum.ToString()] =
2444 new Vector3(8.0f, 8.0f, 0);
2445 }
2446 }
2447 else if (bone._name.Contains("Item"))
2448 {
2449 ItemBones.Add(bone);
2450 }
2451 }
2452 }
2453
2454 //Render item fields if checked
2455 if (ItemBones != null && btnItems.Checked)
2456 {
2457 GL.Color4(0.5f, 0.0f, 1.0f, 0.4f);
2458 for (int i = 0; i < ItemBones.Count; i += 2)
2459 {
2460 Vector3 pos1, pos2;
2461 if (ItemBones[i]._frameMatrix.GetPoint()._y == ItemBones[i + 1]._frameMatrix.GetPoint()._y)
2462 {
2463 pos1 = new Vector3(ItemBones[i]._frameMatrix.GetPoint()._x,
2464 ItemBones[i]._frameMatrix.GetPoint()._y + 1.5f, 1.0f);
2465 pos2 = new Vector3(ItemBones[i + 1]._frameMatrix.GetPoint()._x,
2466 ItemBones[i + 1]._frameMatrix.GetPoint()._y - 1.5f, 1.0f);
2467 }
2468 else
2469 {
2470 pos1 = new Vector3(ItemBones[i]._frameMatrix.GetPoint()._x,
2471 ItemBones[i]._frameMatrix.GetPoint()._y, 1.0f);
2472 pos2 = new Vector3(ItemBones[i + 1]._frameMatrix.GetPoint()._x,
2473 ItemBones[i + 1]._frameMatrix.GetPoint()._y, 1.0f);
2474 }
2475
2476
2477 if (pos1._x != pos2._x)
2478 {
2479 TKContext.DrawBox(pos1, pos2);
2480 }
2481 else
2482 {
2484 new Vector3(ItemBones[i]._frameMatrix.GetPoint()._x,
2485 ItemBones[i]._frameMatrix.GetPoint()._y, pos1._z), 3.0f, 32);
2486 }
2487 }
2488 }
2489
2490 //Render boundaries if checked
2491 if (CamBone0 != null && CamBone1 != null && btnBoundaries.Checked)
2492 {
2493 //GL.Clear(ClearBufferMask.DepthBufferBit);
2494 GL.Disable(EnableCap.DepthTest);
2495 GL.Disable(EnableCap.Lighting);
2496 GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
2497 GL.Enable(EnableCap.CullFace);
2498 GL.CullFace(CullFaceMode.Front);
2499
2500 GL.Color4(Color.Blue);
2501 GL.Begin(BeginMode.LineLoop);
2502 GL.LineWidth(15.0f);
2503
2504 Vector3
2505 camBone0 = CamBone0._frameMatrix.GetPoint(),
2506 camBone1 = CamBone1._frameMatrix.GetPoint(),
2507 deathBone0 = DeathBone0._frameMatrix.GetPoint(),
2508 deathBone1 = DeathBone1._frameMatrix.GetPoint();
2509
2510 GL.Vertex2(camBone0._x, camBone0._y);
2511 GL.Vertex2(camBone1._x, camBone0._y);
2512 GL.Vertex2(camBone1._x, camBone1._y);
2513 GL.Vertex2(camBone0._x, camBone1._y);
2514 GL.End();
2515 GL.Begin(BeginMode.LineLoop);
2516 GL.Color4(Color.Red);
2517 GL.Vertex2(deathBone0._x, deathBone0._y);
2518 GL.Vertex2(deathBone1._x, deathBone0._y);
2519 GL.Vertex2(deathBone1._x, deathBone1._y);
2520 GL.Vertex2(deathBone0._x, deathBone1._y);
2521 GL.End();
2522 GL.Color4(0.0f, 0.5f, 1.0f, 0.3f);
2523 GL.Begin(BeginMode.TriangleFan);
2524 GL.Vertex2(camBone0._x, camBone0._y);
2525 GL.Vertex2(deathBone0._x, deathBone0._y);
2526 GL.Vertex2(deathBone1._x, deathBone0._y);
2527 GL.Vertex2(camBone1._x, camBone0._y);
2528 GL.End();
2529 GL.Begin(BeginMode.TriangleFan);
2530 GL.Vertex2(camBone1._x, camBone1._y);
2531 GL.Vertex2(deathBone1._x, deathBone1._y);
2532 GL.Vertex2(deathBone0._x, deathBone1._y);
2533 GL.Vertex2(camBone0._x, camBone1._y);
2534 GL.End();
2535 GL.Begin(BeginMode.TriangleFan);
2536 GL.Vertex2(camBone1._x, camBone0._y);
2537 GL.Vertex2(deathBone1._x, deathBone0._y);
2538 GL.Vertex2(deathBone1._x, deathBone1._y);
2539 GL.Vertex2(camBone1._x, camBone1._y);
2540 GL.End();
2541 GL.Begin(BeginMode.TriangleFan);
2542 GL.Vertex2(camBone0._x, camBone1._y);
2543 GL.Vertex2(deathBone0._x, deathBone1._y);
2544 GL.Vertex2(deathBone0._x, deathBone0._y);
2545 GL.Vertex2(camBone0._x, camBone0._y);
2546 GL.End();
2547 }
2548
2549 #endregion
2550
2551 //Render selection box
2552 if (!_selecting)
2553 {
2554 return;
2555 }
2556
2557 GL.Enable(EnableCap.DepthTest);
2558 GL.Disable(EnableCap.CullFace);
2559
2560 //Draw lines
2561 GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
2562 GL.Color4(0.0f, 0.0f, 1.0f, 0.5f);
2564
2565 //Draw box
2566 GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
2567 GL.Color4(1.0f, 1.0f, 0.0f, 0.2f);
2569 }
List< IModel > _models
Definition: CollisionEditor.cs:1507
ToolStripButton btnBoundaries
Definition: CollisionEditor.cs:115
ToolStripButton btnSpawns
Definition: CollisionEditor.cs:116
Vector3 _selectStart
Definition: CollisionEditor.cs:1351
ToolStripButton btnItems
Definition: CollisionEditor.cs:117
bool PointCollides(Vector3 point)
Definition: CollisionEditor.cs:2317
BindingList< IRenderedObject > _renderList
Definition: ModelPanel.cs:44
ScreenTextHandler NoSettingsScreenText
Definition: modelpanelviewport.cs:135
Vector3 Project(float x, float y, float z)
Projects a world point to screen coordinates.
Definition: GLCamera.cs:329
GLCamera Camera
Definition: GLViewport.cs:54
Definition: TKContext.cs:15
static void DrawSphere(float radius)
Definition: TKContext.cs:547
static void DrawBox(Box value)
Definition: TKContext.cs:267
void Render()
Definition: CollisionNode.cs:210
Definition: MDL0BoneNode.cs:17
Matrix _frameMatrix
Definition: MDL0BoneNode.cs:58
Definition: MDL0Node.cs:24
ModelLinker _linker
Definition: MDL0Node.cs:45
bool IsStagePosition
Definition: MDL0Node.cs:280
string _name
Definition: ResourceNode.cs:139
string Name
Definition: IBoneNode.cs:11
Definition: IModel.cs:12
Definition: IRenderedObject.cs:40
Vector3 GetPoint()
Definition: Matrix.cs:321
float _y
Definition: Vector3.cs:41
float _z
Definition: Vector3.cs:41
float _x
Definition: Vector3.cs:41

◆ _modelPanel_PreRender()

void BrawlCrate.UI.CollisionEditor._modelPanel_PreRender ( object  sender)
inlineprotected
2356 {
2357 }

◆ _treeObjects_AfterCheck()

void BrawlCrate.UI.CollisionEditor._treeObjects_AfterCheck ( object  sender,
TreeViewEventArgs  e 
)
inlineprotected
1780 {
1781 if (e.Node.Tag is CollisionObject)
1782 {
1783 (e.Node.Tag as CollisionObject)._render = e.Node.Checked;
1784 }
1785
1786 if (e.Node.Tag is CollisionPlane)
1787 {
1788 (e.Node.Tag as CollisionPlane)._render = e.Node.Checked;
1789 }
1790
1791 _modelPanel.Invalidate();
1792 }

◆ BeginHover()

void BrawlCrate.UI.CollisionEditor.BeginHover ( Vector3  point)
inlineprotected
1803 {
1804 if (_hovering)
1805 {
1806 return;
1807 }
1808
1809 if (!hasMoved) //Create undo for first move
1810 {
1811 CreateUndo();
1812 hasMoved = true;
1814 }
1815
1816 _selectStart = _selectLast = point;
1817 _hovering = true;
1818 UpdateTools();
1819 }
Vector3 _selectLast
Definition: CollisionEditor.cs:1351

◆ BeginSelection()

void BrawlCrate.UI.CollisionEditor.BeginSelection ( Vector3  point,
bool  inverse 
)
inlineprotected
1893 {
1894 if (_selecting)
1895 {
1896 return;
1897 }
1898
1899 _selectStart = _selectEnd = point;
1900
1901 _selectEnd._z += SelectWidth;
1902 _selectStart._z -= SelectWidth;
1903
1904 _selecting = true;
1905 _selectInverse = inverse;
1906
1907 UpdateTools();
1908 }
bool _selectInverse
Definition: CollisionEditor.cs:1350

◆ btnBoundaries_Click()

void BrawlCrate.UI.CollisionEditor.btnBoundaries_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2688 {
2689 if (_updating)
2690 {
2691 return;
2692 }
2693
2694 btnBoundaries.Checked = !btnBoundaries.Checked;
2695 _modelPanel.Invalidate();
2696 }

◆ btnDelete_Click()

void BrawlCrate.UI.CollisionEditor.btnDelete_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3991 {
3992 if (_selectedPlanes.Count > 0)
3993 {
3994 foreach (CollisionPlane plane in _selectedPlanes)
3995 {
3996 plane.Delete();
3997 }
3998
4000 }
4001 else if (_selectedLinks.Count > 0)
4002 {
4003 for (int i = 0; i < _selectedLinks.Count; i++)
4004 {
4005 _selectedLinks[i].Pop();
4006 }
4007
4009 }
4010
4013 _modelPanel.Invalidate();
4014 }

◆ btnFlipColl_Click()

void BrawlCrate.UI.CollisionEditor.btnFlipColl_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4071 {
4072 foreach (CollisionPlane p in _selectedPlanes)
4073 {
4074 p.SwapLinks();
4075 }
4076
4078 _modelPanel.Invalidate();
4079 }
void SwapLinks()
Definition: CollisionNode.cs:1299

◆ btnHelp_Click()

void BrawlCrate.UI.CollisionEditor.btnHelp_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4241 {
4242 new ModelViewerHelp().Show(this, true);
4243 }
Definition: ModelViewerHelp.cs:7
void Show(IWin32Window owner, bool collisionEditor)
Definition: ModelViewerHelp.cs:13

◆ btnItems_Click()

void BrawlCrate.UI.CollisionEditor.btnItems_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2677 {
2678 if (_updating)
2679 {
2680 return;
2681 }
2682
2683 btnItems.Checked = !btnItems.Checked;
2684 _modelPanel.Invalidate();
2685 }

◆ btnMerge_Click()

void BrawlCrate.UI.CollisionEditor.btnMerge_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2586 {
2588
2589 for (int i = 0; i < _selectedLinks.Count - 1;)
2590 {
2591 CollisionLink link = _selectedLinks[i++];
2592 Vector2 pos = link.Value;
2593 int count = 1;
2594 for (int x = i; x < _selectedLinks.Count;)
2595 {
2596 if (link.Merge(_selectedLinks[x]))
2597 {
2598 pos += _selectedLinks[x].Value;
2599 count++;
2600 _selectedLinks.RemoveAt(x);
2601 }
2602 else
2603 {
2604 x++;
2605 }
2606 }
2607
2608 link.Value = pos / count;
2610 }
2611
2612 _modelPanel.Invalidate();
2613 }
void ClearUndoBuffer()
Definition: CollisionEditor.cs:4122

◆ btnNextFrame_Click()

void BrawlCrate.UI.CollisionEditor.btnNextFrame_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4237 {
4238 }

◆ btnOrthographicCam_Click()

void BrawlCrate.UI.CollisionEditor.btnOrthographicCam_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2650 {
2651 if (_updating)
2652 {
2653 return;
2654 }
2655
2656 btnPerspectiveCam.Checked = false;
2657 btnOrthographicCam.Checked = true;
2659 {
2661 _modelPanel.CurrentViewport.ViewType = ViewportProjection.Orthographic;
2662 }
2663 }
void ResetCamera()
Definition: ModelPanel.cs:54
ViewportProjection ViewType
Definition: GLViewport.cs:36
ViewportProjection
Definition: GLViewport.cs:418

◆ btnPerspectiveCam_Click()

void BrawlCrate.UI.CollisionEditor.btnPerspectiveCam_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2633 {
2634 if (_updating)
2635 {
2636 return;
2637 }
2638
2639 btnPerspectiveCam.Checked = true;
2640 btnOrthographicCam.Checked = false;
2642 {
2644 _modelPanel.CurrentViewport.ViewType = ViewportProjection.Perspective;
2645 }
2646 }

◆ btnPlayAnims_Click()

void BrawlCrate.UI.CollisionEditor.btnPlayAnims_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4229 {
4230 }

◆ btnPrevFrame_Click()

void BrawlCrate.UI.CollisionEditor.btnPrevFrame_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4233 {
4234 }

◆ btnRelink_Click()

void BrawlCrate.UI.CollisionEditor.btnRelink_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3917 {
3918 TreeNode node = modelTree.SelectedNode;
3919 if (_selectedObject == null || !(node?.Tag is MDL0BoneNode bone))
3920 {
3921 return;
3922 }
3923
3924 txtBone.Text = _selectedObject._boneName = node.Text;
3925 _selectedObject.LinkedBone = bone;
3926 txtModel.Text = _selectedObject._modelName = node.Parent.Text;
3928 _modelPanel.Invalidate();
3929 }
TreeView modelTree
Definition: CollisionEditor.cs:86

◆ btnRelinkNoMove_Click()

void BrawlCrate.UI.CollisionEditor.btnRelinkNoMove_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3932 {
3933 TreeNode node = modelTree.SelectedNode;
3934 if (_selectedObject == null || !(node?.Tag is MDL0BoneNode bone))
3935 {
3936 return;
3937 }
3938
3939 txtBone.Text = _selectedObject._boneName = node.Text;
3940 _selectedObject.LinkedBone = bone;
3941 txtModel.Text = _selectedObject._modelName = node.Parent.Text;
3942 if (_selectedObject._points != null)
3943 {
3945 {
3946 l.Value = l._rawValue;
3947 }
3948 }
3949
3951 _modelPanel.Invalidate();
3952 }

◆ btnResetCam_Click()

void BrawlCrate.UI.CollisionEditor.btnResetCam_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2627 {
2629 }

◆ btnResetRot_Click()

void BrawlCrate.UI.CollisionEditor.btnResetRot_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2621 {
2622 trackBar1.Value = 0;
2623 _modelPanel.Invalidate();
2624 }

◆ btnResetSnap_Click()

void BrawlCrate.UI.CollisionEditor.btnResetSnap_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4065 {
4067 _modelPanel.Invalidate();
4068 }
Matrix _snapMatrix
Definition: CollisionEditor.cs:1344
Definition: Matrix.cs:14
static readonly Matrix Identity
Definition: Matrix.cs:15

◆ btnSameX_Click()

void BrawlCrate.UI.CollisionEditor.btnSameX_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3830 {
3831 CreateUndo();
3832
3833 for (int i = 1; i < _selectedLinks.Count; i++)
3834 {
3835 _selectedLinks[i]._rawValue._x = _selectedLinks[0]._rawValue._x;
3836 }
3837
3838 _modelPanel.Invalidate();
3840 }

◆ btnSameY_Click()

void BrawlCrate.UI.CollisionEditor.btnSameY_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3843 {
3844 CreateUndo();
3845
3846 for (int i = 1; i < _selectedLinks.Count; i++)
3847 {
3848 _selectedLinks[i]._rawValue._y = _selectedLinks[0]._rawValue._y;
3849 }
3850
3851 _modelPanel.Invalidate();
3853 }

◆ btnSpawns_Click()

void BrawlCrate.UI.CollisionEditor.btnSpawns_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2666 {
2667 if (_updating)
2668 {
2669 return;
2670 }
2671
2672 btnSpawns.Checked = !btnSpawns.Checked;
2673 _modelPanel.Invalidate();
2674 }

◆ btnSplit_Click()

void BrawlCrate.UI.CollisionEditor.btnSplit_Click ( object  sender,
EventArgs  e 
)
inlineprotected
2572 {
2574 for (int i = _selectedLinks.Count; --i >= 0;)
2575 {
2576 _selectedLinks[i].Split();
2577 }
2578
2581 _modelPanel.Invalidate();
2583 }

◆ btnTranslateAll_Click()

void BrawlCrate.UI.CollisionEditor.btnTranslateAll_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4246 {
4247 if (_selectedLinks.Count == 0)
4248 {
4249 MessageBox.Show("You must select at least one collision link.");
4250 return;
4251 }
4252
4254 {
4255 f.TwoDimensional = true;
4256 if (f.ShowDialog() == DialogResult.OK)
4257 {
4258 Matrix m = f.GetMatrix();
4259 foreach (CollisionLink link in _selectedLinks)
4260 {
4261 link.Value = m * link.Value;
4262 }
4263
4265 _modelPanel.Invalidate();
4266 }
4267 }
4268 }
Definition: TransformAttributesForm.cs:6
Matrix GetMatrix()
Definition: TransformAttributesForm.cs:42

◆ btnUnlink_Click()

void BrawlCrate.UI.CollisionEditor.btnUnlink_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3955 {
3956 if (_selectedObject == null)
3957 {
3958 return;
3959 }
3960
3961 txtBone.Text = "";
3962 txtModel.Text = "";
3963 _selectedObject.LinkedBone = null;
3965 _modelPanel.Invalidate();
3966 }

◆ btnUnlinkNoMove_Click()

void BrawlCrate.UI.CollisionEditor.btnUnlinkNoMove_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3969 {
3970 if (_selectedObject == null)
3971 {
3972 return;
3973 }
3974
3975 if (_selectedObject._points != null)
3976 {
3978 {
3979 l._rawValue = l.Value;
3980 }
3981 }
3982
3983 txtBone.Text = "";
3984 txtModel.Text = "";
3985 _selectedObject.LinkedBone = null;
3987 _modelPanel.Invalidate();
3988 }

◆ CancelHover()

void BrawlCrate.UI.CollisionEditor.CancelHover ( )
inlineprotected
1847 {
1848 if (!_hovering)
1849 {
1850 return;
1851 }
1852
1853 if (hasMoved)
1854 {
1855 undoSaves.RemoveAt(undoSaves.Count - 1);
1856 saveIndex--;
1857 hasMoved = false;
1858 if (saveIndex == 0)
1859 {
1860 btnUndo.Enabled = false;
1861 }
1862 }
1863
1864 _hovering = false;
1865
1866 if (_creating)
1867 {
1868 _creating = false;
1869 //Delete points/plane
1870 _selectedLinks[0].Pop();
1873 }
1874 else
1875 {
1877 foreach (CollisionLink l in _selectedLinks)
1878 {
1879 l.Value += diff;
1880 }
1881 }
1882
1883 _modelPanel.Invalidate();
1885 }

◆ CancelSelection()

void BrawlCrate.UI.CollisionEditor.CancelSelection ( )
inlineprotected
1911 {
1912 if (!_selecting)
1913 {
1914 return;
1915 }
1916
1917 _selecting = false;
1918 _selectStart = _selectEnd = new Vector3(float.MaxValue);
1919 UpdateSelection(false);
1920 _modelPanel.Invalidate();
1921 }

◆ cboMaterial_SelectedIndexChanged()

void BrawlCrate.UI.CollisionEditor.cboMaterial_SelectedIndexChanged ( object  sender,
EventArgs  e 
)
inlineprotected
2900 {
2901 if (_updating)
2902 {
2903 return;
2904 }
2905
2906 _updating = true;
2907 foreach (CollisionPlane plane in _selectedPlanes)
2908 {
2909 plane._material = ((CollisionTerrain) cboMaterial.SelectedItem).ID;
2910 }
2911
2912 _updating = false;
2913
2915 }
ComboBox cboMaterial
Definition: CollisionEditor.cs:33

◆ cboType_SelectedIndexChanged()

void BrawlCrate.UI.CollisionEditor.cboType_SelectedIndexChanged ( object  sender,
EventArgs  e 
)
inlineprotected
2918 {
2919 if (_updating)
2920 {
2921 return;
2922 }
2923
2924 _updating = true;
2925 foreach (CollisionPlane plane in _selectedPlanes)
2926 {
2927 plane.Type = (CollisionPlaneType) cboType.SelectedItem;
2928 if (ErrorChecking && !plane.IsRotating)
2929 {
2930 if (!plane.IsFloor)
2931 {
2932 plane.IsFallThrough = false;
2933 chkFallThrough.Checked = false;
2934 plane.IsRightLedge = false;
2935 chkRightLedge.Checked = false;
2936 plane.IsLeftLedge = false;
2937 chkLeftLedge.Checked = false;
2938 }
2939
2940 if (!plane.IsWall)
2941 {
2942 plane.IsNoWalljump = false;
2943 chkNoWalljump.Checked = false;
2944 }
2945 }
2946 }
2947
2948 _updating = false;
2949
2950 _modelPanel.Invalidate();
2952 }
virtual bool ErrorChecking
Definition: CollisionEditor.cs:22
ComboBox cboType
Definition: CollisionEditor.cs:85
bool IsRotating
Definition: CollisionNode.cs:1159
bool IsFloor
Definition: CollisionNode.cs:980
bool IsWall
Definition: CollisionNode.cs:1003

◆ CheckSaveIndex()

void BrawlCrate.UI.CollisionEditor.CheckSaveIndex ( )
inlineprotected
4109 {
4110 if (saveIndex < 0)
4111 {
4112 saveIndex = 0;
4113 }
4114
4115 if (undoSaves.Count > 25)
4116 {
4117 undoSaves.RemoveAt(0);
4118 saveIndex--;
4119 }
4120 }

◆ chkAllModels_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkAllModels_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
1795 {
1796 foreach (TreeNode node in modelTree.Nodes)
1797 {
1798 node.Checked = chkAllModels.Checked;
1799 }
1800 }
CheckBox chkAllModels
Definition: CollisionEditor.cs:29

◆ chkBones_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkBones_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3864 {
3865 _modelPanel.RenderBones = chkBones.Checked;
3866 }
CheckBox chkBones
Definition: CollisionEditor.cs:83

◆ chkFallThrough_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkFallThrough_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3148 {
3149 if (_updating)
3150 {
3151 return;
3152 }
3153
3154 if (!ErrorChecking)
3155 {
3157 return;
3158 }
3159
3160 _updating = true;
3162 bool selection = chkFallThrough.Checked;
3163 CollisionPlaneType firstType = _selectedPlanes[0].Type;
3164 bool firstIsRotating = _selectedPlanes[0].IsRotating;
3165 bool allSameType = true;
3166 bool allNonCharacters = !_selectedPlanes[0].IsCharacters;
3167 foreach (CollisionPlane p in _selectedPlanes)
3168 {
3169 p.IsFallThrough = selection;
3170 if (!p.IsFloor && !p.IsRotating || !p.IsCharacters)
3171 {
3172 p.IsFallThrough = false;
3173 }
3174
3175 if (allSameType)
3176 {
3177 if (p.IsRotating != firstIsRotating)
3178 {
3179 allSameType = false;
3180 }
3181
3182 if (p.IsWall && (firstType == CollisionPlaneType.LeftWall ||
3183 firstType == CollisionPlaneType.RightWall))
3184 {
3185 // This is fine as far as types are concerned
3186 }
3187 else if (p.Type != firstType)
3188 {
3189 allSameType = false;
3190 }
3191 }
3192
3193 if (allNonCharacters)
3194 {
3195 allNonCharacters = !p.IsCharacters;
3196 }
3197 }
3198
3199 if ((_selectedPlanes.Count == 1 || allSameType) && _selectedPlanes.Count > 0)
3200 {
3201 chkFallThrough.Checked = _selectedPlanes[0].IsFallThrough;
3202 if (!_selectedPlanes[0].IsFloor && !_selectedPlanes[0].IsRotating || !_selectedPlanes[0].IsCharacters)
3203 {
3204 chkFallThrough.Checked = false;
3205 }
3206 }
3207
3208 if (allNonCharacters)
3209 {
3210 chkFallThrough.Checked = false;
3211 }
3212
3213 _updating = false;
3214 }
CheckBox chkFallThrough
Definition: CollisionEditor.cs:49
void chkFallThrough_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3615
CollisionPlaneType Type
Definition: CollisionNode.cs:934
bool IsCharacters
Definition: CollisionNode.cs:1052

◆ chkFallThrough_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkFallThrough_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3616 {
3617 if (_updating)
3618 {
3619 return;
3620 }
3621
3623 foreach (CollisionPlane p in _selectedPlanes)
3624 {
3625 p.IsFallThrough = chkFallThrough.Checked;
3626 }
3627 }

◆ chkFlagBucculus_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkFlagBucculus_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3690 {
3691 if (_updating)
3692 {
3693 return;
3694 }
3695
3697 foreach (CollisionPlane p in _selectedPlanes)
3698 {
3699 p.IsBucculusBury = chkFlagBucculus.Checked;
3700 }
3701 }
CheckBox chkFlagBucculus
Definition: CollisionEditor.cs:59

◆ chkFlagCrush_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkFlagCrush_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3676 {
3677 if (_updating)
3678 {
3679 return;
3680 }
3681
3683 foreach (CollisionPlane p in _selectedPlanes)
3684 {
3685 p.IsCrush = chkFlagCrush.Checked;
3686 }
3687 }
CheckBox chkFlagCrush
Definition: CollisionEditor.cs:57

◆ chkFlagSuperSoft_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkFlagSuperSoft_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3704 {
3705 if (_updating)
3706 {
3707 return;
3708 }
3709
3711 foreach (CollisionPlane p in _selectedPlanes)
3712 {
3713 p.IsSuperSoft = chkFlagSuperSoft.Checked;
3714 }
3715 }
CheckBox chkFlagSuperSoft
Definition: CollisionEditor.cs:58

◆ chkLeftLedge_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkLeftLedge_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3217 {
3218 if (_updating)
3219 {
3220 return;
3221 }
3222
3223 if (!ErrorChecking)
3224 {
3226 return;
3227 }
3228
3229 _updating = true;
3231 bool selection = chkLeftLedge.Checked;
3232 CollisionPlaneType firstType = _selectedPlanes[0].Type;
3233 bool firstIsRotating = _selectedPlanes[0].IsRotating;
3234 bool allSameType = true;
3235 bool allNonCharacters = !_selectedPlanes[0].IsCharacters;
3236 bool anyNoLedgeFloors = false;
3237 bool allNoLedge = true;
3238 foreach (CollisionPlane p in _selectedPlanes)
3239 {
3240 bool noLedge = false;
3241 if (!p.IsRotating)
3242 {
3243 foreach (CollisionPlane x in p._linkLeft._members)
3244 {
3245 if (x != p)
3246 {
3247 if ((x.Type == CollisionPlaneType.Floor || x.Type == CollisionPlaneType.RightWall) &&
3248 x.IsCharacters)
3249 {
3250 noLedge = true;
3251 if (x.Type == CollisionPlaneType.Floor)
3252 {
3253 anyNoLedgeFloors = true;
3254 }
3255 }
3256 }
3257 }
3258 }
3259
3260 if (!p.IsFloor && !p.IsRotating || !p.IsCharacters)
3261 {
3262 noLedge = true;
3263 }
3264
3265 if (!noLedge)
3266 {
3267 allNoLedge = false;
3268 p.IsLeftLedge = selection;
3269 }
3270 else
3271 {
3272 p.IsLeftLedge = false;
3273 continue;
3274 }
3275
3276 if (p.IsLeftLedge)
3277 {
3278 p.IsRightLedge = false;
3279 }
3280
3281 if (allSameType)
3282 {
3283 if (p.IsRotating != firstIsRotating)
3284 {
3285 allSameType = false;
3286 }
3287
3288 if (p.IsWall && (firstType == CollisionPlaneType.LeftWall ||
3289 firstType == CollisionPlaneType.RightWall))
3290 {
3291 // This is fine as far as types are concerned
3292 }
3293 else if (p.Type != firstType)
3294 {
3295 allSameType = false;
3296 }
3297 }
3298
3299 if (allNonCharacters)
3300 {
3301 allNonCharacters = !p.IsCharacters;
3302 }
3303 }
3304
3305 if (allNonCharacters)
3306 {
3307 chkLeftLedge.Checked = false;
3308 }
3309 else if (allNoLedge)
3310 {
3311 chkLeftLedge.Checked = false;
3312 }
3313 else if (anyNoLedgeFloors)
3314 {
3315 if (chkLeftLedge.Checked != selection)
3316 {
3317 chkLeftLedge.Checked = selection;
3318 }
3319 }
3320 else if (!anyNoLedgeFloors)
3321 {
3322 chkRightLedge.Checked = false;
3323 if (chkLeftLedge.Checked != selection)
3324 {
3325 chkLeftLedge.Checked = selection;
3326 }
3327 }
3328
3329 if ((_selectedPlanes.Count == 1 || allSameType) && _selectedPlanes.Count > 0 && !anyNoLedgeFloors &&
3330 !allNonCharacters)
3331 {
3332 chkLeftLedge.Checked = _selectedPlanes[0].IsLeftLedge;
3333 if (_selectedPlanes[0].IsLeftLedge)
3334 {
3335 chkRightLedge.Checked = false;
3336 }
3337
3338 if (!_selectedPlanes[0].IsFloor && !_selectedPlanes[0].IsRotating)
3339 {
3340 chkRightLedge.Checked = false;
3341 chkLeftLedge.Checked = false;
3342 }
3343 }
3344
3345 _updating = false;
3346
3347 _modelPanel.Invalidate();
3348 }
CheckBox chkLeftLedge
Definition: CollisionEditor.cs:84
void chkLeftLedge_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3629
bool IsLeftLedge
Definition: CollisionNode.cs:1141

◆ chkLeftLedge_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkLeftLedge_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3630 {
3631 if (_updating)
3632 {
3633 return;
3634 }
3635
3637 foreach (CollisionPlane p in _selectedPlanes)
3638 {
3639 p.IsLeftLedge = chkLeftLedge.Checked;
3640 }
3641
3642 _modelPanel.Invalidate();
3643 }

◆ chkNoWalljump_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkNoWalljump_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3489 {
3490 if (_updating)
3491 {
3492 return;
3493 }
3494
3495 if (!ErrorChecking)
3496 {
3498 return;
3499 }
3500
3501 _updating = true;
3503 bool selection = chkNoWalljump.Checked;
3504 CollisionPlaneType firstType = _selectedPlanes[0].Type;
3505 bool firstIsRotating = _selectedPlanes[0].IsRotating;
3506 bool allSameType = true;
3507 bool allNonCharacters = !_selectedPlanes[0].IsCharacters;
3508 foreach (CollisionPlane p in _selectedPlanes)
3509 {
3510 p.IsNoWalljump = selection;
3511 if (!p.IsWall && !p.IsRotating || !p.IsCharacters)
3512 {
3513 p.IsNoWalljump = false;
3514 }
3515
3516 if (allSameType)
3517 {
3518 if (p.IsRotating != firstIsRotating)
3519 {
3520 allSameType = false;
3521 }
3522
3523 if (p.IsWall && (firstType == CollisionPlaneType.LeftWall ||
3524 firstType == CollisionPlaneType.RightWall))
3525 {
3526 // This is fine as far as types are concerned
3527 }
3528 else if (p.Type != firstType)
3529 {
3530 allSameType = false;
3531 }
3532 }
3533
3534 if (allNonCharacters)
3535 {
3536 allNonCharacters = !p.IsCharacters;
3537 }
3538 }
3539
3540 if ((_selectedPlanes.Count == 1 || allSameType) && _selectedPlanes.Count > 0)
3541 {
3542 chkNoWalljump.Checked = _selectedPlanes[0].IsNoWalljump;
3543 if (!_selectedPlanes[0].IsWall && !_selectedPlanes[0].IsRotating)
3544 {
3545 chkNoWalljump.Checked = false;
3546 }
3547 }
3548
3549 if (allNonCharacters)
3550 {
3551 chkNoWalljump.Checked = false;
3552 }
3553
3554 _updating = false;
3555 }
CheckBox chkNoWalljump
Definition: CollisionEditor.cs:51
void chkNoWalljump_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3661

◆ chkNoWalljump_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkNoWalljump_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3662 {
3663 if (_updating)
3664 {
3665 return;
3666 }
3667
3669 foreach (CollisionPlane p in _selectedPlanes)
3670 {
3671 p.IsNoWalljump = chkNoWalljump.Checked;
3672 }
3673 }

◆ chkObjIndep_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkObjIndep_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
4203 {
4204 }

◆ chkObjModule_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkObjModule_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
4207 {
4208 if (_selectedObject == null || _updating)
4209 {
4210 return;
4211 }
4212
4213 _selectedObject.ModuleControlled = chkObjModule.Checked;
4215 }
CheckBox chkObjModule
Definition: CollisionEditor.cs:99

◆ chkObjSSEUnk_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkObjSSEUnk_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
4218 {
4219 if (_selectedObject == null || _updating)
4220 {
4221 return;
4222 }
4223
4224 _selectedObject.UnknownSSEFlag = chkObjSSEUnk.Checked;
4226 }
CheckBox chkObjSSEUnk
Definition: CollisionEditor.cs:101

◆ chkObjUnk_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkObjUnk_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
4192 {
4193 if (_selectedObject == null || _updating)
4194 {
4195 return;
4196 }
4197
4198 _selectedObject.UnknownFlag = chkObjUnk.Checked;
4200 }
CheckBox chkObjUnk
Definition: CollisionEditor.cs:100

◆ chkPoly_CheckStateChanged()

void BrawlCrate.UI.CollisionEditor.chkPoly_CheckStateChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3856 {
3858 _modelPanel.RenderPolygons = chkPoly.CheckState == CheckState.Checked;
3859 _modelPanel.RenderWireframe = chkPoly.CheckState == CheckState.Indeterminate;
3861 }
void EndUpdate()
Definition: GLPanel.cs:244
void BeginUpdate()
Definition: GLPanel.cs:239

◆ chkRightLedge_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkRightLedge_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3351 {
3352 if (_updating)
3353 {
3354 return;
3355 }
3356
3357 if (!ErrorChecking)
3358 {
3360 return;
3361 }
3362
3363 _updating = false;
3365 bool selection = chkRightLedge.Checked;
3366 CollisionPlaneType firstType = _selectedPlanes[0].Type;
3367 bool firstIsRotating = _selectedPlanes[0].IsRotating;
3368 bool allSameType = true;
3369 bool allNonCharacters = !_selectedPlanes[0].IsCharacters;
3370 bool anyNoLedgeFloors = false;
3371 bool allNoLedge = true;
3372
3373 foreach (CollisionPlane p in _selectedPlanes)
3374 {
3375 bool noLedge = false;
3376
3377 if (!p.IsRotating)
3378 {
3379 foreach (CollisionPlane x in p._linkRight._members)
3380 {
3381 if (x != p)
3382 {
3383 if ((x.Type == CollisionPlaneType.Floor || x.Type == CollisionPlaneType.LeftWall) &&
3384 x.IsCharacters)
3385 {
3386 noLedge = true;
3387 if (x.Type == CollisionPlaneType.Floor)
3388 {
3389 anyNoLedgeFloors = true;
3390 }
3391 }
3392 }
3393 }
3394 }
3395
3396 if (!p.IsFloor && !p.IsRotating || !p.IsCharacters)
3397 {
3398 noLedge = true;
3399 }
3400
3401 if (!noLedge)
3402 {
3403 allNoLedge = false;
3404 p.IsRightLedge = selection;
3405 }
3406 else
3407 {
3408 p.IsRightLedge = false;
3409 continue;
3410 }
3411
3412 if (p.IsRightLedge)
3413 {
3414 p.IsLeftLedge = false;
3415 }
3416
3417 if (allSameType)
3418 {
3419 if (p.IsRotating != firstIsRotating)
3420 {
3421 allSameType = false;
3422 }
3423
3424 if (p.IsWall && (firstType == CollisionPlaneType.RightWall ||
3425 firstType == CollisionPlaneType.LeftWall))
3426 {
3427 // This is fine as far as types are concerned
3428 }
3429 else if (p.Type != firstType)
3430 {
3431 allSameType = false;
3432 }
3433 }
3434
3435 if (allNonCharacters)
3436 {
3437 allNonCharacters = !p.IsCharacters;
3438 }
3439 }
3440
3441 if (allNonCharacters)
3442 {
3443 chkRightLedge.Checked = false;
3444 }
3445 else if (allNoLedge)
3446 {
3447 if (chkRightLedge.Checked)
3448 {
3449 chkRightLedge.Checked = false;
3450 }
3451 }
3452 else if (anyNoLedgeFloors)
3453 {
3454 if (chkRightLedge.Checked != selection)
3455 {
3456 chkRightLedge.Checked = selection;
3457 }
3458 }
3459 else if (!anyNoLedgeFloors)
3460 {
3461 chkLeftLedge.Checked = false;
3462 if (chkRightLedge.Checked != selection)
3463 {
3464 chkRightLedge.Checked = selection;
3465 }
3466 }
3467
3468 if ((_selectedPlanes.Count == 1 || allSameType) && _selectedPlanes.Count > 0 && !anyNoLedgeFloors &&
3469 !allNonCharacters)
3470 {
3471 chkRightLedge.Checked = _selectedPlanes[0].IsRightLedge;
3472 if (_selectedPlanes[0].IsRightLedge)
3473 {
3474 chkLeftLedge.Checked = false;
3475 }
3476
3477 if (!_selectedPlanes[0].IsFloor && !_selectedPlanes[0].IsRotating)
3478 {
3479 chkLeftLedge.Checked = false;
3480 chkRightLedge.Checked = false;
3481 }
3482 }
3483
3484 _modelPanel.Invalidate();
3485 _updating = false;
3486 }
void chkRightLedge_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3645
CheckBox chkRightLedge
Definition: CollisionEditor.cs:52
bool IsRightLedge
Definition: CollisionNode.cs:1135

◆ chkRightLedge_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkRightLedge_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3646 {
3647 if (_updating)
3648 {
3649 return;
3650 }
3651
3653 foreach (CollisionPlane p in _selectedPlanes)
3654 {
3655 p.IsRightLedge = chkRightLedge.Checked;
3656 }
3657
3658 _modelPanel.Invalidate();
3659 }

◆ chkTypeCharacters_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkTypeCharacters_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
2955 {
2956 if (_updating)
2957 {
2958 return;
2959 }
2960
2961 if (!ErrorChecking)
2962 {
2964 return;
2965 }
2966
2967
2969 _updating = true;
2970 bool selection = chkTypeCharacters.Checked;
2971 foreach (CollisionPlane p in _selectedPlanes)
2972 {
2973 p.IsCharacters = selection;
2974 if (p.IsCharacters)
2975 {
2976 p.IsItems = false;
2977 chkTypeItems.Checked = false;
2978 p.IsPokemonTrainer = false;
2979 chkTypePokemonTrainer.Checked = false;
2980 }
2981 else
2982 {
2983 p.IsFallThrough = false;
2984 chkFallThrough.Checked = false;
2985 p.IsNoWalljump = false;
2986 chkNoWalljump.Checked = false;
2987 p.IsRightLedge = false;
2988 chkRightLedge.Checked = false;
2989 p.IsLeftLedge = false;
2990 chkLeftLedge.Checked = false;
2991 }
2992 }
2993
2994 _updating = false;
2995 _modelPanel.Invalidate();
2996 }
CheckBox chkTypeCharacters
Definition: CollisionEditor.cs:53
void chkTypeCharacters_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3557

◆ chkTypeCharacters_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkTypeCharacters_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3558 {
3559 if (_updating)
3560 {
3561 return;
3562 }
3563
3565 foreach (CollisionPlane p in _selectedPlanes)
3566 {
3567 p.IsCharacters = chkTypeCharacters.Checked;
3568 }
3569
3570 _modelPanel.Invalidate();
3571 }

◆ chkTypeItems_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkTypeItems_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
2999 {
3000 if (_updating)
3001 {
3002 return;
3003 }
3004
3005 if (!ErrorChecking)
3006 {
3008 return;
3009 }
3010
3012 _updating = true;
3013 bool selection = chkTypeItems.Checked;
3014 foreach (CollisionPlane p in _selectedPlanes)
3015 {
3016 p.IsItems = selection;
3017 if (p.IsItems)
3018 {
3019 p.IsCharacters = false;
3020 chkTypeCharacters.Checked = false;
3021 p.IsFallThrough = false;
3022 chkFallThrough.Checked = false;
3023 p.IsNoWalljump = false;
3024 chkNoWalljump.Checked = false;
3025 p.IsRightLedge = false;
3026 chkRightLedge.Checked = false;
3027 p.IsLeftLedge = false;
3028 chkLeftLedge.Checked = false;
3029 }
3030 }
3031
3032 _updating = false;
3033 _modelPanel.Invalidate();
3034 }
CheckBox chkTypeItems
Definition: CollisionEditor.cs:54
void chkTypeItems_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3573
bool IsItems
Definition: CollisionNode.cs:1059

◆ chkTypeItems_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkTypeItems_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3574 {
3575 if (_updating)
3576 {
3577 return;
3578 }
3579
3581 foreach (CollisionPlane p in _selectedPlanes)
3582 {
3583 p.IsItems = chkTypeItems.Checked;
3584 }
3585 }

◆ chkTypePokemonTrainer_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkTypePokemonTrainer_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3037 {
3038 if (_updating)
3039 {
3040 return;
3041 }
3042
3043 if (!ErrorChecking)
3044 {
3046 return;
3047 }
3048
3050 _updating = true;
3051 bool selection = chkTypePokemonTrainer.Checked;
3052 foreach (CollisionPlane p in _selectedPlanes)
3053 {
3054 p.IsPokemonTrainer = selection;
3055 if (p.IsPokemonTrainer)
3056 {
3057 p.IsCharacters = false;
3058 chkTypeCharacters.Checked = false;
3059 p.IsFallThrough = false;
3060 chkFallThrough.Checked = false;
3061 p.IsNoWalljump = false;
3062 chkNoWalljump.Checked = false;
3063 p.IsRightLedge = false;
3064 chkRightLedge.Checked = false;
3065 p.IsLeftLedge = false;
3066 chkLeftLedge.Checked = false;
3067 }
3068 }
3069
3070 _updating = false;
3071 _modelPanel.Invalidate();
3072 }
CheckBox chkTypePokemonTrainer
Definition: CollisionEditor.cs:55
void chkTypePokemonTrainer_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3587
bool IsPokemonTrainer
Definition: CollisionNode.cs:1065

◆ chkTypePokemonTrainer_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkTypePokemonTrainer_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3588 {
3589 if (_updating)
3590 {
3591 return;
3592 }
3593
3595 foreach (CollisionPlane p in _selectedPlanes)
3596 {
3597 p.IsPokemonTrainer = chkTypePokemonTrainer.Checked;
3598 }
3599 }

◆ chkTypeRotating_CheckedChanged()

void BrawlCrate.UI.CollisionEditor.chkTypeRotating_CheckedChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3075 {
3076 if (_updating)
3077 {
3078 return;
3079 }
3080
3081 if (!ErrorChecking)
3082 {
3084 return;
3085 }
3086
3088 _updating = true;
3089 bool selection = chkTypeRotating.Checked;
3090 CollisionPlaneType firstType = _selectedPlanes[0].Type;
3091 bool allSameType = true;
3092 foreach (CollisionPlane p in _selectedPlanes)
3093 {
3094 p.IsRotating = selection;
3095 if (!p.IsRotating)
3096 {
3097 if (!p.IsFloor)
3098 {
3099 p.IsFallThrough = false;
3100 p.IsRightLedge = false;
3101 p.IsLeftLedge = false;
3102 }
3103
3104 if (!p.IsWall)
3105 {
3106 p.IsNoWalljump = false;
3107 }
3108 }
3109
3110 if (allSameType)
3111 {
3112 if (p.IsWall && (firstType == CollisionPlaneType.LeftWall ||
3113 firstType == CollisionPlaneType.RightWall))
3114 {
3115 // This is fine as far as types are concerned
3116 }
3117 else if (p.Type != firstType)
3118 {
3119 allSameType = false;
3120 }
3121 }
3122 }
3123
3124 if ((_selectedPlanes.Count == 1 || allSameType) && _selectedPlanes.Count > 0)
3125 {
3126 chkTypeRotating.Checked = _selectedPlanes[0].IsRotating;
3127 if (!_selectedPlanes[0].IsRotating)
3128 {
3129 if (!_selectedPlanes[0].IsFloor)
3130 {
3131 chkFallThrough.Checked = false;
3132 chkRightLedge.Checked = false;
3133 chkLeftLedge.Checked = false;
3134 }
3135
3136 if (!_selectedPlanes[0].IsWall)
3137 {
3138 chkNoWalljump.Checked = false;
3139 }
3140 }
3141 }
3142
3143 _updating = false;
3144 _modelPanel.Invalidate();
3145 }
CheckBox chkTypeRotating
Definition: CollisionEditor.cs:56
void chkTypeRotating_CheckedChanged_NoErrorHandling(object sender, EventArgs e)
Definition: CollisionEditor.cs:3601

◆ chkTypeRotating_CheckedChanged_NoErrorHandling()

void BrawlCrate.UI.CollisionEditor.chkTypeRotating_CheckedChanged_NoErrorHandling ( object  sender,
EventArgs  e 
)
inlineprotected
3602 {
3603 if (_updating)
3604 {
3605 return;
3606 }
3607
3609 foreach (CollisionPlane p in _selectedPlanes)
3610 {
3611 p.IsRotating = chkTypeRotating.Checked;
3612 }
3613 }

◆ ClearSelection()

void BrawlCrate.UI.CollisionEditor.ClearSelection ( )
inlineprotected
1714 {
1715 foreach (CollisionLink l in _selectedLinks)
1716 {
1717 l._highlight = false;
1718 }
1719
1720 _selectedLinks.Clear();
1721 _selectedPlanes.Clear();
1722 }

◆ ClearUndoBuffer()

void BrawlCrate.UI.CollisionEditor.ClearUndoBuffer ( )
inlineprotected
4123 {
4124 saveIndex = 0;
4125 undoSaves.Clear();
4126 redoSaves.Clear();
4127 btnUndo.Enabled = btnRedo.Enabled = false;
4128 }
List< CollisionState > redoSaves
Definition: CollisionEditor.cs:1356

◆ contextMenuStrip1_Opening()

void BrawlCrate.UI.CollisionEditor.contextMenuStrip1_Opening ( object  sender,
CancelEventArgs  e 
)
inlineprotected
4025 {
4026 if (_selectedObject == null)
4027 {
4028 contextMenuStrip1.Items[1].Visible = contextMenuStrip1.Items[2].Visible =
4029 contextMenuStrip1.Items[3].Visible = contextMenuStrip1.Items[4].Visible =
4030 contextMenuStrip1.Items[5].Visible = contextMenuStrip1.Items[6].Visible =
4031 contextMenuStrip1.Items[7].Visible = false;
4032 }
4033 else
4034 {
4035 contextMenuStrip1.Items[1].Visible = contextMenuStrip1.Items[2].Visible =
4036 contextMenuStrip1.Items[3].Visible = contextMenuStrip1.Items[4].Visible =
4037 contextMenuStrip1.Items[5].Visible = contextMenuStrip1.Items[6].Visible =
4038 contextMenuStrip1.Items[7].Visible = true;
4039 }
4040 }
ContextMenuStrip contextMenuStrip1
Definition: CollisionEditor.cs:40

◆ contextMenuStrip2_Opening()

void BrawlCrate.UI.CollisionEditor.contextMenuStrip2_Opening ( object  sender,
CancelEventArgs  e 
)
inlineprotected
4017 {
4018 if (!(modelTree.SelectedNode?.Tag is MDL0BoneNode))
4019 {
4020 e.Cancel = true;
4021 }
4022 }

◆ contextMenuStrip3_Opening()

void BrawlCrate.UI.CollisionEditor.contextMenuStrip3_Opening ( object  sender,
CancelEventArgs  e 
)
inlineprotected
4043 {
4044 mergeToolStripMenuItem.Visible = alignXToolStripMenuItem.Visible =
4045 alignYToolStripMenuItem.Visible = _selectedLinks != null && _selectedLinks.Count > 1;
4046 moveToNewObjectToolStripMenuItem.Visible =
4047 flipToolStripMenuItem.Visible = _selectedPlanes != null && _selectedPlanes.Count > 0;
4048 moveToNewObjectToolStripMenuItem.Visible = false;
4049 //contextMenuStrip3.Items[0].Visible = contextMenuStrip3.Items[1].Visible = contextMenuStrip3.Items[2].Visible = contextMenuStrip3.Items[3].Visible = contextMenuStrip3.Items[4].Visible = contextMenuStrip3.Items[6].Visible = contextMenuStrip3.Items[7].Visible = (_selectedPlanes != null && _selectedPlanes.Count > 0);
4050 }

◆ CreateUndo()

void BrawlCrate.UI.CollisionEditor.CreateUndo ( )
inlineprotected
4082 {
4084 if (undoSaves.Count > saveIndex)
4085 {
4086 undoSaves.RemoveRange(saveIndex, undoSaves.Count - saveIndex);
4087 redoSaves.Clear();
4088 }
4089
4090 save = new CollisionState
4091 {
4092 _collisionLinks = new List<CollisionLink>(),
4093 _linkVectors = new List<Vector2>()
4094 };
4095
4096 foreach (CollisionLink l in _selectedLinks)
4097 {
4098 save._collisionLinks.Add(l);
4099 save._linkVectors.Add(l.Value);
4100 }
4101
4102 undoSaves.Add(save);
4103 btnUndo.Enabled = true;
4104 saveIndex++;
4105 save = null;
4106 }
CollisionState save
Definition: CollisionEditor.cs:1354
void CheckSaveIndex()
Definition: CollisionEditor.cs:4108
Definition: SaveState.cs:13
List< Vector2 > _linkVectors
Definition: SaveState.cs:15
List< CollisionLink > _collisionLinks
Definition: SaveState.cs:14

◆ FinishHover()

void BrawlCrate.UI.CollisionEditor.FinishHover ( )
inlineprotected
1888 {
1889 _hovering = false;
1890 }

◆ FinishSelection()

void BrawlCrate.UI.CollisionEditor.FinishSelection ( )
inlineprotected
1924 {
1925 if (!_selecting)
1926 {
1927 return;
1928 }
1929
1930 _selecting = false;
1931 UpdateSelection(true);
1932 _modelPanel.Invalidate();
1933
1935
1936 //Selection Area Selected.
1937 }

◆ InitializeComponent()

void BrawlCrate.UI.CollisionEditor.InitializeComponent ( )
inlineprotected
130 {
131 components = new Container();
132 ComponentResourceManager resources = new ComponentResourceManager(typeof(CollisionEditor));
133 undoToolStrip = new SplitContainer();
134 redoToolStrip = new SplitContainer();
135 modelTree = new TreeView();
136 contextMenuStrip2 = new ContextMenuStrip(components);
137 assignToolStripMenuItem = new ToolStripMenuItem();
138 assignNoMoveToolStripMenuItem = new ToolStripMenuItem();
139 assignSeperatorToolStripMenuItem = new ToolStripSeparator();
140 snapToolStripMenuItem1 = new ToolStripMenuItem();
141 panel2 = new Panel();
142 chkBones = new CheckBox();
143 chkPoly = new CheckBox();
144 chkAllModels = new CheckBox();
145 lstObjects = new CheckedListBox();
146 contextMenuStrip1 = new ContextMenuStrip(components);
147 newObjectToolStripMenuItem = new ToolStripMenuItem();
148 toolStripMenuItem3 = new ToolStripSeparator();
149 unlinkToolStripMenuItem = new ToolStripMenuItem();
150 unlinkNoMoveToolStripMenuItem = new ToolStripMenuItem();
151 toolStripMenuItem2 = new ToolStripSeparator();
152 snapToolStripMenuItem = new ToolStripMenuItem();
153 toolStripMenuItem1 = new ToolStripSeparator();
154 _deleteToolStripMenuItem = new ToolStripMenuItem();
155 panel3 = new Panel();
156 pnlPlaneProps = new Panel();
157 groupBoxFlags2 = new GroupBox();
158 chkFlagCrush = new CheckBox();
159 chkFlagBucculus = new CheckBox();
160 chkFlagSuperSoft = new CheckBox();
161 groupBoxFlags1 = new GroupBox();
162 chkLeftLedge = new CheckBox();
163 chkNoWalljump = new CheckBox();
164 chkRightLedge = new CheckBox();
165 chkTypeRotating = new CheckBox();
166 chkFallThrough = new CheckBox();
167 groupBoxTargets = new GroupBox();
168 chkTypePokemonTrainer = new CheckBox();
169 chkTypeItems = new CheckBox();
170 chkTypeCharacters = new CheckBox();
171 cboMaterial = new ComboBox();
172 cboType = new ComboBox();
173 label5 = new Label();
174 labelType = new Label();
175 pnlPointProps = new Panel();
176 label2 = new Label();
177 numY = new NumericInputBox();
178 label1 = new Label();
179 numX = new NumericInputBox();
180 pnlObjProps = new Panel();
181 chkObjSSEUnk = new CheckBox();
182 chkObjModule = new CheckBox();
183 chkObjUnk = new CheckBox();
184 btnUnlink = new Button();
185 btnRelink = new Button();
186 txtBone = new TextBox();
187 label4 = new Label();
188 txtModel = new TextBox();
189 label3 = new Label();
190 panel4 = new Panel();
191 btnPlayAnims = new Button();
192 btnPrevFrame = new Button();
193 btnNextFrame = new Button();
194 _modelPanel = new ModelPanel();
195 panel1 = new Panel();
196 toolStrip1 = new ToolStrip();
197 btnUndo = new ToolStripButton();
198 btnRedo = new ToolStripButton();
199 toolStripSeparator3 = new ToolStripSeparator();
200 btnTransform = new ToolStripButton();
201 btnSplit = new ToolStripButton();
202 btnMerge = new ToolStripButton();
203 btnFlipColl = new ToolStripButton();
204 btnDelete = new ToolStripButton();
205 toolStripSeparator2 = new ToolStripSeparator();
206 btnSameX = new ToolStripButton();
207 btnSameY = new ToolStripButton();
208 toolStripSeparator1 = new ToolStripSeparator();
209 btnPerspectiveCam = new ToolStripButton();
210 btnOrthographicCam = new ToolStripButton();
211 btnResetCam = new ToolStripButton();
212 toolStripSeparatorCamera = new ToolStripSeparator();
213 btnSpawns = new ToolStripButton();
214 btnItems = new ToolStripButton();
215 btnBoundaries = new ToolStripButton();
216 toolStripSeparatorOverlays = new ToolStripSeparator();
217 btnResetSnap = new ToolStripButton();
218 btnHelp = new ToolStripButton();
219 btnResetRot = new Button();
220 trackBar1 = new TrackBar();
221 contextMenuStrip3 = new ContextMenuStrip(components);
222 moveToNewObjectToolStripMenuItem = new ToolStripMenuItem();
223 toolStripSeparator4 = new ToolStripSeparator();
224 splitToolStripMenuItem = new ToolStripMenuItem();
225 mergeToolStripMenuItem = new ToolStripMenuItem();
226 flipToolStripMenuItem = new ToolStripMenuItem();
227 _deleteToolStripMenuItem1 = new ToolStripMenuItem();
228 transformToolStripMenuItem = new ToolStripMenuItem();
229 alignXToolStripMenuItem = new ToolStripMenuItem();
230 alignYToolStripMenuItem = new ToolStripMenuItem();
231 ((ISupportInitialize) undoToolStrip).BeginInit();
232 undoToolStrip.Panel1.SuspendLayout();
233 undoToolStrip.Panel2.SuspendLayout();
234 undoToolStrip.SuspendLayout();
235 ((ISupportInitialize) redoToolStrip).BeginInit();
236 redoToolStrip.Panel1.SuspendLayout();
237 redoToolStrip.Panel2.SuspendLayout();
238 redoToolStrip.SuspendLayout();
239 contextMenuStrip2.SuspendLayout();
240 panel2.SuspendLayout();
241 contextMenuStrip1.SuspendLayout();
242 panel3.SuspendLayout();
243 pnlPlaneProps.SuspendLayout();
244 groupBoxFlags2.SuspendLayout();
245 groupBoxFlags1.SuspendLayout();
246 groupBoxTargets.SuspendLayout();
247 pnlPointProps.SuspendLayout();
248 pnlObjProps.SuspendLayout();
249 panel4.SuspendLayout();
250 panel1.SuspendLayout();
251 toolStrip1.SuspendLayout();
252 ((ISupportInitialize) trackBar1).BeginInit();
253 contextMenuStrip3.SuspendLayout();
254 SuspendLayout();
255 //
256 // undoToolStrip
257 //
258 undoToolStrip.Dock = DockStyle.Fill;
259 undoToolStrip.FixedPanel = FixedPanel.Panel1;
260 undoToolStrip.Location = new Point(0, 0);
261 undoToolStrip.Name = "undoToolStrip";
262 //
263 // undoToolStrip.Panel1
264 //
265 undoToolStrip.Panel1.Controls.Add(redoToolStrip);
266 //
267 // undoToolStrip.Panel2
268 //
269 undoToolStrip.Panel2.Controls.Add(_modelPanel);
270 undoToolStrip.Panel2.Controls.Add(panel1);
271 undoToolStrip.Size = new Size(694, 467);
272 undoToolStrip.SplitterDistance = 209;
273 undoToolStrip.TabIndex = 1;
274 //
275 // redoToolStrip
276 //
277 redoToolStrip.Dock = DockStyle.Fill;
278 redoToolStrip.Location = new Point(0, 0);
279 redoToolStrip.Name = "redoToolStrip";
280 redoToolStrip.Orientation = Orientation.Horizontal;
281 //
282 // redoToolStrip.Panel1
283 //
284 redoToolStrip.Panel1.Controls.Add(modelTree);
285 redoToolStrip.Panel1.Controls.Add(panel2);
286 //
287 // redoToolStrip.Panel2
288 //
289 redoToolStrip.Panel2.Controls.Add(lstObjects);
290 redoToolStrip.Panel2.Controls.Add(panel3);
291 redoToolStrip.Panel2.Controls.Add(panel4);
292 redoToolStrip.Size = new Size(209, 467);
293 redoToolStrip.SplitterDistance = 242;
294 redoToolStrip.TabIndex = 2;
295 //
296 // modelTree
297 //
298 modelTree.BorderStyle = BorderStyle.None;
299 modelTree.CheckBoxes = true;
300 modelTree.ContextMenuStrip = contextMenuStrip2;
301 modelTree.Dock = DockStyle.Fill;
302 modelTree.HideSelection = false;
303 modelTree.Location = new Point(0, 17);
304 modelTree.Name = "modelTree";
305 modelTree.Size = new Size(209, 225);
306 modelTree.TabIndex = 4;
307 modelTree.AfterCheck += new TreeViewEventHandler(modelTree_AfterCheck);
308 modelTree.BeforeSelect += new TreeViewCancelEventHandler(modelTree_BeforeSelect);
309 modelTree.AfterSelect += new TreeViewEventHandler(modelTree_AfterSelect);
310 //
311 // contextMenuStrip2
312 //
313 contextMenuStrip2.Items.AddRange(new ToolStripItem[]
314 {
319 });
320 contextMenuStrip2.Name = "contextMenuStrip2";
321 contextMenuStrip2.Size = new Size(239, 76);
322 contextMenuStrip2.Opening += new CancelEventHandler(contextMenuStrip2_Opening);
323 //
324 // assignToolStripMenuItem
325 //
326 assignToolStripMenuItem.Name = "assignToolStripMenuItem";
327 assignToolStripMenuItem.Size = new Size(238, 22);
328 assignToolStripMenuItem.Text = "Assign";
329 assignToolStripMenuItem.Click += new EventHandler(btnRelink_Click);
330 //
331 // assignNoMoveToolStripMenuItem
332 //
333 assignNoMoveToolStripMenuItem.Name = "assignNoMoveToolStripMenuItem";
334 assignNoMoveToolStripMenuItem.Size = new Size(238, 22);
335 assignNoMoveToolStripMenuItem.Text = "Assign (No relative movement)";
336 assignNoMoveToolStripMenuItem.Click += new EventHandler(btnRelinkNoMove_Click);
337 //
338 // assignSeperatorToolStripMenuItem
339 //
340 assignSeperatorToolStripMenuItem.Name = "assignSeperatorToolStripMenuItem";
341 assignSeperatorToolStripMenuItem.Size = new Size(235, 6);
342 //
343 // snapToolStripMenuItem1
344 //
345 snapToolStripMenuItem1.Name = "snapToolStripMenuItem1";
346 snapToolStripMenuItem1.Size = new Size(238, 22);
347 snapToolStripMenuItem1.Text = "Snap";
348 snapToolStripMenuItem1.Click += new EventHandler(snapToolStripMenuItem1_Click);
349 //
350 // panel2
351 //
352 panel2.Controls.Add(chkBones);
353 panel2.Controls.Add(chkPoly);
354 panel2.Controls.Add(chkAllModels);
355 panel2.Dock = DockStyle.Top;
356 panel2.Location = new Point(0, 0);
357 panel2.Name = "panel2";
358 panel2.Size = new Size(209, 17);
359 panel2.TabIndex = 3;
360 //
361 // chkBones
362 //
363 chkBones.Location = new Point(100, 0);
364 chkBones.Name = "chkBones";
365 chkBones.Padding = new Padding(1, 0, 0, 0);
366 chkBones.Size = new Size(67, 17);
367 chkBones.TabIndex = 4;
368 chkBones.Text = "Bones";
369 chkBones.UseVisualStyleBackColor = true;
370 chkBones.CheckedChanged += new EventHandler(chkBones_CheckedChanged);
371 //
372 // chkPoly
373 //
374 chkPoly.Checked = true;
375 chkPoly.CheckState = CheckState.Checked;
376 chkPoly.Location = new Point(44, 0);
377 chkPoly.Name = "chkPoly";
378 chkPoly.Padding = new Padding(1, 0, 0, 0);
379 chkPoly.Size = new Size(54, 17);
380 chkPoly.TabIndex = 3;
381 chkPoly.Text = "Poly";
382 chkPoly.ThreeState = true;
383 chkPoly.UseVisualStyleBackColor = true;
384 chkPoly.CheckStateChanged += new EventHandler(chkPoly_CheckStateChanged);
385 //
386 // chkAllModels
387 //
388 chkAllModels.Checked = true;
389 chkAllModels.CheckState = CheckState.Checked;
390 chkAllModels.Location = new Point(0, 0);
391 chkAllModels.Name = "chkAllModels";
392 chkAllModels.Padding = new Padding(1, 0, 0, 0);
393 chkAllModels.Size = new Size(41, 17);
394 chkAllModels.TabIndex = 2;
395 chkAllModels.Text = "All";
396 chkAllModels.UseVisualStyleBackColor = true;
397 chkAllModels.CheckedChanged += new EventHandler(chkAllModels_CheckedChanged);
398 //
399 // lstObjects
400 //
401 lstObjects.BorderStyle = BorderStyle.None;
402 lstObjects.ContextMenuStrip = contextMenuStrip1;
403 lstObjects.Dock = DockStyle.Fill;
404 lstObjects.FormattingEnabled = true;
405 lstObjects.IntegralHeight = false;
406 lstObjects.Location = new Point(0, 0);
407 lstObjects.Name = "lstObjects";
408 lstObjects.Size = new Size(209, 82);
409 lstObjects.TabIndex = 1;
410 lstObjects.ItemCheck += new ItemCheckEventHandler(lstObjects_ItemCheck);
411 lstObjects.SelectedValueChanged += new EventHandler(lstObjects_SelectedValueChanged);
412 lstObjects.MouseDown += new MouseEventHandler(lstObjects_MouseDown);
413 //
414 // contextMenuStrip1
415 //
416 contextMenuStrip1.Items.AddRange(new ToolStripItem[]
417 {
426 });
427 contextMenuStrip1.Name = "contextMenuStrip1";
428 contextMenuStrip1.Size = new Size(238, 132);
429 contextMenuStrip1.Opening += new CancelEventHandler(contextMenuStrip1_Opening);
430 //
431 // newObjectToolStripMenuItem
432 //
433 newObjectToolStripMenuItem.Name = "newObjectToolStripMenuItem";
434 newObjectToolStripMenuItem.Size = new Size(237, 22);
435 newObjectToolStripMenuItem.Text = "New Object";
436 newObjectToolStripMenuItem.Click += new EventHandler(newObjectToolStripMenuItem_Click);
437 //
438 // toolStripMenuItem3
439 //
440 toolStripMenuItem3.Name = "toolStripMenuItem3";
441 toolStripMenuItem3.Size = new Size(234, 6);
442 //
443 // unlinkToolStripMenuItem
444 //
445 unlinkToolStripMenuItem.Name = "unlinkToolStripMenuItem";
446 unlinkToolStripMenuItem.Size = new Size(237, 22);
447 unlinkToolStripMenuItem.Text = "Unlink";
448 unlinkToolStripMenuItem.Click += new EventHandler(btnUnlink_Click);
449 //
450 // unlinkNoMoveToolStripMenuItem
451 //
452 unlinkNoMoveToolStripMenuItem.Name = "unlinkNoMoveToolStripMenuItem";
453 unlinkNoMoveToolStripMenuItem.Size = new Size(237, 22);
454 unlinkNoMoveToolStripMenuItem.Text = "Unlink (No relative movement)";
455 unlinkNoMoveToolStripMenuItem.Click += new EventHandler(btnUnlinkNoMove_Click);
456 //
457 // toolStripMenuItem2
458 //
459 toolStripMenuItem2.Name = "toolStripMenuItem2";
460 toolStripMenuItem2.Size = new Size(234, 6);
461 //
462 // snapToolStripMenuItem
463 //
464 snapToolStripMenuItem.Name = "snapToolStripMenuItem";
465 snapToolStripMenuItem.Size = new Size(237, 22);
466 snapToolStripMenuItem.Text = "Snap";
467 snapToolStripMenuItem.Click += new EventHandler(snapToolStripMenuItem_Click);
468 //
469 // toolStripMenuItem1
470 //
471 toolStripMenuItem1.Name = "toolStripMenuItem1";
472 toolStripMenuItem1.Size = new Size(234, 6);
473 //
474 // _deleteToolStripMenuItem
475 //
476 _deleteToolStripMenuItem.Name = "_deleteToolStripMenuItem";
477 _deleteToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Delete;
478 _deleteToolStripMenuItem.Size = new Size(237, 22);
479 _deleteToolStripMenuItem.Text = "Delete";
480 _deleteToolStripMenuItem.Click += new EventHandler(_deleteToolStripMenuItem_Click);
481 //
482 // panel3
483 //
484 panel3.Controls.Add(pnlPlaneProps);
485 panel3.Controls.Add(pnlPointProps);
486 panel3.Controls.Add(pnlObjProps);
487 panel3.Dock = DockStyle.Bottom;
488 panel3.Location = new Point(0, 82);
489 panel3.Name = "panel3";
490 panel3.Size = new Size(209, 115);
491 panel3.TabIndex = 16;
492 //
493 // pnlPlaneProps
494 //
495 pnlPlaneProps.Controls.Add(groupBoxFlags2);
496 pnlPlaneProps.Controls.Add(groupBoxFlags1);
497 pnlPlaneProps.Controls.Add(groupBoxTargets);
498 pnlPlaneProps.Controls.Add(cboMaterial);
499 pnlPlaneProps.Controls.Add(cboType);
500 pnlPlaneProps.Controls.Add(label5);
501 pnlPlaneProps.Controls.Add(labelType);
502 pnlPlaneProps.Dock = DockStyle.Bottom;
503 pnlPlaneProps.Location = new Point(0, -273);
504 pnlPlaneProps.Name = "pnlPlaneProps";
505 pnlPlaneProps.Size = new Size(209, 188);
506 pnlPlaneProps.TabIndex = 0;
507 pnlPlaneProps.Visible = false;
508 //
509 // groupBoxFlags2
510 //
511 groupBoxFlags2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom
512 | AnchorStyles.Left;
513 groupBoxFlags2.Controls.Add(chkFlagSuperSoft);
514 groupBoxFlags2.Controls.Add(chkTypeRotating);
515 groupBoxFlags2.Controls.Add(chkFlagCrush);
516 groupBoxFlags2.Controls.Add(chkFlagBucculus);
517 groupBoxFlags2.Location = new Point(104, 102);
518 groupBoxFlags2.Margin = new Padding(0);
519 groupBoxFlags2.Name = "groupBoxFlags2";
520 groupBoxFlags2.Padding = new Padding(0);
521 groupBoxFlags2.Size = new Size(105, 160);
522 groupBoxFlags2.TabIndex = 14;
523 groupBoxFlags2.TabStop = false;
524 //
525 // chkFlagCrush
526 //
527 chkFlagCrush.Location = new Point(8, 49);
528 chkFlagCrush.Margin = new Padding(0);
529 chkFlagCrush.Name = "chkFlagCrush";
530 chkFlagCrush.Size = new Size(105, 18);
531 chkFlagCrush.TabIndex = 3;
532 chkFlagCrush.Text = "Crush (SSE)";
533 chkFlagCrush.UseVisualStyleBackColor = true;
534 chkFlagCrush.CheckedChanged += new EventHandler(chkFlagCrush_CheckedChanged);
535 //
536 // chkFlagBucculus
537 //
538 chkFlagBucculus.Location = new Point(8, 65);
539 chkFlagBucculus.Margin = new Padding(0);
540 chkFlagBucculus.Name = "chkFlagCrush";
541 chkFlagBucculus.Size = new Size(105, 18);
542 chkFlagBucculus.TabIndex = 3;
543 chkFlagBucculus.Text = "Bucculus (SSE)";
544 chkFlagBucculus.UseVisualStyleBackColor = true;
545 chkFlagBucculus.CheckedChanged += new EventHandler(chkFlagBucculus_CheckedChanged);
546 //
547 // chkFlagSuperSoft
548 //
549 chkFlagSuperSoft.Location = new Point(8, 33);
550 chkFlagSuperSoft.Margin = new Padding(0);
551 chkFlagSuperSoft.Name = "chkFlagSuperSoft";
552 chkFlagSuperSoft.Size = new Size(86, 18);
553 chkFlagSuperSoft.TabIndex = 3;
554 chkFlagSuperSoft.Text = "Super Soft";
555 chkFlagSuperSoft.UseVisualStyleBackColor = true;
556 chkFlagSuperSoft.CheckedChanged += new EventHandler(chkFlagSuperSoft_CheckedChanged);
557 //
558 // groupBoxFlags1
559 //
560 groupBoxFlags1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom
561 | AnchorStyles.Left;
562 groupBoxFlags1.Controls.Add(chkLeftLedge);
563 groupBoxFlags1.Controls.Add(chkNoWalljump);
564 groupBoxFlags1.Controls.Add(chkRightLedge);
565 groupBoxFlags1.Controls.Add(chkFallThrough);
566 groupBoxFlags1.Location = new Point(0, 102);
567 groupBoxFlags1.Margin = new Padding(0);
568 groupBoxFlags1.Name = "groupBoxFlags1";
569 groupBoxFlags1.Padding = new Padding(0);
570 groupBoxFlags1.Size = new Size(104, 160);
571 groupBoxFlags1.TabIndex = 13;
572 groupBoxFlags1.TabStop = false;
573 groupBoxFlags1.Text = "Flags";
574 //
575 // chkLeftLedge
576 //
577 chkLeftLedge.Location = new Point(8, 33);
578 chkLeftLedge.Margin = new Padding(0);
579 chkLeftLedge.Name = "chkLeftLedge";
580 chkLeftLedge.Size = new Size(86, 18);
581 chkLeftLedge.TabIndex = 4;
582 chkLeftLedge.Text = "Left Ledge";
583 chkLeftLedge.UseVisualStyleBackColor = true;
584 chkLeftLedge.CheckedChanged += new EventHandler(chkLeftLedge_CheckedChanged);
585 //
586 // chkNoWalljump
587 //
588 chkNoWalljump.Location = new Point(8, 65);
589 chkNoWalljump.Margin = new Padding(0);
590 chkNoWalljump.Name = "chkNoWalljump";
591 chkNoWalljump.Size = new Size(90, 18);
592 chkNoWalljump.TabIndex = 2;
593 chkNoWalljump.Text = "No Walljump";
594 chkNoWalljump.UseVisualStyleBackColor = true;
595 chkNoWalljump.CheckedChanged += new EventHandler(chkNoWalljump_CheckedChanged);
596 //
597 // chkRightLedge
598 //
599 chkRightLedge.Location = new Point(8, 49);
600 chkRightLedge.Margin = new Padding(0);
601 chkRightLedge.Name = "chkRightLedge";
602 chkRightLedge.Size = new Size(86, 18);
603 chkRightLedge.TabIndex = 1;
604 chkRightLedge.Text = "Right Ledge";
605 chkRightLedge.UseVisualStyleBackColor = true;
606 chkRightLedge.CheckedChanged += new EventHandler(chkRightLedge_CheckedChanged);
607 //
608 // chkTypeRotating
609 //
610 chkTypeRotating.Location = new Point(8, 17);
611 chkTypeRotating.Margin = new Padding(0);
612 chkTypeRotating.Name = "chkTypeRotating";
613 chkTypeRotating.Size = new Size(86, 18);
614 chkTypeRotating.TabIndex = 4;
615 chkTypeRotating.Text = "Rotating";
616 chkTypeRotating.UseVisualStyleBackColor = true;
617 chkTypeRotating.CheckedChanged += new EventHandler(chkTypeRotating_CheckedChanged);
618 //
619 // chkFallThrough
620 //
621 chkFallThrough.Location = new Point(8, 17);
622 chkFallThrough.Margin = new Padding(0);
623 chkFallThrough.Name = "chkFallThrough";
624 chkFallThrough.Size = new Size(90, 18);
625 chkFallThrough.TabIndex = 0;
626 chkFallThrough.Text = "Fall-Through";
627 chkFallThrough.UseVisualStyleBackColor = true;
628 chkFallThrough.CheckedChanged += new EventHandler(chkFallThrough_CheckedChanged);
629 //
630 // groupBoxTargets
631 //
632 groupBoxTargets.Anchor = AnchorStyles.Top | AnchorStyles.Bottom
633 | AnchorStyles.Left;
635 groupBoxTargets.Controls.Add(chkTypeItems);
637 groupBoxTargets.Location = new Point(0, 50);
638 groupBoxTargets.Margin = new Padding(0);
639 groupBoxTargets.Name = "groupBoxTargets";
640 groupBoxTargets.Padding = new Padding(0);
641 groupBoxTargets.Size = new Size(208, 71);
642 groupBoxTargets.TabIndex = 14;
643 groupBoxTargets.TabStop = false;
644 groupBoxTargets.Text = "Collision Targets";
645 //
646 // chkTypePokemonTrainer
647 //
648 chkTypePokemonTrainer.Location = new Point(82, 33);
649 chkTypePokemonTrainer.Margin = new Padding(0);
650 chkTypePokemonTrainer.Name = "chkTypePokemonTrainer";
651 chkTypePokemonTrainer.Size = new Size(116, 18);
652 chkTypePokemonTrainer.TabIndex = 3;
653 chkTypePokemonTrainer.Text = "Pokémon Trainer";
654 chkTypePokemonTrainer.UseVisualStyleBackColor = true;
655 chkTypePokemonTrainer.CheckedChanged += new EventHandler(chkTypePokemonTrainer_CheckedChanged);
656 //
657 // chkTypeItems
658 //
659 chkTypeItems.Location = new Point(8, 33);
660 chkTypeItems.Margin = new Padding(0);
661 chkTypeItems.Name = "chkTypeItems";
662 chkTypeItems.Size = new Size(86, 18);
663 chkTypeItems.TabIndex = 3;
664 chkTypeItems.Text = "Items";
665 chkTypeItems.UseVisualStyleBackColor = true;
666 chkTypeItems.CheckedChanged += new EventHandler(chkTypeItems_CheckedChanged);
667 //
668 // chkTypeCharacters
669 //
670 chkTypeCharacters.Location = new Point(8, 17);
671 chkTypeCharacters.Margin = new Padding(0);
672 chkTypeCharacters.Name = "chkTypeCharacters";
673 chkTypeCharacters.Size = new Size(194, 18);
674 chkTypeCharacters.TabIndex = 4;
675 chkTypeCharacters.Text = "Everything";
676 chkTypeCharacters.UseVisualStyleBackColor = true;
677 chkTypeCharacters.CheckedChanged += new EventHandler(chkTypeCharacters_CheckedChanged);
678 //
679 // cboMaterial
680 //
681 cboMaterial.DropDownStyle = ComboBoxStyle.DropDownList;
682 cboMaterial.FormattingEnabled = true;
683 cboMaterial.Location = new Point(66, 25);
684 cboMaterial.Name = "cboMaterial";
685 cboMaterial.Size = new Size(139, 21);
686 cboMaterial.TabIndex = 12;
687 cboMaterial.SelectedIndexChanged += new EventHandler(cboMaterial_SelectedIndexChanged);
688 cboMaterial.Anchor = AnchorStyles.Top | AnchorStyles.Right
689 | AnchorStyles.Left;
690 //
691 // cboType
692 //
693 cboType.DropDownStyle = ComboBoxStyle.DropDownList;
694 cboType.FormattingEnabled = true;
695 cboType.Location = new Point(66, 4);
696 cboType.Name = "cboType";
697 cboType.Size = new Size(139, 21);
698 cboType.TabIndex = 5;
699 cboType.SelectedIndexChanged += new EventHandler(cboType_SelectedIndexChanged);
700 cboType.Anchor = AnchorStyles.Top | AnchorStyles.Right
701 | AnchorStyles.Left;
702 //
703 // label5
704 //
705 label5.Location = new Point(7, 25);
706 label5.Name = "label5";
707 label5.Size = new Size(53, 21);
708 label5.TabIndex = 8;
709 label5.Text = "Material:";
710 label5.TextAlign = ContentAlignment.MiddleRight;
711 //
712 // labelType
713 //
714 labelType.Location = new Point(7, 4);
715 labelType.Name = "labelType";
716 labelType.Size = new Size(53, 21);
717 labelType.TabIndex = 8;
718 labelType.Text = "Type:";
719 labelType.TextAlign = ContentAlignment.MiddleRight;
720 //
721 // pnlPointProps
722 //
723 pnlPointProps.Controls.Add(label2);
724 pnlPointProps.Controls.Add(numY);
725 pnlPointProps.Controls.Add(label1);
726 pnlPointProps.Controls.Add(numX);
727 pnlPointProps.Dock = DockStyle.Bottom;
728 pnlPointProps.Location = new Point(0, -85);
729 pnlPointProps.Name = "pnlPointProps";
730 pnlPointProps.Size = new Size(209, 70);
731 pnlPointProps.TabIndex = 15;
732 pnlPointProps.Visible = false;
733 //
734 // label2
735 //
736 label2.BorderStyle = BorderStyle.FixedSingle;
737 label2.Location = new Point(18, 32);
738 label2.Name = "label2";
739 label2.Size = new Size(42, 20);
740 label2.TabIndex = 3;
741 label2.Text = "Y";
742 label2.TextAlign = ContentAlignment.MiddleRight;
743 //
744 // numY
745 //
746 numY.BorderStyle = BorderStyle.FixedSingle;
747 numY.Integral = false;
748 numY.Location = new Point(59, 32);
749 numY.MaximumValue = 3.402823E+38F;
750 numY.MinimumValue = -3.402823E+38F;
751 numY.Name = "numY";
752 numY.Size = new Size(100, 20);
753 numY.TabIndex = 2;
754 numY.Text = "0";
755 numY.ValueChanged += new EventHandler(numY_ValueChanged);
756 //
757 // label1
758 //
759 label1.BorderStyle = BorderStyle.FixedSingle;
760 label1.Location = new Point(18, 13);
761 label1.Name = "label1";
762 label1.Size = new Size(42, 20);
763 label1.TabIndex = 1;
764 label1.Text = "X";
765 label1.TextAlign = ContentAlignment.MiddleRight;
766 //
767 // numX
768 //
769 numX.BorderStyle = BorderStyle.FixedSingle;
770 numX.Integral = false;
771 numX.Location = new Point(59, 13);
772 numX.MaximumValue = 3.402823E+38F;
773 numX.MinimumValue = -3.402823E+38F;
774 numX.Name = "numX";
775 numX.Size = new Size(100, 20);
776 numX.TabIndex = 0;
777 numX.Text = "0";
778 numX.ValueChanged += new EventHandler(numX_ValueChanged);
779 //
780 // pnlObjProps
781 //
782 pnlObjProps.Controls.Add(chkObjSSEUnk);
783 pnlObjProps.Controls.Add(chkObjModule);
784 pnlObjProps.Controls.Add(chkObjUnk);
785 pnlObjProps.Controls.Add(btnUnlink);
786 pnlObjProps.Controls.Add(btnRelink);
787 pnlObjProps.Controls.Add(txtBone);
788 pnlObjProps.Controls.Add(label4);
789 pnlObjProps.Controls.Add(txtModel);
790 pnlObjProps.Controls.Add(label3);
791 pnlObjProps.Dock = DockStyle.Bottom;
792 pnlObjProps.Location = new Point(0, -15);
793 pnlObjProps.Name = "pnlObjProps";
794 pnlObjProps.Size = new Size(209, 130);
795 pnlObjProps.TabIndex = 1;
796 pnlObjProps.Visible = false;
797 //
798 // chkObjSSEUnk
799 //
800 chkObjSSEUnk.AutoSize = true;
801 chkObjSSEUnk.Location = new Point(10, 102);
802 chkObjSSEUnk.Name = "chkObjSSEUnk";
803 chkObjSSEUnk.Size = new Size(96, 17);
804 chkObjSSEUnk.TabIndex = 15;
805 chkObjSSEUnk.Text = "SSE Unknown";
806 chkObjSSEUnk.UseVisualStyleBackColor = true;
807 chkObjSSEUnk.CheckedChanged += new EventHandler(chkObjSSEUnk_CheckedChanged);
808 //
809 // chkObjModule
810 //
811 chkObjModule.AutoSize = true;
812 chkObjModule.Location = new Point(10, 79);
813 chkObjModule.Name = "chkObjModule";
814 chkObjModule.Size = new Size(111, 17);
815 chkObjModule.TabIndex = 14;
816 chkObjModule.Text = "Module Controlled";
817 chkObjModule.UseVisualStyleBackColor = true;
818 chkObjModule.CheckedChanged += new EventHandler(chkObjModule_CheckedChanged);
819 //
820 // chkObjUnk
821 //
822 chkObjUnk.AutoSize = true;
823 chkObjUnk.Location = new Point(10, 56);
824 chkObjUnk.Name = "chkObjUnk";
825 chkObjUnk.Size = new Size(72, 17);
826 chkObjUnk.TabIndex = 13;
827 chkObjUnk.Text = "Unknown";
828 chkObjUnk.UseVisualStyleBackColor = true;
829 chkObjUnk.CheckedChanged += new EventHandler(chkObjUnk_CheckedChanged);
830 //
831 // btnUnlink
832 //
833 btnUnlink.Location = new Point(177, 22);
834 btnUnlink.Name = "btnUnlink";
835 btnUnlink.Size = new Size(28, 21);
836 btnUnlink.TabIndex = 12;
837 btnUnlink.Text = "-";
838 btnUnlink.UseVisualStyleBackColor = true;
839 btnUnlink.Click += new EventHandler(btnUnlink_Click);
840 //
841 // btnRelink
842 //
843 btnRelink.Location = new Point(177, 2);
844 btnRelink.Name = "btnRelink";
845 btnRelink.Size = new Size(28, 21);
846 btnRelink.TabIndex = 4;
847 btnRelink.Text = "+";
848 btnRelink.UseVisualStyleBackColor = true;
849 btnRelink.Click += new EventHandler(btnRelink_Click);
850 //
851 // txtBone
852 //
853 txtBone.Location = new Point(49, 23);
854 txtBone.Name = "txtBone";
855 txtBone.ReadOnly = true;
856 txtBone.Size = new Size(126, 20);
857 txtBone.TabIndex = 3;
858 //
859 // label4
860 //
861 label4.Location = new Point(4, 23);
862 label4.Name = "label4";
863 label4.Size = new Size(42, 20);
864 label4.TabIndex = 2;
865 label4.Text = "Bone:";
866 label4.TextAlign = ContentAlignment.MiddleRight;
867 //
868 // txtModel
869 //
870 txtModel.Location = new Point(49, 3);
871 txtModel.Name = "txtModel";
872 txtModel.ReadOnly = true;
873 txtModel.Size = new Size(126, 20);
874 txtModel.TabIndex = 1;
875 //
876 // label3
877 //
878 label3.Location = new Point(4, 3);
879 label3.Name = "label3";
880 label3.Size = new Size(42, 20);
881 label3.TabIndex = 0;
882 label3.Text = "Model:";
883 label3.TextAlign = ContentAlignment.MiddleRight;
884 //
885 // panel4
886 //
887 panel4.Controls.Add(btnPlayAnims);
888 panel4.Controls.Add(btnPrevFrame);
889 panel4.Controls.Add(btnNextFrame);
890 panel4.Dock = DockStyle.Bottom;
891 panel4.Enabled = false;
892 panel4.Location = new Point(0, 197);
893 panel4.Name = "panel4";
894 panel4.Size = new Size(209, 24);
895 panel4.TabIndex = 17;
896 panel4.Visible = false;
897 //
898 // btnPlayAnims
899 //
900 btnPlayAnims.Dock = DockStyle.Fill;
901 btnPlayAnims.Location = new Point(35, 0);
902 btnPlayAnims.Name = "btnPlayAnims";
903 btnPlayAnims.Size = new Size(139, 24);
904 btnPlayAnims.TabIndex = 16;
905 btnPlayAnims.Text = "Play Animations";
906 btnPlayAnims.UseVisualStyleBackColor = true;
907 btnPlayAnims.Click += new EventHandler(btnPlayAnims_Click);
908 //
909 // btnPrevFrame
910 //
911 btnPrevFrame.Dock = DockStyle.Left;
912 btnPrevFrame.Location = new Point(0, 0);
913 btnPrevFrame.Name = "btnPrevFrame";
914 btnPrevFrame.Size = new Size(35, 24);
915 btnPrevFrame.TabIndex = 18;
916 btnPrevFrame.Text = "<";
917 btnPrevFrame.UseVisualStyleBackColor = true;
918 btnPrevFrame.Click += new EventHandler(btnPrevFrame_Click);
919 //
920 // btnNextFrame
921 //
922 btnNextFrame.Dock = DockStyle.Right;
923 btnNextFrame.Location = new Point(174, 0);
924 btnNextFrame.Name = "btnNextFrame";
925 btnNextFrame.Size = new Size(35, 24);
926 btnNextFrame.TabIndex = 17;
927 btnNextFrame.Text = ">";
928 btnNextFrame.UseVisualStyleBackColor = true;
929 btnNextFrame.Click += new EventHandler(btnNextFrame_Click);
930 //
931 // _modelPanel
932 //
933 _modelPanel.Dock = DockStyle.Fill;
934 _modelPanel.Location = new Point(0, 25);
935 _modelPanel.Name = "_modelPanel";
936 _modelPanel.Size = new Size(481, 442);
937 _modelPanel.TabIndex = 0;
938 _modelPanel.PreRender += new GLRenderEventHandler(_modelPanel_PreRender);
939 _modelPanel.PostRender += new GLRenderEventHandler(_modelPanel_PostRender);
940 _modelPanel.KeyDown += new KeyEventHandler(_modelPanel_KeyDown);
941 _modelPanel.MouseDown += new MouseEventHandler(_modelPanel_MouseDown);
942 _modelPanel.MouseMove += new MouseEventHandler(_modelPanel_MouseMove);
943 _modelPanel.MouseUp += new MouseEventHandler(_modelPanel_MouseUp);
944 //
945 // panel1
946 //
947 panel1.BackColor = Color.WhiteSmoke;
948 panel1.Controls.Add(toolStrip1);
949 panel1.Controls.Add(btnResetRot);
950 panel1.Controls.Add(trackBar1);
951 panel1.Dock = DockStyle.Top;
952 panel1.Location = new Point(0, 0);
953 panel1.Name = "panel1";
954 panel1.Size = new Size(481, 25);
955 panel1.TabIndex = 2;
956 //
957 // toolStrip1
958 //
959 toolStrip1.BackColor = Color.WhiteSmoke;
960 toolStrip1.Dock = DockStyle.Fill;
961 toolStrip1.GripStyle = ToolStripGripStyle.Hidden;
962 toolStrip1.Items.AddRange(new ToolStripItem[]
963 {
964 btnUndo,
965 btnRedo,
968 btnSplit,
969 btnMerge,
971 btnDelete,
973 btnSameX,
974 btnSameY,
980 btnSpawns,
981 btnItems,
985 btnHelp
986 });
987 toolStrip1.Location = new Point(0, 0);
988 toolStrip1.Name = "toolStrip1";
989 toolStrip1.Size = new Size(335, 25);
990 toolStrip1.TabIndex = 1;
991 toolStrip1.Text = "toolStrip1";
992 //
993 // btnUndo
994 //
995 btnUndo.DisplayStyle = ToolStripItemDisplayStyle.Text;
996 btnUndo.Enabled = false;
997 btnUndo.ImageTransparentColor = Color.Magenta;
998 btnUndo.Name = "btnUndo";
999 btnUndo.Size = new Size(40, 22);
1000 btnUndo.Text = "Undo";
1001 btnUndo.Click += new EventHandler(Undo);
1002 //
1003 // btnRedo
1004 //
1005 btnRedo.DisplayStyle = ToolStripItemDisplayStyle.Text;
1006 btnRedo.Enabled = false;
1007 btnRedo.ImageTransparentColor = Color.Magenta;
1008 btnRedo.Name = "btnRedo";
1009 btnRedo.Size = new Size(38, 22);
1010 btnRedo.Text = "Redo";
1011 btnRedo.Click += new EventHandler(Redo);
1012 //
1013 // toolStripSeparator3
1014 //
1015 toolStripSeparator3.Name = "toolStripSeparator3";
1016 toolStripSeparator3.Size = new Size(6, 25);
1017 //
1018 // btnTransform
1019 //
1020 btnTransform.DisplayStyle = ToolStripItemDisplayStyle.Text;
1021 btnTransform.Enabled = false;
1022 btnTransform.ImageTransparentColor = Color.Magenta;
1023 btnTransform.Name = "btnTransform";
1024 btnTransform.Size = new Size(34, 22);
1025 btnTransform.Text = "Transform";
1026 btnTransform.Click += new EventHandler(transformToolStripMenuItem_Click);
1027 //
1028 // btnSplit
1029 //
1030 btnSplit.DisplayStyle = ToolStripItemDisplayStyle.Text;
1031 btnSplit.Enabled = false;
1032 btnSplit.ImageTransparentColor = Color.Magenta;
1033 btnSplit.Name = "btnSplit";
1034 btnSplit.Size = new Size(34, 22);
1035 btnSplit.Text = "Split";
1036 btnSplit.Click += new EventHandler(btnSplit_Click);
1037 //
1038 // btnMerge
1039 //
1040 btnMerge.DisplayStyle = ToolStripItemDisplayStyle.Text;
1041 btnMerge.Enabled = false;
1042 btnMerge.ImageTransparentColor = Color.Magenta;
1043 btnMerge.Name = "btnMerge";
1044 btnMerge.Size = new Size(45, 22);
1045 btnMerge.Text = "Merge";
1046 btnMerge.Click += new EventHandler(btnMerge_Click);
1047 //
1048 // btnFlipColl
1049 //
1050 btnFlipColl.DisplayStyle = ToolStripItemDisplayStyle.Text;
1051 btnFlipColl.Enabled = false;
1052 btnFlipColl.ImageTransparentColor = Color.Magenta;
1053 btnFlipColl.Name = "btnFlipColl";
1054 btnFlipColl.Size = new Size(30, 22);
1055 btnFlipColl.Text = "Flip";
1056 btnFlipColl.Click += new EventHandler(btnFlipColl_Click);
1057 //
1058 // btnDelete
1059 //
1060 btnDelete.DisplayStyle = ToolStripItemDisplayStyle.Text;
1061 btnDelete.Enabled = false;
1062 btnDelete.ImageTransparentColor = Color.Magenta;
1063 btnDelete.Name = "btnDelete";
1064 btnDelete.Size = new Size(44, 22);
1065 btnDelete.Text = "Delete";
1066 btnDelete.Click += new EventHandler(btnDelete_Click);
1067 //
1068 // toolStripSeparator2
1069 //
1070 toolStripSeparator2.Name = "toolStripSeparator2";
1071 toolStripSeparator2.Size = new Size(6, 25);
1072 //
1073 // btnSameX
1074 //
1075 btnSameX.DisplayStyle = ToolStripItemDisplayStyle.Text;
1076 btnSameX.ImageTransparentColor = Color.Magenta;
1077 btnSameX.Name = "btnSameX";
1078 btnSameX.Size = new Size(49, 22);
1079 btnSameX.Text = "Align X";
1080 btnSameX.Click += new EventHandler(btnSameX_Click);
1081 //
1082 // btnSameY
1083 //
1084 btnSameY.DisplayStyle = ToolStripItemDisplayStyle.Text;
1085 btnSameY.ImageTransparentColor = Color.Magenta;
1086 btnSameY.Name = "btnSameY";
1087 btnSameY.Size = new Size(49, 19);
1088 btnSameY.Text = "Align Y";
1089 btnSameY.Click += new EventHandler(btnSameY_Click);
1090 //
1091 // toolStripSeparator1
1092 //
1093 toolStripSeparator1.Name = "toolStripSeparator1";
1094 toolStripSeparator1.Size = new Size(6, 25);
1095 //
1096 // btnPerspectiveCam
1097 //
1098 btnPerspectiveCam.Checked = true;
1099 btnPerspectiveCam.CheckState = CheckState.Checked;
1100 btnPerspectiveCam.DisplayStyle = ToolStripItemDisplayStyle.Text;
1101 btnPerspectiveCam.ImageTransparentColor = Color.Magenta;
1102 btnPerspectiveCam.Name = "btnPerspectiveCam";
1103 btnPerspectiveCam.Size = new Size(71, 19);
1104 btnPerspectiveCam.Text = "Perspective";
1105 btnPerspectiveCam.Click += new EventHandler(btnPerspectiveCam_Click);
1106 //
1107 // btnOrthographicCam
1108 //
1109 btnOrthographicCam.DisplayStyle = ToolStripItemDisplayStyle.Text;
1110 btnOrthographicCam.ImageTransparentColor = Color.Magenta;
1111 btnOrthographicCam.Name = "btnOrthographicCam";
1112 btnOrthographicCam.Size = new Size(82, 19);
1113 btnOrthographicCam.Text = "Orthographic";
1114 btnOrthographicCam.Click += new EventHandler(btnOrthographicCam_Click);
1115 //
1116 // btnResetCam
1117 //
1118 btnResetCam.DisplayStyle = ToolStripItemDisplayStyle.Text;
1119 btnResetCam.ImageTransparentColor = Color.Magenta;
1120 btnResetCam.Name = "btnResetCam";
1121 btnResetCam.Size = new Size(67, 19);
1122 btnResetCam.Text = "Reset Cam";
1123 btnResetCam.Click += new EventHandler(btnResetCam_Click);
1124 //
1125 // toolStripSeparatorCamera
1126 //
1127 toolStripSeparatorCamera.Name = "toolStripSeparatorCamera";
1128 toolStripSeparatorCamera.Size = new Size(6, 25);
1129 //
1130 // btnSpawns
1131 //
1132 btnSpawns.DisplayStyle = ToolStripItemDisplayStyle.Text;
1133 btnSpawns.ImageTransparentColor = Color.Magenta;
1134 btnSpawns.Name = "btnSpawns";
1135 btnSpawns.Size = new Size(51, 19);
1136 btnSpawns.Text = "Spawns";
1137 btnSpawns.Click += new EventHandler(btnSpawns_Click);
1138 //
1139 // btnItems
1140 //
1141 btnItems.DisplayStyle = ToolStripItemDisplayStyle.Text;
1142 btnItems.ImageTransparentColor = Color.Magenta;
1143 btnItems.Name = "btnItems";
1144 btnItems.Size = new Size(40, 19);
1145 btnItems.Text = "Items";
1146 btnItems.Click += new EventHandler(btnItems_Click);
1147 //
1148 // btnBoundaries
1149 //
1150 btnBoundaries.Checked = true;
1151 btnBoundaries.CheckState = CheckState.Checked;
1152 btnBoundaries.DisplayStyle = ToolStripItemDisplayStyle.Text;
1153 btnBoundaries.ImageTransparentColor = Color.Magenta;
1154 btnBoundaries.Name = "btnBoundaries";
1155 btnBoundaries.Size = new Size(70, 19);
1156 btnBoundaries.Text = "Boundaries";
1157 btnBoundaries.Click += new EventHandler(btnBoundaries_Click);
1158 //
1159 // toolStripSeparatorOverlays
1160 //
1161 toolStripSeparatorOverlays.Name = "toolStripSeparatorOverlays";
1162 toolStripSeparatorOverlays.Size = new Size(6, 6);
1163 //
1164 // btnResetSnap
1165 //
1166 btnResetSnap.DisplayStyle = ToolStripItemDisplayStyle.Text;
1167 btnResetSnap.ImageTransparentColor = Color.Magenta;
1168 btnResetSnap.Name = "btnResetSnap";
1169 btnResetSnap.Size = new Size(57, 19);
1170 btnResetSnap.Text = "Un-Snap";
1171 btnResetSnap.Click += new EventHandler(btnResetSnap_Click);
1172 //
1173 // btnHelp
1174 //
1175 btnHelp.DisplayStyle = ToolStripItemDisplayStyle.Text;
1176 btnHelp.Image = (Image) resources.GetObject("btnHelp.Image");
1177 btnHelp.ImageTransparentColor = Color.Magenta;
1178 btnHelp.Name = "btnHelp";
1179 btnHelp.Size = new Size(36, 19);
1180 btnHelp.Text = "Help";
1181 btnHelp.Click += new EventHandler(btnHelp_Click);
1182 //
1183 // btnResetRot
1184 //
1185 btnResetRot.Dock = DockStyle.Right;
1186 btnResetRot.Enabled = false;
1187 btnResetRot.FlatAppearance.BorderSize = 0;
1188 btnResetRot.FlatStyle = FlatStyle.Flat;
1189 btnResetRot.Location = new Point(335, 0);
1190 btnResetRot.Name = "btnResetRot";
1191 btnResetRot.Size = new Size(16, 25);
1192 btnResetRot.TabIndex = 4;
1193 btnResetRot.Text = "*";
1194 btnResetRot.UseVisualStyleBackColor = true;
1195 btnResetRot.Visible = false;
1196 btnResetRot.Click += new EventHandler(btnResetRot_Click);
1197 //
1198 // trackBar1
1199 //
1200 trackBar1.Dock = DockStyle.Right;
1201 trackBar1.Enabled = false;
1202 trackBar1.Location = new Point(351, 0);
1203 trackBar1.Maximum = 180;
1204 trackBar1.Minimum = -180;
1205 trackBar1.Name = "trackBar1";
1206 trackBar1.Size = new Size(130, 25);
1207 trackBar1.TabIndex = 3;
1208 trackBar1.TickStyle = TickStyle.None;
1209 trackBar1.Visible = false;
1210 trackBar1.Scroll += new EventHandler(trackBar1_Scroll);
1211 //
1212 // contextMenuStrip3
1213 //
1214 contextMenuStrip3.Items.AddRange(new ToolStripItem[]
1215 {
1216 moveToNewObjectToolStripMenuItem,
1217 transformToolStripMenuItem,
1218 alignXToolStripMenuItem,
1219 alignYToolStripMenuItem,
1220 toolStripSeparator4,
1221 splitToolStripMenuItem,
1222 mergeToolStripMenuItem,
1223 flipToolStripMenuItem,
1224 _deleteToolStripMenuItem1
1225 });
1226 contextMenuStrip3.Name = "contextMenuStrip3";
1227 contextMenuStrip3.Size = new Size(184, 208);
1228 contextMenuStrip3.Opening += new CancelEventHandler(contextMenuStrip3_Opening);
1229 //
1230 // moveToNewObjectToolStripMenuItem
1231 //
1232 moveToNewObjectToolStripMenuItem.Name = "moveToNewObjectToolStripMenuItem";
1233 moveToNewObjectToolStripMenuItem.Size = new Size(183, 22);
1234 moveToNewObjectToolStripMenuItem.Text = "Move to New Object";
1235 //
1236 // toolStripSeparator4
1237 //
1238 toolStripSeparator4.Name = "toolStripSeparator4";
1239 toolStripSeparator4.Size = new Size(180, 6);
1240 //
1241 // splitToolStripMenuItem
1242 //
1243 splitToolStripMenuItem.Name = "splitToolStripMenuItem";
1244 splitToolStripMenuItem.Size = new Size(183, 22);
1245 splitToolStripMenuItem.Text = "Split";
1246 splitToolStripMenuItem.Click += new EventHandler(btnSplit_Click);
1247 //
1248 // mergeToolStripMenuItem
1249 //
1250 mergeToolStripMenuItem.Name = "mergeToolStripMenuItem";
1251 mergeToolStripMenuItem.Size = new Size(183, 22);
1252 mergeToolStripMenuItem.Text = "Merge";
1253 mergeToolStripMenuItem.Click += new EventHandler(btnMerge_Click);
1254 //
1255 // flipToolStripMenuItem
1256 //
1257 flipToolStripMenuItem.Name = "flipToolStripMenuItem";
1258 flipToolStripMenuItem.Size = new Size(183, 22);
1259 flipToolStripMenuItem.Text = "Flip";
1260 flipToolStripMenuItem.Click += new EventHandler(btnFlipColl_Click);
1261 //
1262 // _deleteToolStripMenuItem1
1263 //
1264 _deleteToolStripMenuItem1.Name = "_deleteToolStripMenuItem1";
1265 _deleteToolStripMenuItem1.Size = new Size(183, 22);
1266 _deleteToolStripMenuItem1.Text = "Delete";
1267 _deleteToolStripMenuItem1.Click += new EventHandler(btnDelete_Click);
1268 //
1269 // transformToolStripMenuItem
1270 //
1271 transformToolStripMenuItem.Name = "transformToolStripMenuItem";
1272 transformToolStripMenuItem.Size = new Size(183, 22);
1273 transformToolStripMenuItem.Text = "Transform";
1274 alignXToolStripMenuItem.Click += new EventHandler(transformToolStripMenuItem_Click);
1275 //
1276 // alignXToolStripMenuItem
1277 //
1278 alignXToolStripMenuItem.Name = "alignXToolStripMenuItem";
1279 alignXToolStripMenuItem.Size = new Size(183, 22);
1280 alignXToolStripMenuItem.Text = "Align X";
1281 alignXToolStripMenuItem.Click += new EventHandler(btnSameX_Click);
1282 //
1283 // alignYToolStripMenuItem
1284 //
1285 alignYToolStripMenuItem.Name = "alignYToolStripMenuItem";
1286 alignYToolStripMenuItem.Size = new Size(183, 22);
1287 alignYToolStripMenuItem.Text = "Align Y";
1288 alignYToolStripMenuItem.Click += new EventHandler(btnSameY_Click);
1289 //
1290 // CollisionEditor
1291 //
1292 BackColor = Color.Lavender;
1293 Controls.Add(undoToolStrip);
1294 Name = "CollisionEditor";
1295 Size = new Size(694, 467);
1296 undoToolStrip.Panel1.ResumeLayout(false);
1297 undoToolStrip.Panel2.ResumeLayout(false);
1298 ((ISupportInitialize) undoToolStrip).EndInit();
1299 undoToolStrip.ResumeLayout(false);
1300 redoToolStrip.Panel1.ResumeLayout(false);
1301 redoToolStrip.Panel2.ResumeLayout(false);
1302 ((ISupportInitialize) redoToolStrip).EndInit();
1303 redoToolStrip.ResumeLayout(false);
1304 contextMenuStrip2.ResumeLayout(false);
1305 panel2.ResumeLayout(false);
1306 contextMenuStrip1.ResumeLayout(false);
1307 panel3.ResumeLayout(false);
1308 pnlPlaneProps.ResumeLayout(false);
1309 groupBoxFlags2.ResumeLayout(false);
1310 groupBoxFlags1.ResumeLayout(false);
1311 groupBoxTargets.ResumeLayout(false);
1312 pnlPointProps.ResumeLayout(false);
1313 pnlPointProps.PerformLayout();
1314 pnlObjProps.ResumeLayout(false);
1315 pnlObjProps.PerformLayout();
1316 panel4.ResumeLayout(false);
1317 panel1.ResumeLayout(false);
1318 panel1.PerformLayout();
1319 toolStrip1.ResumeLayout(false);
1320 toolStrip1.PerformLayout();
1321 ((ISupportInitialize) trackBar1).EndInit();
1322 contextMenuStrip3.ResumeLayout(false);
1323 ResumeLayout(false);
1324 }
Label label1
Definition: CollisionEditor.cs:66
void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
Definition: CollisionEditor.cs:4024
void chkFlagSuperSoft_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3703
ToolStripSeparator toolStripMenuItem3
Definition: CollisionEditor.cs:72
Panel panel1
Definition: CollisionEditor.cs:44
void cboType_SelectedIndexChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:2917
void contextMenuStrip3_Opening(object sender, CancelEventArgs e)
Definition: CollisionEditor.cs:4042
void numY_ValueChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3750
Panel pnlPlaneProps
Definition: CollisionEditor.cs:30
void _modelPanel_KeyDown(object sender, KeyEventArgs e)
Definition: CollisionEditor.cs:2698
Button btnPrevFrame
Definition: CollisionEditor.cs:105
void modelTree_AfterSelect(object sender, TreeViewEventArgs e)
Definition: CollisionEditor.cs:3895
void btnResetRot_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2620
void lstObjects_SelectedValueChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:1582
void chkTypeCharacters_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:2954
NumericInputBox numX
Definition: CollisionEditor.cs:63
ToolStripSeparator toolStripSeparatorCamera
Definition: CollisionEditor.cs:111
ToolStripSeparator toolStripMenuItem1
Definition: CollisionEditor.cs:74
Label label3
Definition: CollisionEditor.cs:77
void chkFlagCrush_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3675
ToolStripMenuItem unlinkNoMoveToolStripMenuItem
Definition: CollisionEditor.cs:92
void btnPlayAnims_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:4228
void btnRelink_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3916
void btnSpawns_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2665
void btnItems_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2676
TrackBar trackBar1
Definition: CollisionEditor.cs:45
void chkFallThrough_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3147
ToolStripButton btnFlipColl
Definition: CollisionEditor.cs:113
void btnBoundaries_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2687
Button btnNextFrame
Definition: CollisionEditor.cs:106
ToolStripButton btnTransform
Definition: CollisionEditor.cs:36
Button btnResetRot
Definition: CollisionEditor.cs:46
void chkAllModels_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:1794
Panel pnlObjProps
Definition: CollisionEditor.cs:34
TextBox txtModel
Definition: CollisionEditor.cs:76
void contextMenuStrip2_Opening(object sender, CancelEventArgs e)
Definition: CollisionEditor.cs:4016
void chkTypeItems_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:2998
ToolStripMenuItem _deleteToolStripMenuItem
Definition: CollisionEditor.cs:75
void btnNextFrame_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:4236
void snapToolStripMenuItem1_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:4052
ToolStripMenuItem unlinkToolStripMenuItem
Definition: CollisionEditor.cs:91
ToolStripButton btnOrthographicCam
Definition: CollisionEditor.cs:114
void _modelPanel_PreRender(object sender)
Definition: CollisionEditor.cs:2355
ToolStripSeparator assignSeperatorToolStripMenuItem
Definition: CollisionEditor.cs:73
void lstObjects_ItemCheck(object sender, ItemCheckEventArgs e)
Definition: CollisionEditor.cs:1698
Panel panel4
Definition: CollisionEditor.cs:103
void chkObjModule_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:4206
SplitContainer undoToolStrip
Definition: CollisionEditor.cs:27
ToolStripButton btnSplit
Definition: CollisionEditor.cs:37
ToolStripButton btnSameY
Definition: CollisionEditor.cs:69
Button btnPlayAnims
Definition: CollisionEditor.cs:102
void _modelPanel_PostRender(object sender)
Definition: CollisionEditor.cs:2359
void chkLeftLedge_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3216
void btnDelete_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3990
ToolStripSeparator toolStripMenuItem2
Definition: CollisionEditor.cs:71
Button btnUnlink
Definition: CollisionEditor.cs:87
ToolStripMenuItem assignNoMoveToolStripMenuItem
Definition: CollisionEditor.cs:90
CheckBox chkPoly
Definition: CollisionEditor.cs:79
ToolStripMenuItem newObjectToolStripMenuItem
Definition: CollisionEditor.cs:70
CollisionEditor()
Definition: CollisionEditor.cs:1360
ContextMenuStrip contextMenuStrip2
Definition: CollisionEditor.cs:88
GroupBox groupBoxTargets
Definition: CollisionEditor.cs:60
void btnSameX_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3829
void _modelPanel_MouseUp(object sender, MouseEventArgs e)
Definition: CollisionEditor.cs:2264
ToolStripSeparator toolStripSeparator1
Definition: CollisionEditor.cs:67
void btnPrevFrame_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:4232
void btnPerspectiveCam_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2632
Label label5
Definition: CollisionEditor.cs:31
void chkBones_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3863
void modelTree_AfterCheck(object sender, TreeViewEventArgs e)
Definition: CollisionEditor.cs:3868
Button btnRelink
Definition: CollisionEditor.cs:80
void _modelPanel_MouseDown(object sender, MouseEventArgs e)
Definition: CollisionEditor.cs:1941
SplitContainer redoToolStrip
Definition: CollisionEditor.cs:28
NumericInputBox numY
Definition: CollisionEditor.cs:65
void btnResetCam_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2626
void btnUnlink_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3954
void btnSplit_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2571
GroupBox groupBoxFlags1
Definition: CollisionEditor.cs:48
ToolStripMenuItem assignToolStripMenuItem
Definition: CollisionEditor.cs:89
ToolStripMenuItem snapToolStripMenuItem
Definition: CollisionEditor.cs:43
ToolStripButton btnDelete
Definition: CollisionEditor.cs:39
ToolStripMenuItem snapToolStripMenuItem1
Definition: CollisionEditor.cs:93
ToolStripButton btnHelp
Definition: CollisionEditor.cs:107
void newObjectToolStripMenuItem_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:1624
void cboMaterial_SelectedIndexChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:2899
Panel panel3
Definition: CollisionEditor.cs:104
void btnUnlinkNoMove_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3968
void snapToolStripMenuItem_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:1588
void _modelPanel_MouseMove(object sender, MouseEventArgs e)
Definition: CollisionEditor.cs:2298
void btnSameY_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3842
void transformToolStripMenuItem_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3781
ContextMenuStrip contextMenuStrip3
Definition: CollisionEditor.cs:41
void chkFlagBucculus_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3689
void numX_ValueChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3721
Panel panel2
Definition: CollisionEditor.cs:78
ToolStripButton btnPerspectiveCam
Definition: CollisionEditor.cs:112
void chkObjUnk_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:4191
ToolStripButton btnResetSnap
Definition: CollisionEditor.cs:95
void lstObjects_MouseDown(object sender, MouseEventArgs e)
Definition: CollisionEditor.cs:1576
void btnHelp_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:4240
Panel pnlPointProps
Definition: CollisionEditor.cs:62
ToolStripSeparator toolStripSeparator2
Definition: CollisionEditor.cs:94
void trackBar1_Scroll(object sender, EventArgs e)
Definition: CollisionEditor.cs:2615
ToolStripSeparator toolStripSeparator3
Definition: CollisionEditor.cs:98
ToolStrip toolStrip1
Definition: CollisionEditor.cs:35
void _deleteToolStripMenuItem_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:1593
ToolStripSeparator toolStripSeparatorOverlays
Definition: CollisionEditor.cs:127
ToolStripButton btnResetCam
Definition: CollisionEditor.cs:47
void chkRightLedge_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3350
void chkTypeRotating_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3074
ToolStripButton btnMerge
Definition: CollisionEditor.cs:38
void chkNoWalljump_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3488
Label label2
Definition: CollisionEditor.cs:64
void btnFlipColl_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:4070
ToolStripButton btnSameX
Definition: CollisionEditor.cs:68
void btnMerge_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2585
void btnRelinkNoMove_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:3931
Label label4
Definition: CollisionEditor.cs:82
void btnOrthographicCam_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:2649
void btnResetSnap_Click(object sender, EventArgs e)
Definition: CollisionEditor.cs:4064
Label labelType
Definition: CollisionEditor.cs:32
void chkPoly_CheckStateChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3855
TextBox txtBone
Definition: CollisionEditor.cs:81
void modelTree_BeforeSelect(object sender, TreeViewCancelEventArgs e)
Definition: CollisionEditor.cs:3906
GroupBox groupBoxFlags2
Definition: CollisionEditor.cs:50
void chkTypePokemonTrainer_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:3036
void chkObjSSEUnk_CheckedChanged(object sender, EventArgs e)
Definition: CollisionEditor.cs:4217
delegate void GLRenderEventHandler(ModelPanelViewport sender)

◆ lstObjects_ItemCheck()

void BrawlCrate.UI.CollisionEditor.lstObjects_ItemCheck ( object  sender,
ItemCheckEventArgs  e 
)
inlineprotected
1699 {
1700 CollisionObject obj = lstObjects.Items[e.Index] as CollisionObject;
1701 obj._render = e.NewValue == CheckState.Checked;
1702
1704
1705 if (!_updating)
1706 {
1707 _modelPanel.Invalidate();
1708 }
1709 }

◆ lstObjects_MouseDown()

void BrawlCrate.UI.CollisionEditor.lstObjects_MouseDown ( object  sender,
MouseEventArgs  e 
)
inlineprotected
1577 {
1578 int index = lstObjects.IndexFromPoint(e.Location);
1579 lstObjects.SelectedIndex = index;
1580 }

◆ lstObjects_SelectedValueChanged()

void BrawlCrate.UI.CollisionEditor.lstObjects_SelectedValueChanged ( object  sender,
EventArgs  e 
)
inlineprotected
1583 {
1584 _selectedObject = lstObjects.SelectedItem as CollisionObject;
1586 }

◆ modelTree_AfterCheck()

void BrawlCrate.UI.CollisionEditor.modelTree_AfterCheck ( object  sender,
TreeViewEventArgs  e 
)
inlineprotected
3869 {
3870 if (e.Node.Tag is MDL0Node node)
3871 {
3872 node.IsRendering = e.Node.Checked;
3873 if (!_updating)
3874 {
3875 _updating = true;
3876 foreach (TreeNode n in e.Node.Nodes)
3877 {
3878 n.Checked = e.Node.Checked;
3879 }
3880
3881 _updating = false;
3882 }
3883 }
3884 else if (e.Node.Tag is MDL0BoneNode boneNode)
3885 {
3886 boneNode._render = e.Node.Checked;
3887 }
3888
3889 if (!_updating)
3890 {
3891 _modelPanel.Invalidate();
3892 }
3893 }

◆ modelTree_AfterSelect()

void BrawlCrate.UI.CollisionEditor.modelTree_AfterSelect ( object  sender,
TreeViewEventArgs  e 
)
inlineprotected
3896 {
3897 if (e.Node?.Tag is MDL0BoneNode)
3898 {
3899 MDL0BoneNode bone = e.Node.Tag as MDL0BoneNode;
3900 bone._boneColor = Color.FromArgb(255, 0, 0);
3901 bone._nodeColor = Color.FromArgb(255, 128, 0);
3902 _modelPanel.Invalidate();
3903 }
3904 }

◆ modelTree_BeforeSelect()

void BrawlCrate.UI.CollisionEditor.modelTree_BeforeSelect ( object  sender,
TreeViewCancelEventArgs  e 
)
inlineprotected
3907 {
3908 TreeNode node = modelTree.SelectedNode;
3909 if (node?.Tag is MDL0BoneNode bone)
3910 {
3911 bone._nodeColor = bone._boneColor = Color.Transparent;
3912 _modelPanel.Invalidate();
3913 }
3914 }

◆ newObjectToolStripMenuItem_Click()

void BrawlCrate.UI.CollisionEditor.newObjectToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
inlineprotected
1625 {
1626 _selectedObject = new CollisionObject {Name = $"Collision Object [{_targetNode.Children.Count + 1}]", Independent = true};
1628 lstObjects.Items.Add(_selectedObject, true);
1629 lstObjects.SelectedItem = _selectedObject;
1631 }
virtual void AddChild(ResourceNode child)
Definition: ResourceNode.cs:757

◆ numX_ValueChanged()

void BrawlCrate.UI.CollisionEditor.numX_ValueChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3722 {
3723 if (_updating)
3724 {
3725 return;
3726 }
3727
3728 if (numX.Text == "" && ErrorChecking)
3729 {
3730 return;
3731 }
3732
3733 foreach (CollisionLink link in _selectedLinks)
3734 {
3735 if (link._parent?.LinkedBone == null)
3736 {
3737 link._rawValue._x = numX.Value;
3738 }
3739 else
3740 {
3741 Vector2 oldValue = link.Value;
3742 link.Value = new Vector2(numX.Value, oldValue._y);
3743 }
3744 }
3745
3746 _modelPanel.Invalidate();
3748 }
float Value
Definition: NumericInputBox.cs:15
MDL0BoneNode LinkedBone
Definition: CollisionNode.cs:305
float _y
Definition: Vector2.cs:17

◆ numY_ValueChanged()

void BrawlCrate.UI.CollisionEditor.numY_ValueChanged ( object  sender,
EventArgs  e 
)
inlineprotected
3751 {
3752 if (_updating)
3753 {
3754 return;
3755 }
3756
3757 if (numY.Text == "" && ErrorChecking)
3758 {
3759 return;
3760 }
3761
3762 foreach (CollisionLink link in _selectedLinks)
3763 {
3764 if (link._parent?.LinkedBone == null)
3765 {
3766 link._rawValue._y = numY.Value;
3767 }
3768 else
3769 {
3770 Vector2 oldValue = link.Value;
3771 link.Value = new Vector2(oldValue._x, numY.Value);
3772 }
3773 }
3774
3775 _modelPanel.Invalidate();
3777 }
float _x
Definition: Vector2.cs:11

◆ ObjectSelected()

void BrawlCrate.UI.CollisionEditor.ObjectSelected ( )
inlineprotected
1634 {
1635 pnlPlaneProps.Visible = false;
1636 pnlPointProps.Visible = false;
1637 pnlObjProps.Visible = false;
1638 panel3.Height = 0;
1639 if (_selectedObject != null)
1640 {
1641 pnlObjProps.Visible = true;
1642 panel3.Height = 130;
1644 }
1645 }

◆ PointCollides() [1/2]

bool BrawlCrate.UI.CollisionEditor.PointCollides ( Vector3  point)
inlineprotected
2318 {
2319 return PointCollides(point, out float f);
2320 }

◆ PointCollides() [2/2]

bool BrawlCrate.UI.CollisionEditor.PointCollides ( Vector3  point,
out float  y_result 
)
inlineprotected
2323 {
2324 y_result = float.MaxValue;
2325 Vector2 v2 = new Vector2(point._x, point._y);
2326 foreach (CollisionObject obj in _targetNode.Children)
2327 {
2328 if (obj._render || true)
2329 {
2330 foreach (CollisionPlane plane in obj._planes)
2331 {
2332 if (plane._type == CollisionPlaneType.Floor && plane.IsCharacters)
2333 {
2334 if (plane.PointLeft._x <= v2._x && plane.PointRight._x >= v2._x)
2335 {
2336 float x = v2._x;
2337 float m = (plane.PointLeft._y - plane.PointRight._y)
2338 / (plane.PointLeft._x - plane.PointRight._x);
2339 float b = plane.PointRight._y - m * plane.PointRight._x;
2340 float y_target = m * x + b;
2341 //Console.WriteLine(y_target);
2342 if (Math.Abs(y_target - v2._y) <= Math.Abs(y_result - v2._y))
2343 {
2344 y_result = y_target;
2345 }
2346 }
2347 }
2348 }
2349 }
2350 }
2351
2352 return Math.Abs(y_result - v2._y) <= 5;
2353 }
CollisionPlaneType _type
Definition: CollisionNode.cs:926

◆ PopulateModelList()

void BrawlCrate.UI.CollisionEditor.PopulateModelList ( )
inlineprotected
1510 {
1511 modelTree.BeginUpdate();
1512 modelTree.Nodes.Clear();
1513 _models.Clear();
1514
1515 if (_targetNode?._parent != null)
1516 {
1519 {
1520 TreeNode modelNode = new TreeNode(n._name) {Tag = n, Checked = true};
1521 modelTree.Nodes.Add(modelNode);
1522 _models.Add(n);
1523
1524 foreach (MDL0BoneNode bone in n._linker.BoneCache)
1525 {
1526 modelNode.Nodes.Add(new TreeNode(bone._name) {Tag = bone, Checked = true});
1527 }
1528
1530 n.ResetToBindState();
1531 }
1532 }
1533
1534 modelTree.EndUpdate();
1535 }
void AddTarget(IRenderedObject target)
Definition: ModelPanel.cs:134
byte GroupID
Definition: ARCNode.cs:916
void ResetToBindState()
Definition: MDL0Node.cs:3195
ResourceNode _parent
Definition: ResourceNode.cs:142
ResourceNode[] FindChildrenByTypeInGroup(string path, ResourceType type, byte group)
Definition: ResourceNode.cs:1451
ResourceType
Definition: ResourceType.cs:6

◆ PopulateObjectList()

void BrawlCrate.UI.CollisionEditor.PopulateObjectList ( )
inlineprotected
1540 {
1541 lstObjects.BeginUpdate();
1542 lstObjects.Items.Clear();
1543
1544 if (_targetNode != null)
1545 {
1546 foreach (CollisionObject obj in _targetNode.Children)
1547 {
1548 obj._render = true;
1549 lstObjects.Items.Add(obj, true);
1550
1551 MDL0Node model = _models.Where(m => m is MDL0Node && ((ResourceNode) m).Name == obj._modelName)
1552 .FirstOrDefault() as MDL0Node;
1553
1554 MDL0BoneNode bone =
1555 model?._linker.BoneCache.Where(b => b.Name == obj._boneName)
1556 .FirstOrDefault();
1557 if (bone != null)
1558 {
1559 obj._linkedBone = bone;
1560 }
1561
1562 /*if (!obj._flags[1])
1563 foreach (TreeNode n in modelTree.Nodes)
1564 foreach (TreeNode b in n.Nodes)
1565 {
1566 MDL0BoneNode bone = b.Tag as MDL0BoneNode;
1567 if (bone != null && bone.Name == obj._boneName && bone.BoneIndex == obj._boneIndex)
1568 obj._linkedBone = bone;
1569 }*/
1570 }
1571 }
1572
1573 lstObjects.EndUpdate();
1574 }
string _boneName
Definition: CollisionNode.cs:415
string _modelName
Definition: CollisionNode.cs:415
Definition: ResourceNode.cs:129

◆ Redo()

void BrawlCrate.UI.CollisionEditor.Redo ( object  sender,
EventArgs  e 
)
inlineprotected
4168 {
4169 _selectedLinks.Clear();
4170
4171 for (int i = 0; i < redoSaves[undoSaves.Count - saveIndex - 1]._collisionLinks.Count; i++)
4172 {
4173 _selectedLinks.Add(redoSaves[undoSaves.Count - saveIndex - 1]._collisionLinks[i]);
4174 _selectedLinks[i].Value = redoSaves[undoSaves.Count - saveIndex - 1]._linkVectors[i];
4175 }
4176
4177 redoSaves.RemoveAt(undoSaves.Count - saveIndex - 1);
4178 saveIndex++;
4179
4180 if (redoSaves.Count == 0)
4181 {
4182 btnRedo.Enabled = false;
4183 }
4184
4185 btnUndo.Enabled = true;
4186
4187 _modelPanel.Invalidate();
4189 }

◆ SelectionModified()

virtual void BrawlCrate.UI.CollisionEditor.SelectionModified ( )
inlineprotectedvirtual

Reimplemented in BrawlCrate.UI.AdvancedCollisionEditor.

1407 {
1408 _selectedPlanes.Clear();
1409 foreach (CollisionLink l in _selectedLinks)
1410 {
1411 foreach (CollisionPlane p in l._members)
1412 {
1413 if (_selectedLinks.Contains(p._linkLeft) &&
1414 _selectedLinks.Contains(p._linkRight) &&
1415 !_selectedPlanes.Contains(p))
1416 {
1417 _selectedPlanes.Add(p);
1418 }
1419 }
1420 }
1421
1422 pnlPlaneProps.Visible = false;
1423 pnlObjProps.Visible = false;
1424 pnlPointProps.Visible = false;
1425 panel3.Height = 0;
1426
1427 if (_selectedPlanes.Count > 0)
1428 {
1429 pnlPlaneProps.Visible = true;
1430 panel3.Height = 190;
1431 }
1432 else if (_selectedLinks.Count == 1)
1433 {
1434 pnlPointProps.Visible = true;
1435 panel3.Height = 70;
1436 }
1437
1439 }

◆ SnapObject()

void BrawlCrate.UI.CollisionEditor.SnapObject ( )
inlineprotected
1648 {
1649 if (_selectedObject == null)
1650 {
1651 return;
1652 }
1653
1654 _updating = true;
1655
1657
1658 for (int i = 0; i < lstObjects.Items.Count; i++)
1659 {
1660 lstObjects.SetItemChecked(i, false);
1661 }
1662
1663 //Set snap matrix
1664 if (!string.IsNullOrEmpty(_selectedObject._modelName))
1665 {
1666 foreach (TreeNode node in modelTree.Nodes)
1667 {
1668 if (node.Text == _selectedObject._modelName)
1669 {
1670 foreach (TreeNode bNode in node.Nodes)
1671 {
1672 if (bNode.Text == _selectedObject._boneName)
1673 {
1674 _snapMatrix = ((MDL0BoneNode) bNode.Tag)._inverseBindMatrix;
1675 break;
1676 }
1677 }
1678
1679 break;
1680 }
1681 }
1682 }
1683
1684 //Show objects with similar bones
1685 for (int i = lstObjects.Items.Count; i-- > 0;)
1686 {
1687 CollisionObject obj = lstObjects.Items[i] as CollisionObject;
1689 {
1690 lstObjects.SetItemChecked(i, true);
1691 }
1692 }
1693
1694 _updating = false;
1695 _modelPanel.Invalidate();
1696 }

◆ snapToolStripMenuItem1_Click()

void BrawlCrate.UI.CollisionEditor.snapToolStripMenuItem1_Click ( object  sender,
EventArgs  e 
)
inlineprotected
4053 {
4054 TreeNode node = modelTree.SelectedNode;
4055 if (!(node?.Tag is MDL0BoneNode))
4056 {
4057 return;
4058 }
4059
4060 _snapMatrix = ((MDL0BoneNode) node.Tag)._inverseBindMatrix;
4061 _modelPanel.Invalidate();
4062 }

◆ snapToolStripMenuItem_Click()

void BrawlCrate.UI.CollisionEditor.snapToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
inlineprotected
1589 {
1590 SnapObject();
1591 }
void SnapObject()
Definition: CollisionEditor.cs:1647

◆ TargetChanged()

void BrawlCrate.UI.CollisionEditor.TargetChanged ( CollisionNode  node)
inlineprotected
1381 {
1383 trackBar1.Value = 0;
1385 _selectedObject = null;
1386
1388
1389 _targetNode = node;
1390
1393
1394 if (lstObjects.Items.Count > 0)
1395 {
1396 lstObjects.SelectedIndex = 0;
1398 //SnapObject();
1399 }
1400
1402
1404 }
void PopulateObjectList()
Definition: CollisionEditor.cs:1539
void PopulateModelList()
Definition: CollisionEditor.cs:1509
void ClearAll()
Definition: ModelPanel.cs:122

◆ trackBar1_Scroll()

void BrawlCrate.UI.CollisionEditor.trackBar1_Scroll ( object  sender,
EventArgs  e 
)
inlineprotected
2616 {
2617 _modelPanel.Invalidate();
2618 }

◆ transformToolStripMenuItem_Click()

void BrawlCrate.UI.CollisionEditor.transformToolStripMenuItem_Click ( object  sender,
EventArgs  e 
)
inlineprotected
3782 {
3783 TransformEditor transform = new TransformEditor();
3784 if (transform.ShowDialog() == DialogResult.OK)
3785 {
3786 CreateUndo();
3787
3788 if (_selectedPlanes.Count > 0)
3789 {
3790 FrameState _centerState =
3791 new FrameState(new Vector3(1, 1, 1), new Vector3(0, 0, 0), new Vector3(0, 0, 0));
3792 /*if(transform._transform.ScalingType == xyTransform.ScaleType.FromCenterOfCollisions)
3793 {
3794 Vector2 v2avg = new Vector2(0, 0);
3795 int i = 0;
3796 foreach(CollisionLink l in _selectedLinks)
3797 {
3798 v2avg += l._rawValue;
3799 i++;
3800 }
3801 float newX = (v2avg._x / i) * -1;// * (v2avg._x >= 1 ? -1 : 1);
3802 float newY = (v2avg._y / i) * -1;// * (v2avg._y >= 1 ? -1 : 1);
3803 Console.WriteLine(new Vector2(newX, newY));
3804 _centerState = new FrameState(new Vector3(1, 1, 1), new Vector3(0, 0, 0), new Vector3(newX, newY, 0));
3805 }*/
3806 Vector3 v3trans = new Vector3(transform._transform.Translation._x,
3807 transform._transform.Translation._y, 0);
3808 Vector3 v3rot = new Vector3(0, 0, transform._transform.Rotation);
3809 Vector3 v3scale = new Vector3(transform._transform.Scale._x, transform._transform.Scale._y, 1);
3810 FrameState _frameState = new FrameState(v3scale, v3rot, v3trans);
3811 foreach (CollisionLink l in _selectedLinks)
3812 {
3813 l._rawValue = _centerState._transform * _frameState._transform * l._rawValue;
3814 }
3815 }
3816 else
3817 {
3818 foreach (CollisionLink l in _selectedLinks)
3819 {
3820 l._rawValue += transform._transform.Translation;
3821 }
3822 }
3823
3824 _modelPanel.Invalidate();
3826 }
3827 }
Definition: FrameState.cs:10

◆ Undo()

void BrawlCrate.UI.CollisionEditor.Undo ( object  sender,
EventArgs  e 
)
inlineprotected
4131 {
4132 _selectedLinks.Clear();
4133
4134 save = new CollisionState();
4135
4136 if (undoSaves[saveIndex - 1]._linkVectors != null) //XY Positions changed.
4137 {
4138 save._collisionLinks = new List<CollisionLink>();
4139 save._linkVectors = new List<Vector2>();
4140
4141 for (int i = 0; i < undoSaves[saveIndex - 1]._collisionLinks.Count; i++)
4142 {
4143 _selectedLinks.Add(undoSaves[saveIndex - 1]._collisionLinks[i]);
4144 save._collisionLinks.Add(undoSaves[saveIndex - 1]._collisionLinks[i]);
4145 save._linkVectors.Add(undoSaves[saveIndex - 1]._collisionLinks[i].Value);
4146 _selectedLinks[i].Value = undoSaves[saveIndex - 1]._linkVectors[i];
4147 }
4148 }
4149
4150 saveIndex--;
4152
4153 if (saveIndex == 0)
4154 {
4155 btnUndo.Enabled = false;
4156 }
4157
4158 btnRedo.Enabled = true;
4159
4160 redoSaves.Add(save);
4161 save = null;
4162
4163 _modelPanel.Invalidate();
4165 }

◆ UpdateHover()

void BrawlCrate.UI.CollisionEditor.UpdateHover ( int  x,
int  y 
)
inlineprotected
1822 {
1823 if (!_hovering)
1824 {
1825 return;
1826 }
1827
1830
1831 //Apply difference in start/end
1834
1835 //Move points
1836 foreach (CollisionLink p in _selectedLinks)
1837 {
1838 p.Value += diff;
1839 }
1840
1841 _modelPanel.Invalidate();
1842
1844 }

◆ UpdatePropPanels()

virtual void BrawlCrate.UI.CollisionEditor.UpdatePropPanels ( )
inlineprotectedvirtual

Reimplemented in BrawlCrate.UI.AdvancedCollisionEditor.

1442 {
1443 _updating = true;
1444
1445 if (pnlPlaneProps.Visible)
1446 {
1447 if (_selectedPlanes.Count <= 0)
1448 {
1449 pnlPlaneProps.Visible = false;
1450 return;
1451 }
1452
1454
1455 if (p._material >= 32 && cboMaterial.Items.Count <= 32)
1456 {
1457 cboMaterial.DataSource =
1458 CollisionTerrain.Terrains.ToList(); // Get the expanded collisions if they're used
1459 }
1460
1461 cboMaterial.SelectedItem = cboMaterial.Items[p._material];
1462
1463 //Type
1464 cboType.SelectedItem = p.Type;
1465 //Flags
1466 chkFallThrough.Checked = p.IsFallThrough;
1467 chkLeftLedge.Checked = p.IsLeftLedge;
1468 chkRightLedge.Checked = p.IsRightLedge;
1469 chkNoWalljump.Checked = p.IsNoWalljump;
1470 chkTypeCharacters.Checked = p.IsCharacters;
1471 chkTypeItems.Checked = p.IsItems;
1472 chkTypePokemonTrainer.Checked = p.IsPokemonTrainer;
1473 chkTypeRotating.Checked = p.IsRotating;
1474 chkFlagCrush.Checked = p.IsCrush;
1475 chkFlagBucculus.Checked = p.IsBucculusBury;
1476 chkFlagSuperSoft.Checked = p.IsSuperSoft;
1477 }
1478 else if (pnlPointProps.Visible)
1479 {
1480 if (_selectedLinks.Count <= 0)
1481 {
1482 pnlPointProps.Visible = false;
1483 return;
1484 }
1485
1486 numX.Value = _selectedLinks[0].Value._x;
1487 numY.Value = _selectedLinks[0].Value._y;
1488 }
1489 else if (pnlObjProps.Visible)
1490 {
1491 if (_selectedObject == null)
1492 {
1493 pnlObjProps.Visible = false;
1494 return;
1495 }
1496
1497 txtModel.Text = _selectedObject._modelName;
1498 txtBone.Text = _selectedObject._boneName;
1499 chkObjUnk.Checked = _selectedObject.UnknownFlag;
1500 chkObjModule.Checked = _selectedObject.ModuleControlled;
1501 chkObjSSEUnk.Checked = _selectedObject.UnknownSSEFlag;
1502 }
1503
1504 _updating = false;
1505 }
bool UnknownFlag
Definition: CollisionNode.cs:364
bool UnknownSSEFlag
Definition: CollisionNode.cs:398
bool ModuleControlled
Definition: CollisionNode.cs:387
bool IsCrush
Definition: CollisionNode.cs:1071
bool IsFallThrough
Definition: CollisionNode.cs:1127
byte _material
Definition: CollisionNode.cs:924
bool IsNoWalljump
Definition: CollisionNode.cs:1147
bool IsBucculusBury
Definition: CollisionNode.cs:1078
bool IsSuperSoft
Definition: CollisionNode.cs:1165

◆ UpdateSelection()

void BrawlCrate.UI.CollisionEditor.UpdateSelection ( bool  finish)
inlineprotected
1725 {
1726 foreach (CollisionObject obj in _targetNode.Children)
1727 {
1728 foreach (CollisionLink link in obj._points)
1729 {
1730 link._highlight = false;
1731 if (!obj._render)
1732 {
1733 continue;
1734 }
1735
1736 Vector3 point = (Vector3) link.Value;
1737
1738 if (_selectInverse && point.Contained(_selectStart, _selectEnd, 0.0f))
1739 {
1740 if (finish)
1741 {
1742 _selectedLinks.Remove(link);
1743 }
1744
1745 continue;
1746 }
1747
1748 if (_selectedLinks.Contains(link))
1749 {
1750 link._highlight = true;
1751 }
1752 else if (!_selectInverse && point.Contained(_selectStart, _selectEnd, 0.0f))
1753 {
1754 link._highlight = true;
1755 if (finish)
1756 {
1757 _selectedLinks.Add(link);
1758 }
1759 }
1760 }
1761 }
1762 }
bool Contained(Vector3 start, Vector3 end, float expansion)
Definition: Vector3.cs:458

◆ UpdateTools()

void BrawlCrate.UI.CollisionEditor.UpdateTools ( )
inline
1765 {
1766 if (_selecting || _hovering || _selectedLinks.Count == 0)
1767 {
1768 btnDelete.Enabled = btnFlipColl.Enabled = btnTransform.Enabled =
1769 btnMerge.Enabled = btnSplit.Enabled = btnSameX.Enabled = btnSameY.Enabled = false;
1770 }
1771 else
1772 {
1773 btnMerge.Enabled = btnSameX.Enabled = btnSameY.Enabled = _selectedLinks.Count > 1;
1774 btnDelete.Enabled = btnSplit.Enabled = btnTransform.Enabled = true;
1775 btnFlipColl.Enabled = _selectedPlanes.Count > 0;
1776 }
1777 }

Member Data Documentation

◆ _creating

bool BrawlCrate.UI.CollisionEditor._creating
protected

◆ _deleteToolStripMenuItem

ToolStripMenuItem BrawlCrate.UI.CollisionEditor._deleteToolStripMenuItem
protected

◆ _hovering

bool BrawlCrate.UI.CollisionEditor._hovering
protected

◆ _modelPanel

ModelPanel BrawlCrate.UI.CollisionEditor._modelPanel

◆ _models

List<IModel> BrawlCrate.UI.CollisionEditor._models = new List<IModel>()
protected

◆ _selectedLinks

List<CollisionLink> BrawlCrate.UI.CollisionEditor._selectedLinks = new List<CollisionLink>()
protected

◆ _selectedObject

CollisionObject BrawlCrate.UI.CollisionEditor._selectedObject
protected

◆ _selectedPlanes

List<CollisionPlane> BrawlCrate.UI.CollisionEditor._selectedPlanes = new List<CollisionPlane>()
protected

◆ _selectEnd

Vector3 BrawlCrate.UI.CollisionEditor._selectEnd
protected

◆ _selecting

bool BrawlCrate.UI.CollisionEditor._selecting
protected

◆ _selectInverse

bool BrawlCrate.UI.CollisionEditor._selectInverse
protected

◆ _selectLast

Vector3 BrawlCrate.UI.CollisionEditor._selectLast
protected

◆ _selectStart

Vector3 BrawlCrate.UI.CollisionEditor._selectStart
protected

◆ _snapMatrix

Matrix BrawlCrate.UI.CollisionEditor._snapMatrix
protected

◆ _targetNode

CollisionNode BrawlCrate.UI.CollisionEditor._targetNode
protected

◆ _updating

bool BrawlCrate.UI.CollisionEditor._updating
protected

◆ assignNoMoveToolStripMenuItem

ToolStripMenuItem BrawlCrate.UI.CollisionEditor.assignNoMoveToolStripMenuItem
protected

◆ assignSeperatorToolStripMenuItem

ToolStripSeparator BrawlCrate.UI.CollisionEditor.assignSeperatorToolStripMenuItem
protected

◆ assignToolStripMenuItem

ToolStripMenuItem BrawlCrate.UI.CollisionEditor.assignToolStripMenuItem
protected

◆ btnBoundaries

ToolStripButton BrawlCrate.UI.CollisionEditor.btnBoundaries
protected

◆ btnDelete

ToolStripButton BrawlCrate.UI.CollisionEditor.btnDelete
protected

◆ btnFlipColl

ToolStripButton BrawlCrate.UI.CollisionEditor.btnFlipColl
protected

◆ btnHelp

ToolStripButton BrawlCrate.UI.CollisionEditor.btnHelp
protected

◆ btnItems

ToolStripButton BrawlCrate.UI.CollisionEditor.btnItems
protected

◆ btnMerge

ToolStripButton BrawlCrate.UI.CollisionEditor.btnMerge
protected

◆ btnNextFrame

Button BrawlCrate.UI.CollisionEditor.btnNextFrame
protected

◆ btnOrthographicCam

ToolStripButton BrawlCrate.UI.CollisionEditor.btnOrthographicCam
protected

◆ btnPerspectiveCam

ToolStripButton BrawlCrate.UI.CollisionEditor.btnPerspectiveCam
protected

◆ btnPlayAnims

Button BrawlCrate.UI.CollisionEditor.btnPlayAnims
protected

◆ btnPrevFrame

Button BrawlCrate.UI.CollisionEditor.btnPrevFrame
protected

◆ btnRedo

ToolStripButton BrawlCrate.UI.CollisionEditor.btnRedo
protected

◆ btnRelink

Button BrawlCrate.UI.CollisionEditor.btnRelink
protected

◆ btnResetCam

ToolStripButton BrawlCrate.UI.CollisionEditor.btnResetCam
protected

◆ btnResetRot

Button BrawlCrate.UI.CollisionEditor.btnResetRot
protected

◆ btnResetSnap

ToolStripButton BrawlCrate.UI.CollisionEditor.btnResetSnap
protected

◆ btnSameX

ToolStripButton BrawlCrate.UI.CollisionEditor.btnSameX
protected

◆ btnSameY

ToolStripButton BrawlCrate.UI.CollisionEditor.btnSameY
protected

◆ btnSpawns

ToolStripButton BrawlCrate.UI.CollisionEditor.btnSpawns
protected

◆ btnSplit

ToolStripButton BrawlCrate.UI.CollisionEditor.btnSplit
protected

◆ btnTransform

ToolStripButton BrawlCrate.UI.CollisionEditor.btnTransform
protected

◆ btnUndo

ToolStripButton BrawlCrate.UI.CollisionEditor.btnUndo
protected

◆ btnUnlink

Button BrawlCrate.UI.CollisionEditor.btnUnlink
protected

◆ cboMaterial

ComboBox BrawlCrate.UI.CollisionEditor.cboMaterial
protected

◆ cboType

ComboBox BrawlCrate.UI.CollisionEditor.cboType
protected

◆ chkAllModels

CheckBox BrawlCrate.UI.CollisionEditor.chkAllModels
protected

◆ chkBones

CheckBox BrawlCrate.UI.CollisionEditor.chkBones
protected

◆ chkFallThrough

CheckBox BrawlCrate.UI.CollisionEditor.chkFallThrough
protected

◆ chkFlagBucculus

CheckBox BrawlCrate.UI.CollisionEditor.chkFlagBucculus
protected

◆ chkFlagCrush

CheckBox BrawlCrate.UI.CollisionEditor.chkFlagCrush
protected

◆ chkFlagSuperSoft

CheckBox BrawlCrate.UI.CollisionEditor.chkFlagSuperSoft
protected

◆ chkLeftLedge

CheckBox BrawlCrate.UI.CollisionEditor.chkLeftLedge
protected

◆ chkNoWalljump

CheckBox BrawlCrate.UI.CollisionEditor.chkNoWalljump
protected

◆ chkObjModule

CheckBox BrawlCrate.UI.CollisionEditor.chkObjModule
protected

◆ chkObjSSEUnk

CheckBox BrawlCrate.UI.CollisionEditor.chkObjSSEUnk
protected

◆ chkObjUnk

CheckBox BrawlCrate.UI.CollisionEditor.chkObjUnk
protected

◆ chkPoly

CheckBox BrawlCrate.UI.CollisionEditor.chkPoly
protected

◆ chkRightLedge

CheckBox BrawlCrate.UI.CollisionEditor.chkRightLedge
protected

◆ chkTypeCharacters

CheckBox BrawlCrate.UI.CollisionEditor.chkTypeCharacters
protected

◆ chkTypeItems

CheckBox BrawlCrate.UI.CollisionEditor.chkTypeItems
protected

◆ chkTypePokemonTrainer

CheckBox BrawlCrate.UI.CollisionEditor.chkTypePokemonTrainer
protected

◆ chkTypeRotating

CheckBox BrawlCrate.UI.CollisionEditor.chkTypeRotating
protected

◆ contextMenuStrip1

ContextMenuStrip BrawlCrate.UI.CollisionEditor.contextMenuStrip1
protected

◆ contextMenuStrip2

ContextMenuStrip BrawlCrate.UI.CollisionEditor.contextMenuStrip2
protected

◆ contextMenuStrip3

ContextMenuStrip BrawlCrate.UI.CollisionEditor.contextMenuStrip3
protected

◆ groupBoxFlags1

GroupBox BrawlCrate.UI.CollisionEditor.groupBoxFlags1
protected

◆ groupBoxFlags2

GroupBox BrawlCrate.UI.CollisionEditor.groupBoxFlags2
protected

◆ groupBoxTargets

GroupBox BrawlCrate.UI.CollisionEditor.groupBoxTargets
protected

◆ hasMoved

bool BrawlCrate.UI.CollisionEditor.hasMoved
protected

◆ label1

Label BrawlCrate.UI.CollisionEditor.label1
protected

◆ label2

Label BrawlCrate.UI.CollisionEditor.label2
protected

◆ label3

Label BrawlCrate.UI.CollisionEditor.label3
protected

◆ label4

Label BrawlCrate.UI.CollisionEditor.label4
protected

◆ label5

Label BrawlCrate.UI.CollisionEditor.label5
protected

◆ labelType

Label BrawlCrate.UI.CollisionEditor.labelType
protected

◆ LargeIncrement

const float BrawlCrate.UI.CollisionEditor.LargeIncrement = 3.0f
staticprotected

◆ lstObjects

CheckedListBox BrawlCrate.UI.CollisionEditor.lstObjects
protected

◆ modelTree

TreeView BrawlCrate.UI.CollisionEditor.modelTree
protected

◆ newObjectToolStripMenuItem

ToolStripMenuItem BrawlCrate.UI.CollisionEditor.newObjectToolStripMenuItem
protected

◆ numX

NumericInputBox BrawlCrate.UI.CollisionEditor.numX
protected

◆ numY

NumericInputBox BrawlCrate.UI.CollisionEditor.numY
protected

◆ panel1

Panel BrawlCrate.UI.CollisionEditor.panel1
protected

◆ panel2

Panel BrawlCrate.UI.CollisionEditor.panel2
protected

◆ panel3

Panel BrawlCrate.UI.CollisionEditor.panel3
protected

◆ panel4

Panel BrawlCrate.UI.CollisionEditor.panel4
protected

◆ pnlObjProps

Panel BrawlCrate.UI.CollisionEditor.pnlObjProps
protected

◆ pnlPlaneProps

Panel BrawlCrate.UI.CollisionEditor.pnlPlaneProps
protected

◆ pnlPointProps

Panel BrawlCrate.UI.CollisionEditor.pnlPointProps
protected

◆ PointSelectRadius

const float BrawlCrate.UI.CollisionEditor.PointSelectRadius = 1.5f
staticprotected

◆ redoSaves

List<CollisionState> BrawlCrate.UI.CollisionEditor.redoSaves = new List<CollisionState>()
protected

◆ redoToolStrip

SplitContainer BrawlCrate.UI.CollisionEditor.redoToolStrip
protected

◆ save

CollisionState BrawlCrate.UI.CollisionEditor.save
protected

◆ saveIndex

int BrawlCrate.UI.CollisionEditor.saveIndex
protected

◆ SelectWidth

const float BrawlCrate.UI.CollisionEditor.SelectWidth = 7.0f
staticprotected

◆ SmallIncrement

const float BrawlCrate.UI.CollisionEditor.SmallIncrement = 0.5f
staticprotected

◆ snapToolStripMenuItem

ToolStripMenuItem BrawlCrate.UI.CollisionEditor.snapToolStripMenuItem
protected

◆ snapToolStripMenuItem1

ToolStripMenuItem BrawlCrate.UI.CollisionEditor.snapToolStripMenuItem1
protected

◆ toolStrip1

ToolStrip BrawlCrate.UI.CollisionEditor.toolStrip1
protected

◆ toolStripMenuItem1

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripMenuItem1
protected

◆ toolStripMenuItem2

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripMenuItem2
protected

◆ toolStripMenuItem3

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripMenuItem3
protected

◆ toolStripSeparator1

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripSeparator1
protected

◆ toolStripSeparator2

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripSeparator2
protected

◆ toolStripSeparator3

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripSeparator3
protected

◆ toolStripSeparatorCamera

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripSeparatorCamera
protected

◆ toolStripSeparatorOverlays

ToolStripSeparator BrawlCrate.UI.CollisionEditor.toolStripSeparatorOverlays
protected

◆ trackBar1

TrackBar BrawlCrate.UI.CollisionEditor.trackBar1
protected

◆ txtBone

TextBox BrawlCrate.UI.CollisionEditor.txtBone
protected

◆ txtModel

TextBox BrawlCrate.UI.CollisionEditor.txtModel
protected

◆ undoSaves

List<CollisionState> BrawlCrate.UI.CollisionEditor.undoSaves = new List<CollisionState>()
protected

◆ undoToolStrip

SplitContainer BrawlCrate.UI.CollisionEditor.undoToolStrip
protected

◆ unlinkNoMoveToolStripMenuItem

ToolStripMenuItem BrawlCrate.UI.CollisionEditor.unlinkNoMoveToolStripMenuItem
protected

◆ unlinkToolStripMenuItem

ToolStripMenuItem BrawlCrate.UI.CollisionEditor.unlinkToolStripMenuItem
protected

Property Documentation

◆ ErrorChecking

virtual bool BrawlCrate.UI.CollisionEditor.ErrorChecking
getprotected

◆ TargetNode

CollisionNode BrawlCrate.UI.CollisionEditor.TargetNode
getset
1337 {
1338 get => _targetNode;
1339 set => TargetChanged(value);
1340 }
void TargetChanged(CollisionNode node)
Definition: CollisionEditor.cs:1380

The documentation for this class was generated from the following file: