Пример #1
0
		private void OnGUI()
		{
			if (AssetSaveDialog.s_Styles == null)
			{
				AssetSaveDialog.s_Styles = new AssetSaveDialog.Styles();
				base.minSize = new Vector2(500f, 300f);
				base.position = new Rect(base.position.x, base.position.y, base.minSize.x, base.minSize.y);
			}
			this.HandleKeyboard();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(new GUILayoutOption[0]);
			GUILayout.Space(10f);
			GUILayout.Label("Unity is about to save the following modified files. Unsaved changes will be lost!", new GUILayoutOption[0]);
			GUILayout.Space(10f);
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(new GUILayoutOption[0]);
			GUILayout.Space(10f);
			int row = this.m_LV.row;
			int num = 0;
			foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.m_LV, AssetSaveDialog.s_Styles.box, new GUILayoutOption[0]))
			{
				if (this.m_SelectedItems[listViewElement.row] && Event.current.type == EventType.Repaint)
				{
					Rect position = listViewElement.position;
					position.x += 1f;
					position.y += 1f;
					position.width -= 1f;
					position.height -= 1f;
					AssetSaveDialog.s_Styles.selected.Draw(position, false, false, false, false);
				}
				GUILayout.Label(this.m_Content[listViewElement.row], new GUILayoutOption[0]);
				if (ListViewGUILayout.HasMouseUp(listViewElement.position))
				{
					Event.current.command = true;
					Event.current.control = true;
					ListViewGUILayout.MultiSelection(row, listViewElement.row, ref this.m_InitialSelectedItem, ref this.m_SelectedItems);
				}
				if (this.m_SelectedItems[listViewElement.row])
				{
					num++;
				}
			}
			GUILayout.Space(10f);
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
			GUILayout.BeginHorizontal(new GUILayoutOption[0]);
			GUILayout.Space(10f);
			if (GUILayout.Button(AssetSaveDialog.s_Styles.close, AssetSaveDialog.s_Styles.button, new GUILayoutOption[]
			{
				GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
			}))
			{
				this.CloseWindow();
			}
			GUILayout.FlexibleSpace();
			GUI.enabled = (num > 0);
			bool flag = num == this.m_Assets.Count;
			if (GUILayout.Button(AssetSaveDialog.s_Styles.dontSave, AssetSaveDialog.s_Styles.button, new GUILayoutOption[]
			{
				GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
			}))
			{
				this.IgnoreSelectedAssets();
			}
			if (GUILayout.Button((!flag) ? AssetSaveDialog.s_Styles.saveSelected : AssetSaveDialog.s_Styles.saveAll, AssetSaveDialog.s_Styles.button, new GUILayoutOption[]
			{
				GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
			}))
			{
				this.SaveSelectedAssets();
			}
			if (this.m_Assets.Count == 0)
			{
				this.CloseWindow();
			}
			GUI.enabled = true;
			GUILayout.Space(10f);
			GUILayout.EndHorizontal();
			GUILayout.Space(10f);
		}
Пример #2
0
        private void OnGUI()
        {
            if (AssetSaveDialog.s_Styles == null)
            {
                AssetSaveDialog.s_Styles = new AssetSaveDialog.Styles();
                base.minSize             = new Vector2(500f, 300f);
                base.position            = new Rect(base.position.x, base.position.y, base.minSize.x, base.minSize.y);
            }
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(10f);
            GUILayout.Label("Unity is about to save the following modified files. Unsaved changes will be lost!", new GUILayoutOption[0]);
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(10f);
            int         row        = this.m_LV.row;
            int         num        = 0;
            IEnumerator enumerator = ListViewGUILayout.ListView(this.m_LV, AssetSaveDialog.s_Styles.box, new GUILayoutOption[0]).GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    ListViewElement listViewElement = (ListViewElement)enumerator.Current;
                    if (this.m_SelectedItems[listViewElement.row] && Event.current.type == EventType.Repaint)
                    {
                        Rect position = listViewElement.position;
                        position.x      += 1f;
                        position.y      += 1f;
                        position.width  -= 1f;
                        position.height -= 1f;
                        AssetSaveDialog.s_Styles.selected.Draw(position, false, false, false, false);
                    }
                    GUILayout.Label(this.m_Content[listViewElement.row], new GUILayoutOption[0]);
                    if (ListViewGUILayout.HasMouseUp(listViewElement.position))
                    {
                        Event.current.command = true;
                        Event.current.control = true;
                        ListViewGUILayout.MultiSelection(row, listViewElement.row, ref this.m_InitialSelectedItem, ref this.m_SelectedItems);
                    }
                    if (this.m_SelectedItems[listViewElement.row])
                    {
                        num++;
                    }
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.Space(10f);
            if (GUILayout.Button(AssetSaveDialog.s_Styles.close, AssetSaveDialog.s_Styles.button, new GUILayoutOption[]
            {
                GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
            }))
            {
                this.CloseWindow();
            }
            GUILayout.FlexibleSpace();
            GUI.enabled = (num > 0);
            bool flag = num == this.m_Assets.Count;

            if (GUILayout.Button(AssetSaveDialog.s_Styles.dontSave, AssetSaveDialog.s_Styles.button, new GUILayoutOption[]
            {
                GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
            }))
            {
                this.IgnoreSelectedAssets();
            }
            if (GUILayout.Button((!flag) ? AssetSaveDialog.s_Styles.saveSelected : AssetSaveDialog.s_Styles.saveAll, AssetSaveDialog.s_Styles.button, new GUILayoutOption[]
            {
                GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
            }))
            {
                this.SaveSelectedAssets();
            }
            if (this.m_Assets.Count == 0)
            {
                this.CloseWindow();
            }
            GUI.enabled = true;
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
        }
Пример #3
0
        private void OnGUI()
        {
            if (AssetSaveDialog.s_Styles == null)
            {
                AssetSaveDialog.s_Styles = new AssetSaveDialog.Styles();
                this.minSize             = new Vector2(500f, 300f);
                this.position            = new Rect(this.position.x, this.position.y, this.minSize.x, this.minSize.y);
            }
            this.HandleKeyboard();
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal();
            GUILayout.Space(10f);
            GUILayout.Label("Unity is about to save the following modified files. Unsaved changes will be lost!");
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal();
            GUILayout.Space(10f);
            int row = this.m_LV.row;
            int num = 0;

            foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.m_LV, AssetSaveDialog.s_Styles.box))
            {
                if (this.m_SelectedItems[listViewElement.row] && Event.current.type == EventType.Repaint)
                {
                    Rect position = listViewElement.position;
                    ++position.x;
                    ++position.y;
                    --position.width;
                    --position.height;
                    AssetSaveDialog.s_Styles.selected.Draw(position, false, false, false, false);
                }
                GUILayout.Label(this.m_Content[listViewElement.row]);
                if (ListViewGUILayout.HasMouseUp(listViewElement.position))
                {
                    Event.current.command = true;
                    Event.current.control = true;
                    ListViewGUILayout.MultiSelection(row, listViewElement.row, ref this.m_InitialSelectedItem, ref this.m_SelectedItems);
                }
                if (this.m_SelectedItems[listViewElement.row])
                {
                    ++num;
                }
            }
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
            GUILayout.BeginHorizontal();
            GUILayout.Space(10f);
            if (GUILayout.Button(AssetSaveDialog.s_Styles.close, AssetSaveDialog.s_Styles.button, new GUILayoutOption[1] {
                GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
            }))
            {
                this.CloseWindow();
            }
            GUILayout.FlexibleSpace();
            GUI.enabled = num > 0;
            bool flag = num == this.m_Assets.Count;

            if (GUILayout.Button(AssetSaveDialog.s_Styles.dontSave, AssetSaveDialog.s_Styles.button, new GUILayoutOption[1] {
                GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
            }))
            {
                this.IgnoreSelectedAssets();
            }
            if (GUILayout.Button(!flag ? AssetSaveDialog.s_Styles.saveSelected : AssetSaveDialog.s_Styles.saveAll, AssetSaveDialog.s_Styles.button, new GUILayoutOption[1] {
                GUILayout.Width(AssetSaveDialog.s_Styles.buttonWidth)
            }))
            {
                this.SaveSelectedAssets();
            }
            if (this.m_Assets.Count == 0)
            {
                this.CloseWindow();
            }
            GUI.enabled = true;
            GUILayout.Space(10f);
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
        }