private void CloneHotspot_Click(object sender, EventArgs e) { Windows.RenamePopup popup = new Windows.RenamePopup("Name", "Clone hotspot"); popup.Closed += (o, ev) => { if (popup.DialogResult) { var hotspot = new Hotspot(); hotspot.Title = popup.NewName; SelectedObject.DebugAppearance.CopyAppearanceTo(hotspot.DebugAppearance); hotspot.Settings = new Dictionary <string, string>(SelectedObject.Settings); ((Editors.SceneEditor)MainScreen.Instance.ActiveEditor).LoadHotspot(hotspot); } }; popup.Show(true); popup.Center(); }
public GameObjectNamePanel() { Title = "Game Object"; nameTitle = new DrawingSurface(Consoles.ToolPane.PanelWidth - 3, 2); setName = new Button(3, 1); setName.ShowEnds = false; setName.Text = "Set"; setName.ButtonClicked += (s, e) => { Windows.RenamePopup rename = new Windows.RenamePopup(entity.Name); rename.Closed += (s2, e2) => { if (rename.DialogResult) entity.Name = rename.NewName; PrintName(); }; rename.Center(); rename.Show(true); }; Controls = new ControlBase[] { setName, nameTitle }; }
public GameObjectNamePanel() { Title = "Game Object"; nameTitle = new DrawingSurface(Consoles.ToolPane.PanelWidth - 3, 2); setName = new Button(3); setName.ShowEnds = false; setName.Text = "Set"; setName.Click += (s, e) => { Windows.RenamePopup rename = new Windows.RenamePopup(entity.Name); rename.Closed += (s2, e2) => { if (rename.DialogResult) { entity.Name = rename.NewName; } PrintName(); }; rename.Center(); rename.Show(true); }; Controls = new ControlBase[] { setName, nameTitle }; }
private void CloneHotspot_ButtonClicked(object sender, EventArgs e) { Windows.RenamePopup popup = new Windows.RenamePopup("Name", "Clone hotspot"); popup.Closed += (o, ev) => { if (popup.DialogResult) { var hotspot = new Hotspot(); hotspot.Title = popup.NewName; SelectedObject.DebugAppearance.CopyAppearanceTo(hotspot.DebugAppearance); hotspot.Settings = new Dictionary<string, string>(SelectedObject.Settings); ((Editors.SceneEditor)EditorConsoleManager.ActiveEditor).Hotspots.Add(hotspot); } }; popup.Show(true); popup.Center(); }