示例#1
0
        private Rect    GUIExport(Rect r)
        {
            Vars vars = this.perWindowVars.Get(RowUtility.drawingWindow);

            EditorGUI.BeginDisabledGroup(this.streams[vars.workingStream].rowsDrawer.Count == 0);
            {
                Utility.content.text = LC.G("RecorderModule_ExportSamples");
                float x     = r.x;
                float width = HQ.Settings.Get <GeneralSettings>().MenuButtonStyle.CalcSize(Utility.content).x;
                r.x     = r.x + r.width - width;
                r.width = width;

                if (GUI.Button(r, Utility.content, HQ.Settings.Get <GeneralSettings>().MenuButtonStyle) == true)
                {
                    List <Row> rows = new List <Row>();

                    for (int i = 0; i < this.streams[vars.workingStream].rowsDrawer.Count; i++)
                    {
                        rows.Add(this.console.rows[this.streams[vars.workingStream].rowsDrawer[i]]);
                    }

                    ExportLogsWindow.Export(rows);
                }

                r.width = r.x - x;
                r.x     = x;
            }
            EditorGUI.EndDisabledGroup();

            return(r);
        }
示例#2
0
        private Rect    GUIExport(Rect r)
        {
            Vars vars = this.perWindowVars.Get(RowUtility.drawingWindow);

            EditorGUI.BeginDisabledGroup(this.folders.Count == 0 || this.folders[vars.workingFolder].rowsDrawer.Count == 0);
            {
                Utility.content.text = LC.G("ArchiveModule_ExportArchives");
                GeneralSettings settings = HQ.Settings.Get <GeneralSettings>();
                float           x        = r.x;
                float           width    = settings.MenuButtonStyle.CalcSize(Utility.content).x;
                r.x     = r.x + r.width - width;
                r.width = width;

                if (GUI.Button(r, Utility.content, settings.MenuButtonStyle) == true)
                {
                    List <Row> rows       = new List <Row>();
                    Vars       closedVars = vars;

                    for (int i = 0; i < this.folders[vars.workingFolder].rowsDrawer.Count; i++)
                    {
                        rows.Add(this.console.rows[this.folders[vars.workingFolder].rowsDrawer[i]]);
                    }

                    Action <ILogExporter, Row> ExportLogNote = delegate(ILogExporter exporter, Row row)
                    {
                        foreach (LogNote n in this.folders[closedVars.workingFolder].notes)
                        {
                            if (n.row == row)
                            {
                                exporter.AddColumn("note", n.note, null);
                                break;
                            }
                        }
                    };

                    ExportLogsWindow.Export(rows, ExportLogNote);
                }

                r.width = r.x - x;
                r.x     = x;
            }
            EditorGUI.EndDisabledGroup();

            return(r);
        }