Пример #1
0
    public override void OnInspectorGUI()
    {
        // Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
        serializedObject.Update();

        string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));

        m_tabType = (eTabType)GUILayout.Toolbar((int)m_tabType, toolBarButtonNames);

        switch (m_tabType)
        {
        case eTabType.Core: DrawCore(); break;

        case eTabType.Labels: DrawLabels(); break;

        case eTabType.Shading: DrawShading(); break;

        case eTabType.Misc: DrawMisc(); break;
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(series);
        }

        // Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
        serializedObject.ApplyModifiedProperties();
    }
Пример #2
0
    public override void OnInspectorGUI()
    {
        // Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
        serializedObject.Update();

        string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));

        m_tabType = (eTabType)GUILayout.Toolbar((int)m_tabType, toolBarButtonNames);

        switch (m_tabType)
        {
        case eTabType.Core: DrawCore(); break;

        case eTabType.OtherSlice: DrawOtherSlice(); break;

        case eTabType.Anim: DrawAnim(); break;

        case eTabType.Labels: DrawLabels(); break;

        case eTabType.Misc: DrawMisc(); break;
        }

        // Update graphics based on graph width and height
        UpdateSceneView();

        if (GUI.changed)
        {
            EditorUtility.SetDirty(graph);
        }

        // Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
        serializedObject.ApplyModifiedProperties();
    }
Пример #3
0
	public override void OnInspectorGUI()
	{
		// Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
		serializedObject.Update();

		string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));
		
		m_tabType = (eTabType)GUILayout.Toolbar((int)m_tabType, toolBarButtonNames);

		switch (m_tabType)
		{
		case eTabType.Core: DrawCore(); break;
		case eTabType.OtherSlice: DrawOtherSlice(); break;
		case eTabType.Anim: DrawAnim(); break;
		case eTabType.Labels: DrawLabels(); break;
		case eTabType.Misc: DrawMisc(); break;
		}								

		// Update graphics based on graph width and height
		if (!Application.isPlaying) {
			UpdateSceneView();
		}

		if( GUI.changed ) {
			EditorUtility.SetDirty( graph );
		}
		
		// Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
		serializedObject.ApplyModifiedProperties();
	}
Пример #4
0
    public override void OnInspectorGUI()
    {
        // Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
        serializedObject.Update();
        yAxisSO.Update();
        xAxisSO.Update();

        string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));

        m_tabType = (eTabType)GUILayout.Toolbar((int)m_tabType, toolBarButtonNames);

        switch (m_tabType)
        {
        case eTabType.Core: DrawCore(); break;

        case eTabType.YAxis: DrawYAxis(); break;

        case eTabType.XAxis: DrawXAxis(); break;

        case eTabType.Tooltip: DrawTooltip(); break;

        case eTabType.Anim: DrawAnim(); break;

        case eTabType.Misc: DrawMisc(); break;
        }

        // In editor mode, update graphics based on graph width and height
        if (!Application.isPlaying)
        {
            UpdateSceneView();
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(graph);
            EditorUtility.SetDirty(yAxisSO.targetObject);
            EditorUtility.SetDirty(xAxisSO.targetObject);
        }

        // Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
        serializedObject.ApplyModifiedProperties();
        yAxisSO.ApplyModifiedProperties();
        xAxisSO.ApplyModifiedProperties();
    }
Пример #5
0
    public override void OnInspectorGUI()
    {
        // Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
        serializedObject.Update();

        string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));

        m_tabType = (eTabType)GUILayout.Toolbar((int)m_tabType, toolBarButtonNames);

        switch (m_tabType)
        {
        case eTabType.Core: DrawCore(); break;
        case eTabType.Misc: DrawMisc(); break;
        }

        if( GUI.changed ) {
            EditorUtility.SetDirty( graph );
        }

        // Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
        serializedObject.ApplyModifiedProperties();
    }
        public override void OnInspectorGUI()
        {
            // Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
            serializedObject.Update();

            EditorGUILayout.BeginHorizontal();
            if (MyAutoTileMap.Tileset != null && MyAutoTileMap.Tileset.AtlasTexture == null)
            {
                MyAutoTileMap.Tileset.AtlasTexture = EditorGUILayout.ObjectField("Tileset Atlas", MyAutoTileMap.Tileset.AtlasTexture, typeof(Texture2D), false) as Texture2D;
                if (GUILayout.Button("Edit Tileset..."))
                {
                    AutoTilesetEditorWindow.ShowDialog(MyAutoTileMap.Tileset);
                }
            }
            else
            {
                MyAutoTileMap.Tileset = (AutoTileset)EditorGUILayout.ObjectField("Tileset", MyAutoTileMap.Tileset, typeof(AutoTileset), false);
            }

            if (MyAutoTileMap.Tileset == null)
            {
                if (GUILayout.Button("Create..."))
                {
                    MyAutoTileMap.Tileset = RpgMapMakerEditor.CreateTileset();
                }
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            MyAutoTileMap.MapData = (AutoTileMapData)EditorGUILayout.ObjectField("Map Data", MyAutoTileMap.MapData, typeof(AutoTileMapData), false);
            if (MyAutoTileMap.MapData == null && GUILayout.Button("Create..."))
            {
                MyAutoTileMap.MapData = RpgMapMakerEditor.CreateAutoTileMapData();
            }
            EditorGUILayout.EndHorizontal();

            if (MyAutoTileMap.Tileset != null && MyAutoTileMap.MapData != null && MyAutoTileMap.IsInitialized)
            {
                string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));

                s_tabType = (eTabType)GUILayout.Toolbar((int)s_tabType, toolBarButtonNames);
                switch (s_tabType)
                {
                case eTabType.Settings: DrawSettingsTab(); break;

                case eTabType.Paint: DrawPaintTab(); break;

                case eTabType.Data: DrawDataTab(); break;
                }
            }
            else if (!MyAutoTileMap.IsInitialized)
            {
                MyAutoTileMap.LoadMap();
            }
            else
            {
                EditorGUILayout.HelpBox("You need to select or create a Tileset and a Map Data asset", MessageType.Info);
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(MyAutoTileMap);
                if (MyAutoTileMap.Tileset != null)
                {
                    EditorUtility.SetDirty(MyAutoTileMap.Tileset);
                }
                if (MyAutoTileMap.MapData != null)
                {
                    EditorUtility.SetDirty(MyAutoTileMap.MapData);
                }
            }

            // Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
            serializedObject.ApplyModifiedProperties();
        }
		public override void OnInspectorGUI()
		{
			// Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
			serializedObject.Update();

			EditorGUILayout.BeginHorizontal();
			if( MyAutoTileMap.Tileset != null && MyAutoTileMap.Tileset.AtlasTexture == null )
			{
				MyAutoTileMap.Tileset.AtlasTexture = EditorGUILayout.ObjectField ("Tileset Atlas", MyAutoTileMap.Tileset.AtlasTexture, typeof(Texture2D), false) as Texture2D;
				if (GUILayout.Button("Edit Tileset..."))
				{
					AutoTilesetEditorWindow.ShowDialog( MyAutoTileMap.Tileset );
				}
			}
			else
			{
				MyAutoTileMap.Tileset = (AutoTileset)EditorGUILayout.ObjectField("Tileset", MyAutoTileMap.Tileset, typeof(AutoTileset), false);
			}

			if( MyAutoTileMap.Tileset == null )
			{
				if( GUILayout.Button("Create...") )
				{
					MyAutoTileMap.Tileset = RpgMapMakerEditor.CreateTileset();
				}
			}
			EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
			MyAutoTileMap.MapData = (AutoTileMapData)EditorGUILayout.ObjectField("Map Data", MyAutoTileMap.MapData, typeof(AutoTileMapData), false);
			if( MyAutoTileMap.MapData == null && GUILayout.Button("Create...") )
			{
				MyAutoTileMap.MapData = RpgMapMakerEditor.CreateAutoTileMapData();
			}
			EditorGUILayout.EndHorizontal();

			if( MyAutoTileMap.Tileset != null && MyAutoTileMap.MapData != null && MyAutoTileMap.IsInitialized )
			{
                string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));

                m_tabType = (eTabType)GUILayout.Toolbar((int)m_tabType, toolBarButtonNames);
                switch (m_tabType)
                {
                    case eTabType.Settings: DrawSettingsTab(); break;
                    case eTabType.Paint: DrawPaintTab(); break;
                    case eTabType.Data: DrawDataTab(); break;
                }								
			}
            else if (!MyAutoTileMap.IsInitialized)
            {
                MyAutoTileMap.LoadMap();
            }
            else
            {
                EditorGUILayout.HelpBox("You need to select or create a Tileset and a Map Data asset", MessageType.Info);
            }

			if( GUI.changed )
			{
				EditorUtility.SetDirty( MyAutoTileMap );
				if( MyAutoTileMap.Tileset != null )
					EditorUtility.SetDirty( MyAutoTileMap.Tileset );
				if( MyAutoTileMap.MapData != null )
					EditorUtility.SetDirty( MyAutoTileMap.MapData );
			}

			// Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
			serializedObject.ApplyModifiedProperties();
		}	
    public override void OnInspectorGUI()
    {
        // Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
        serializedObject.Update();
        yAxisSO.Update();
        if (!nullYaxis2)
        {
            yAxis2SO.Update();
        }
        xAxisSO.Update();

        if (!nullYaxis2 && graph.axesType == WMG_Axis_Graph.axesTypes.DUAL_Y)
        {
            string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabType));

            m_tabType = (eTabType)GUILayout.Toolbar((int)m_tabType, toolBarButtonNames);

            switch (m_tabType)
            {
            case eTabType.Core: DrawCore(); break;

            case eTabType.YAxis: DrawYAxis(); break;

            case eTabType.YAxis2: DrawYAxis2(); break;

            case eTabType.XAxis: DrawXAxis(); break;

            case eTabType.Tooltip: DrawTooltip(); break;

            case eTabType.Anim: DrawAnim(); break;

            case eTabType.Misc: DrawMisc(); break;
            }
        }
        else
        {
            string[] toolBarButtonNames = System.Enum.GetNames(typeof(eTabTypeNullYaxis2));

            m_tabTypeNullYaxis2 = (eTabTypeNullYaxis2)GUILayout.Toolbar((int)m_tabTypeNullYaxis2, toolBarButtonNames);

            switch (m_tabTypeNullYaxis2)
            {
            case eTabTypeNullYaxis2.Core: DrawCore(); break;

            case eTabTypeNullYaxis2.YAxis: DrawYAxis(); break;

            case eTabTypeNullYaxis2.XAxis: DrawXAxis(); break;

            case eTabTypeNullYaxis2.Tooltip: DrawTooltip(); break;

            case eTabTypeNullYaxis2.Anim: DrawAnim(); break;

            case eTabTypeNullYaxis2.Misc: DrawMisc(); break;
            }
        }

        // In editor mode, update graphics based on graph width and height
        if (!Application.isPlaying)
        {
            UpdateSceneView();
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(graph);
            EditorUtility.SetDirty(yAxisSO.targetObject);
            if (!nullYaxis2)
            {
                EditorUtility.SetDirty(yAxis2SO.targetObject);
            }
            EditorUtility.SetDirty(xAxisSO.targetObject);

            if (!Application.isPlaying)
            {
                if (previousOrientationType != graph.orientationType)
                {
                    graph.UpdateOrientation();
                }
            }
        }
        previousOrientationType = graph.orientationType;

        // Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
        serializedObject.ApplyModifiedProperties();
        yAxisSO.ApplyModifiedProperties();
        if (!nullYaxis2)
        {
            yAxis2SO.ApplyModifiedProperties();
        }
        xAxisSO.ApplyModifiedProperties();
    }
Пример #9
0
        private void createNewTab(eTabType type)
        {
            switch (type)
            {
            case eTabType.MAIN_TAB:
                break;

            case eTabType.CUSTOMER_TAB:
            {
                //Hieu
                //Edit
                var newTab = isExitTabPage("Danh sách khách hàng");
                if (newTab == null)
                {
                    newTab = new TabPage("Danh sách khách hàng");
                    var customerList = new CustomerList();
                    customerList.Dock = DockStyle.Fill;
                    newTab.Controls.Add(customerList);

                    tabControl.TabPages.Add(newTab);
                }

                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.VENDOR_TAB:
            {
                var newTab = isExitTabPage("Danh sách nhà cung cấp");
                if (newTab == null)
                {
                    newTab = new TabPage("Danh sách nhà cung cấp");
                    var vendorList = new VendorList();
                    vendorList.Dock = DockStyle.Fill;
                    newTab.Controls.Add(vendorList);

                    tabControl.TabPages.Add(newTab);
                }

                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.ORDER_TAB:
            {
                var customerOrder = new CreateCustomerOrderForm();
                var result        = customerOrder.ShowDialog();
                if (result == DialogResult.OK)
                {
                    var newTab = isExitTabPage("Giao dịch");
                    if (newTab == null)
                    {
                        newTab            = new TabPage("Giao dịch");
                        newTab.AutoScroll = true;
                        var order = new OrderDetailForm(customerOrder.OrderId);
                        order.Dock = DockStyle.Top;
                        newTab.Controls.Add(order);

                        tabControl.TabPages.Add(newTab);
                    }

                    tabControl.SelectedTab = newTab;
                }
                else if (result == DialogResult.Retry)
                {
                    createNewTab(eTabType.CUSTOMER_TAB);
                }

                break;
            }

            case eTabType.CUSTOMER_ORDER_LIST_TAB:
            {
                var selectForm = new SelectOrderForm();
                var result     = selectForm.ShowDialog();

                if (result == DialogResult.OK)
                {
                    var text   = "Đơn hàng " + selectForm.OrderKey;
                    var newTab = isExitTabPage(text);

                    if (newTab == null)
                    {
                        newTab            = new TabPage(text);
                        newTab.AutoScroll = true;
                        var order = new CustomerOrderDetail(selectForm.OrderId);
                        order.Dock = DockStyle.Fill;
                        newTab.Controls.Add(order);

                        tabControl.TabPages.Add(newTab);
                    }

                    tabControl.SelectedTab = newTab;
                }

                break;
            }

            case eTabType.STORE_TAB:
            {
                var text   = "Danh sách kho hàng";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var store = new InventoryList();
                    store.Dock = DockStyle.Fill;
                    newTab.Controls.Add(store);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.PRODUCT_TAB:
            {
                var text   = "Danh sách mặt hàng";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var product = new ProductList();
                    product.Dock = DockStyle.Fill;
                    newTab.Controls.Add(product);
                    this.newProductMenuItem.Click += product.showDialogAddProduct;         //7ung
                    tabControl.TabPages.Add(newTab);
                }

                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.STAFF_TAB:
            {
                var text   = "Danh sách nhân viên";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var staff = new StaffList();
                    staff.Dock = DockStyle.Fill;
                    newTab.Controls.Add(staff);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.INOUT_INVENTORY:
            {
                var text   = "Quản lý đơn hàng nhập xuất kho";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var store = new InOutInventoryList();
                    store.Dock = DockStyle.Fill;
                    newTab.Controls.Add(store);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.INVENTORY_LIST:
            {
                var text   = "Quản lý kho hàng";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var store = new InventoryList();
                    store.Dock = DockStyle.Fill;
                    newTab.Controls.Add(store);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.VENDOR_ORDER_TAB:
            {
                var vendorOrder = new CreateVendorOrderForm();
                var result      = vendorOrder.ShowDialog();
                if (result == DialogResult.OK)
                {
                    var text   = "Giao dịch đơn hàng " + vendorOrder.DocumentKey;
                    var newTab = isExitTabPage(text);

                    if (newTab == null)
                    {
                        newTab            = new TabPage(text);
                        newTab.AutoScroll = true;
                        var order = new VendorOrderDetailForm(vendorOrder.OrderId);
                        order.Dock = DockStyle.Top;
                        newTab.Controls.Add(order);

                        tabControl.TabPages.Add(newTab);
                    }
                    tabControl.SelectedTab = newTab;
                }
                else if (result == DialogResult.Retry)
                {
                    createNewTab(eTabType.VENDOR_TAB);
                }
                break;
            }

            case eTabType.VENDOR_ORDER_LIST_TAB:
            {
                var selectForm = new SelectVendorOrderForm();
                var result     = selectForm.ShowDialog();

                if (result == DialogResult.OK)
                {
                    var text   = "Đơn hàng " + selectForm.DocumentKey;
                    var newTab = isExitTabPage(text);

                    if (newTab == null)
                    {
                        newTab            = new TabPage(text);
                        newTab.AutoScroll = true;
                        var order = new VendorOrderDetail(selectForm.OrderId);
                        order.DocumentKey = selectForm.DocumentKey;
                        order.Dock        = DockStyle.Fill;
                        newTab.Controls.Add(order);

                        tabControl.TabPages.Add(newTab);
                    }
                    tabControl.SelectedTab = newTab;
                }
                break;
            }

            case eTabType.REVENUE_REPORT_TAB:
            {
                var text   = "Báo cáo doanh thu";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var report = new RevenueReport();
                    report.Dock = DockStyle.Fill;
                    newTab.Controls.Add(report);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.CUSTOMER_REPORT_TAB:
            {
                var text   = "Báo cáo tình hình khách hàng";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var report = new CustomerReport();
                    report.Dock = DockStyle.Top;
                    newTab.Controls.Add(report);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.CREATE_BUSINESS_REPORT_TAB:
            {
                var dialogCreate = new CreateReportForm();
                var r            = dialogCreate.ShowDialog();

                if (r == DialogResult.OK)
                {
                    var text   = "Báo cáo chi phí bán hàng";
                    var newTab = isExitTabPage(text);

                    if (newTab == null)
                    {
                        newTab            = new TabPage(text);
                        newTab.AutoScroll = true;
                        var report = new CreateBusinessFee(dialogCreate.DocumentId, true);
                        report.Dock = DockStyle.Top;
                        newTab.Controls.Add(report);

                        tabControl.TabPages.Add(newTab);
                    }
                    tabControl.SelectedTab = newTab;
                }
                break;
            }

            case eTabType.VIEW_BUSINESS_REPORT_TAB:
            {
                var text   = "Xem cáo chi phí bán hàng";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var report = new ViewBusinessFee();
                    report.Dock = DockStyle.Top;
                    newTab.Controls.Add(report);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            case eTabType.INVENTORY_REPORT_TAB:
            {
                var text   = "Báo cáo tồn kho";
                var newTab = isExitTabPage(text);

                if (newTab == null)
                {
                    newTab            = new TabPage(text);
                    newTab.AutoScroll = true;
                    var report = new InventoryReport();
                    report.Dock = DockStyle.Fill;
                    newTab.Controls.Add(report);

                    tabControl.TabPages.Add(newTab);
                }
                tabControl.SelectedTab = newTab;
                break;
            }

            default:
                break;
            }
        }