public OutfitControl(string path) { InitializeComponent(); RagdollNodeNumeric.FixMouseWheel(); MenuTabs = new ToolStripMenuItem[] { new ToolStripMenuItem("Link ragdoll", null, LinkRagdollMenuItem_Click, Keys.Control | Keys.I), new ToolStripMenuItem("Link sprite", null, LinkSpriteMenuItem_Click, Keys.Control | Keys.Shift | Keys.I), new ToolStripMenuItem("Create node", null, CreateNodeMenuItem_Click, Keys.Control | Keys.A), new ToolStripMenuItem("Remove node", null, RemoveNodeMenuItem_Click, Keys.Control | Keys.D), new ToolStripMenuItem("Move node up", null, MoveNodeUpMenuItem_Click, Keys.Control | Keys.Up), new ToolStripMenuItem("Move node down", null, MoveNodeDownMenuItem_Click, Keys.Control | Keys.Down), new ToolStripMenuItem("Toggle grid", null, ToggleGridMenuItem_Click, Keys.Control | Keys.G), new ToolStripMenuItem("Toggle transparency", null, ToggleTransparencyMenuItem_Click, Keys.Control | Keys.H), new ToolStripMenuItem("Pixel perfect", null, PixelPerfectMenuItem_Click, Keys.Control | Keys.P), new ToolStripMenuItem("Background color", null, BackColorMenuItem_Click, Keys.Control | Keys.L), new ToolStripMenuItem("Reset position", null, ResetPositionMenuItem_Click, Keys.Control | Keys.R), }; for (int i = 3; i <= 5; i++) { MenuTabs[i].Enabled = false; } GLSurface.MakeCurrent(); LoadedResource = new OutfitResource(path); RagdollLinkTextBox.Text = LoadedResource.Ragdoll.Link; Story = new StoryItem <StoryState>(new StoryState(LoadedResource)); Story.ValueChanged += Story_ValueChanged; LoadedResource.Ragdoll.Reload(); RagdollLinkTextBox.Subresource = LoadedResource.Ragdoll; LoadedResource.Ragdoll.Resource?.Clothe(LoadedResource); ResourcePath = path; ResourceName = Path.GetFileName(path); GetTab("Toggle grid").Checked = LoadedResource.GridEnabled; GetTab("Toggle transparency").Checked = LoadedResource.Transparency; GetTab("Pixel perfect").Checked = LoadedResource.PixelPerfect; NodesListBox.BeginUpdate(); while (NodesListBox.Items.Count < LoadedResource.Count) { NodesListBox.Items.Add("Node: " + NodesListBox.Items.Count); } while (NodesListBox.Items.Count > LoadedResource.Count) { NodesListBox.Items.RemoveAt(NodesListBox.Items.Count - 1); } NodesListBox.EndUpdate(); GLSurface.BackColor = Color.FromArgb(LoadedResource.BackColor); ClotheTypeComboBox.Items.AddRange(Enum.GetNames(typeof(OutfitResource.Node.Clothe))); UpdateRedactor(); GLFrameTimer.Start(); }
//----------------------------------------------------------------------------------- void OnGUI() { ShowNotifications(); LoadFX(); if (Controller == null || FxData == null || !Controller.IsInited) { return; } LoadEditorResources(); Color currentColor = GUI.color; DrawToolStrip(); scrollerWindow_ = EditorGUILayout.BeginScrollView(scrollerWindow_); DrawIconList(); if (firstOnGUI_) { Repaint(); firstOnGUI_ = false; } Event e = Event.current; if (e.type == EventType.Repaint) { menusRect_ = GUILayoutUtility.GetLastRect(); } CalculateWindowDimensions(); NodesListBox.RenderGUI(nodeManager_area_); DrawSimulationControls(simControlsRect_, Controller.BlockEdition); GUI.Box(nodeParams_box_, ""); DrawParamsView(); EditorGUILayout.EndScrollView(); GUI.color = currentColor; ProcessActions(e); }