.. | .. |
---|
72 | 72 | } |
---|
73 | 73 | } |
---|
74 | 74 | |
---|
| 75 | + public Composite CreateCameras() |
---|
| 76 | + { |
---|
| 77 | + Composite cams = new cTemplate(); |
---|
| 78 | + cams.name = "Cameras"; |
---|
| 79 | + copy.insertElementAt(cams, 0); |
---|
| 80 | + |
---|
| 81 | + cams.addChild(new Camera()); |
---|
| 82 | + cams.addChild(new Camera(1)); |
---|
| 83 | + cams.addChild(new Camera(2)); |
---|
| 84 | + cams.addChild(new Camera(3)); |
---|
| 85 | + cams.addChild(new Camera(4)); |
---|
| 86 | + |
---|
| 87 | + return cams; |
---|
| 88 | + } |
---|
| 89 | + |
---|
75 | 90 | public cGridBag GetSeparator() |
---|
76 | 91 | { |
---|
77 | 92 | cGridBag separator = new cGridBag(); |
---|
.. | .. |
---|
83 | 98 | cButton GetButton(String name, boolean border) |
---|
84 | 99 | { |
---|
85 | 100 | ImageIcon icon = GetIcon(name); |
---|
86 | | - if (icon != null) |
---|
| 101 | + if (icon != null || name.contains("/")) |
---|
87 | 102 | return new cButton(icon, border); |
---|
88 | 103 | else |
---|
89 | 104 | return new cButton(name, border); |
---|
.. | .. |
---|
119 | 134 | |
---|
120 | 135 | try |
---|
121 | 136 | { |
---|
122 | | - BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
123 | | - |
---|
| 137 | + BufferedImage image; |
---|
| 138 | + |
---|
| 139 | + if (name.endsWith("jpg")) |
---|
| 140 | + // Much faster! |
---|
| 141 | + image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage(); |
---|
| 142 | + else |
---|
| 143 | + image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
| 144 | + |
---|
124 | 145 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
125 | 146 | // { |
---|
126 | 147 | // BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
.. | .. |
---|
295 | 316 | objEditor.ctrlPanel.remove(setupPanel2); |
---|
296 | 317 | objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
297 | 318 | objEditor.ctrlPanel.remove(pushPanel); |
---|
| 319 | + if (versionPanel != null) |
---|
| 320 | + objEditor.ctrlPanel.remove(versionPanel); |
---|
298 | 321 | //objEditor.ctrlPanel.remove(fillPanel); |
---|
299 | 322 | |
---|
300 | 323 | //Remove(normalpushField); |
---|
.. | .. |
---|
362 | 385 | client = inClient; |
---|
363 | 386 | copy = client; |
---|
364 | 387 | |
---|
365 | | - if (copy.versionlist == null) |
---|
366 | | - { |
---|
367 | | - copy.versionlist = new Object3D[100]; |
---|
368 | | - copy.versionindex = -1; |
---|
369 | | - |
---|
370 | | -// Save(true); |
---|
371 | | - } |
---|
372 | | - |
---|
373 | 388 | SetupUI2(callee.GetEditor()); |
---|
374 | 389 | } |
---|
375 | 390 | |
---|
.. | .. |
---|
445 | 460 | importOBJItem.addActionListener(this); |
---|
446 | 461 | import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
447 | 462 | import3DSItem.addActionListener(this); |
---|
| 463 | + if (Globals.ADVANCED) |
---|
| 464 | + { |
---|
448 | 465 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | 466 | importVRMLX3DItem.addActionListener(this); |
---|
| 467 | + } |
---|
450 | 468 | menu.add("-"); |
---|
451 | 469 | importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
452 | 470 | importGFDItem.addActionListener(this); |
---|
.. | .. |
---|
1147 | 1165 | cGridBag setupPanel2; |
---|
1148 | 1166 | cGridBag objectCommandsPanel; |
---|
1149 | 1167 | cGridBag pushPanel; |
---|
| 1168 | + cGridBag versionPanel; |
---|
1150 | 1169 | cGridBag fillPanel; |
---|
1151 | 1170 | |
---|
1152 | 1171 | JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
.. | .. |
---|
1318 | 1337 | |
---|
1319 | 1338 | //if (copy.pinned) |
---|
1320 | 1339 | { |
---|
1321 | | - pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1340 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
1322 | 1341 | pinButton.setSelected(copy.pinned); |
---|
1323 | 1342 | cGridBag t = new cGridBag(); |
---|
1324 | 1343 | t.preferredWidth = 2; |
---|
.. | .. |
---|
1393 | 1412 | oe.ctrlPanel.add(objectCommandsPanel); |
---|
1394 | 1413 | oe.ctrlPanel.Return(); |
---|
1395 | 1414 | |
---|
1396 | | - pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1415 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH * 100, 1.1); // To have the buttons |
---|
1397 | 1416 | normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
1398 | | - //Return(); |
---|
| 1417 | + if (false && copy.versionlist != null && copy.versionindex != -1) |
---|
| 1418 | + { |
---|
| 1419 | + oe.ctrlPanel.Return(); |
---|
| 1420 | + versionPanel = AddSlider(oe.ctrlPanel, "Version", 0, copy.VersionCount() - 1, copy.versionindex); |
---|
| 1421 | + versionField = (cNumberSlider)versionPanel.getComponent(1); |
---|
| 1422 | + } |
---|
1399 | 1423 | |
---|
1400 | 1424 | oe.ctrlPanel.Return(); |
---|
1401 | 1425 | |
---|
.. | .. |
---|
1550 | 1574 | |
---|
1551 | 1575 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1552 | 1576 | { |
---|
1553 | | - if (Globals.DEBUG) |
---|
1554 | | - System.out.println("CREATE CAMERAS"); |
---|
1555 | | - cams = new cTemplate(); |
---|
1556 | | - cams.name = "Cameras"; |
---|
1557 | | - copy.insertElementAt(cams, 0); |
---|
1558 | | - //cams.parent = copy; |
---|
1559 | | - |
---|
1560 | | - cam = new Camera(); // LA.newVector(3, 2, 1)); |
---|
1561 | | - cams.addChild(cam); |
---|
1562 | | - cam = new Camera(1); |
---|
1563 | | - cams.addChild(cam); |
---|
1564 | | - cam = new Camera(2); |
---|
1565 | | - cams.addChild(cam); |
---|
1566 | | - cam = new Camera(3); |
---|
1567 | | - cams.addChild(cam); |
---|
1568 | | - cam = new Camera(4); // Light |
---|
1569 | | - cams.addChild(cam); |
---|
| 1577 | + if (Globals.DEBUG) |
---|
| 1578 | + System.out.println("CREATE CAMERAS"); |
---|
| 1579 | + cams = CreateCameras(); |
---|
1570 | 1580 | } else |
---|
1571 | 1581 | { |
---|
1572 | 1582 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1638 | 1648 | |
---|
1639 | 1649 | resetTransformPanel.preferredHeight = 2; |
---|
1640 | 1650 | |
---|
1641 | | - cButton resetTransform = GetButton("Reset all", !Grafreed.NIMBUSLAF); |
---|
| 1651 | + cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF); |
---|
| 1652 | + resetTransform.setToolTipText("Reset Translation, Rotation and Scale"); |
---|
1642 | 1653 | resetTransform.addMouseListener(new MouseAdapter() |
---|
1643 | 1654 | { |
---|
1644 | 1655 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1648 | 1659 | }); |
---|
1649 | 1660 | resetTransformPanel.add(resetTransform); |
---|
1650 | 1661 | |
---|
1651 | | - resetTransform = GetButton("T only", !Grafreed.NIMBUSLAF); |
---|
| 1662 | + resetTransform = GetButton("T only", !Globals.NIMBUSLAF); |
---|
| 1663 | + resetTransform.setToolTipText("Reset Translation only"); |
---|
1652 | 1664 | resetTransform.addMouseListener(new MouseAdapter() |
---|
1653 | 1665 | { |
---|
1654 | 1666 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1658 | 1670 | }); |
---|
1659 | 1671 | resetTransformPanel.add(resetTransform); |
---|
1660 | 1672 | |
---|
1661 | | - resetTransform = GetButton("RS only", !Grafreed.NIMBUSLAF); |
---|
| 1673 | + resetTransform = GetButton("RS only", !Globals.NIMBUSLAF); |
---|
| 1674 | + resetTransform.setToolTipText("Reset Rotation and Scale only"); |
---|
1662 | 1675 | resetTransform.addMouseListener(new MouseAdapter() |
---|
1663 | 1676 | { |
---|
1664 | 1677 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1715 | 1728 | |
---|
1716 | 1729 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1717 | 1730 | //tmp.setName("Edit"); |
---|
| 1731 | + objectPanel.add(skyboxPanel); |
---|
| 1732 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1733 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1734 | + |
---|
1718 | 1735 | objectPanel.add(toolboxPanel); |
---|
1719 | | - objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
1720 | | - objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1736 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1737 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1721 | 1738 | |
---|
1722 | 1739 | objectPanel.add(materialPanel); |
---|
1723 | | - objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
1724 | | - objectPanel.setToolTipTextAt(1, "Material"); |
---|
| 1740 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1741 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
1725 | 1742 | |
---|
1726 | | - objectPanel.add(skyboxPanel); |
---|
1727 | | - objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
1728 | | - objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
1729 | | - |
---|
1730 | 1743 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1731 | 1744 | // north.setName("Edit"); |
---|
1732 | 1745 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1733 | 1746 | // objectPanel.add(north); |
---|
1734 | 1747 | objectPanel.add(editPanel); |
---|
1735 | | - objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1748 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
1736 | 1749 | objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1737 | 1750 | |
---|
1738 | 1751 | objectPanel.add(transformPanel); |
---|
.. | .. |
---|
1741 | 1754 | |
---|
1742 | 1755 | patchMaterial = true; |
---|
1743 | 1756 | cameraView.patchMaterial = this; |
---|
1744 | | - objectPanel.setSelectedIndex(1); |
---|
| 1757 | + objectPanel.setSelectedIndex(2); |
---|
1745 | 1758 | |
---|
1746 | 1759 | /* |
---|
1747 | 1760 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1762 | 1775 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1763 | 1776 | |
---|
1764 | 1777 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1765 | | - scenePanel.preferredWidth = 6; |
---|
| 1778 | + scenePanel.preferredWidth = 5; |
---|
1766 | 1779 | |
---|
1767 | 1780 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1768 | 1781 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1773 | 1786 | |
---|
1774 | 1787 | AddOptions(optionsPanel); //, aConstraints); |
---|
1775 | 1788 | |
---|
1776 | | - tabbedPane.add(optionsPanel); |
---|
1777 | | - |
---|
1778 | 1789 | tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1779 | 1790 | |
---|
| 1791 | + tabbedPane.add(optionsPanel); |
---|
| 1792 | + |
---|
1780 | 1793 | scenePanel.add(tabbedPane); |
---|
1781 | 1794 | |
---|
1782 | | - //if (Globals.ADVANCED) |
---|
1783 | | -// tabbedPane.add(infoPanel); |
---|
1784 | | -// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
1785 | | -// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1795 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1796 | + creditsPanel.setName("Credits"); |
---|
1786 | 1797 | |
---|
| 1798 | + cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1799 | + creditsPanel.add(ogaLabel); |
---|
| 1800 | + |
---|
| 1801 | + cButton creditButton; |
---|
| 1802 | + creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1803 | + creditButton.setToolTipText("https://opengameart.org"); |
---|
| 1804 | + |
---|
| 1805 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1806 | + { |
---|
| 1807 | + public void mouseClicked(MouseEvent e) |
---|
| 1808 | + { |
---|
| 1809 | + try |
---|
| 1810 | + { |
---|
| 1811 | + Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/")); |
---|
| 1812 | + } catch (Exception e1) |
---|
| 1813 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1814 | + { |
---|
| 1815 | + e1.printStackTrace(); |
---|
| 1816 | + } |
---|
| 1817 | + } |
---|
| 1818 | + }); |
---|
| 1819 | + |
---|
| 1820 | + ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF); |
---|
| 1821 | + creditsPanel.add(ogaLabel); |
---|
| 1822 | + |
---|
| 1823 | + creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF)); |
---|
| 1824 | + creditButton.setToolTipText("https://3delicious.net"); |
---|
| 1825 | + |
---|
| 1826 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1827 | + { |
---|
| 1828 | + public void mouseClicked(MouseEvent e) |
---|
| 1829 | + { |
---|
| 1830 | + try |
---|
| 1831 | + { |
---|
| 1832 | + Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net")); |
---|
| 1833 | + } catch (Exception e1) |
---|
| 1834 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1835 | + { |
---|
| 1836 | + e1.printStackTrace(); |
---|
| 1837 | + } |
---|
| 1838 | + } |
---|
| 1839 | + }); |
---|
| 1840 | + |
---|
| 1841 | + creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF)); |
---|
| 1842 | + creditButton.setToolTipText("https://archive3d.net"); |
---|
| 1843 | + |
---|
| 1844 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1845 | + { |
---|
| 1846 | + public void mouseClicked(MouseEvent e) |
---|
| 1847 | + { |
---|
| 1848 | + try |
---|
| 1849 | + { |
---|
| 1850 | + Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net")); |
---|
| 1851 | + } catch (Exception e1) |
---|
| 1852 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1853 | + { |
---|
| 1854 | + e1.printStackTrace(); |
---|
| 1855 | + } |
---|
| 1856 | + } |
---|
| 1857 | + }); |
---|
| 1858 | + |
---|
| 1859 | + creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF)); |
---|
| 1860 | + creditButton.setToolTipText("https://turbosquid.com"); |
---|
| 1861 | + |
---|
| 1862 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1863 | + { |
---|
| 1864 | + public void mouseClicked(MouseEvent e) |
---|
| 1865 | + { |
---|
| 1866 | + try |
---|
| 1867 | + { |
---|
| 1868 | + Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free")); |
---|
| 1869 | + } catch (Exception e1) |
---|
| 1870 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1871 | + { |
---|
| 1872 | + e1.printStackTrace(); |
---|
| 1873 | + } |
---|
| 1874 | + } |
---|
| 1875 | + }); |
---|
| 1876 | + |
---|
| 1877 | + for (int i=6; --i>=0;) |
---|
| 1878 | + { |
---|
| 1879 | + creditsPanel.add(new cGridBag()); |
---|
| 1880 | + } |
---|
| 1881 | + |
---|
| 1882 | + tabbedPane.add(creditsPanel); |
---|
| 1883 | + tabbedPane.setToolTipTextAt(3, "Credits"); |
---|
| 1884 | + |
---|
| 1885 | + if (Globals.ADVANCED) |
---|
| 1886 | + { |
---|
| 1887 | + objectPanel.add(infoPanel); |
---|
| 1888 | + objectPanel.setIconAt(5, GetIcon("icons/info.png")); |
---|
| 1889 | + objectPanel.setToolTipTextAt(4, "Information"); |
---|
| 1890 | + } |
---|
| 1891 | + |
---|
1787 | 1892 | /* |
---|
1788 | 1893 | cTree jTree = new cTree(null); |
---|
1789 | 1894 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1929 | 2034 | { |
---|
1930 | 2035 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1931 | 2036 | |
---|
1932 | | - cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 2037 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
1933 | 2038 | skin.setToolTipText("Skin"); |
---|
1934 | 2039 | skin.addMouseListener(new MouseAdapter() |
---|
1935 | 2040 | { |
---|
.. | .. |
---|
1967 | 2072 | }); |
---|
1968 | 2073 | presetpanel.add(skin); |
---|
1969 | 2074 | |
---|
1970 | | - cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 2075 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
1971 | 2076 | lambert.setToolTipText("Diffuse"); |
---|
1972 | 2077 | lambert.addMouseListener(new MouseAdapter() |
---|
1973 | 2078 | { |
---|
.. | .. |
---|
1985 | 2090 | }); |
---|
1986 | 2091 | presetpanel.add(lambert); |
---|
1987 | 2092 | |
---|
1988 | | - cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 2093 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
1989 | 2094 | diffuse2.setToolTipText("Diffuse2"); |
---|
1990 | 2095 | diffuse2.addMouseListener(new MouseAdapter() |
---|
1991 | 2096 | { |
---|
.. | .. |
---|
2003 | 2108 | }); |
---|
2004 | 2109 | presetpanel.add(diffuse2); |
---|
2005 | 2110 | |
---|
2006 | | - cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 2111 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
2007 | 2112 | diffusemoon.setToolTipText("Moon"); |
---|
2008 | 2113 | diffusemoon.addMouseListener(new MouseAdapter() |
---|
2009 | 2114 | { |
---|
.. | .. |
---|
2021 | 2126 | }); |
---|
2022 | 2127 | presetpanel.add(diffusemoon); |
---|
2023 | 2128 | |
---|
2024 | | - cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 2129 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
2025 | 2130 | diffusemoon2.setToolTipText("Moon2"); |
---|
2026 | 2131 | diffusemoon2.addMouseListener(new MouseAdapter() |
---|
2027 | 2132 | { |
---|
.. | .. |
---|
2039 | 2144 | }); |
---|
2040 | 2145 | presetpanel.add(diffusemoon2); |
---|
2041 | 2146 | |
---|
2042 | | - cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 2147 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
2043 | 2148 | diffusemoon3.setToolTipText("Moon3"); |
---|
2044 | 2149 | diffusemoon3.addMouseListener(new MouseAdapter() |
---|
2045 | 2150 | { |
---|
.. | .. |
---|
2057 | 2162 | }); |
---|
2058 | 2163 | presetpanel.add(diffusemoon3); |
---|
2059 | 2164 | |
---|
2060 | | - cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2165 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
2061 | 2166 | diffusesheen.setToolTipText("Sheen"); |
---|
2062 | 2167 | diffusesheen.addMouseListener(new MouseAdapter() |
---|
2063 | 2168 | { |
---|
.. | .. |
---|
2074 | 2179 | }); |
---|
2075 | 2180 | presetpanel.add(diffusesheen); |
---|
2076 | 2181 | |
---|
2077 | | - cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2182 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
2078 | 2183 | rough.setToolTipText("Rough metal"); |
---|
2079 | 2184 | rough.addMouseListener(new MouseAdapter() |
---|
2080 | 2185 | { |
---|
.. | .. |
---|
2092 | 2197 | }); |
---|
2093 | 2198 | presetpanel.add(rough); |
---|
2094 | 2199 | |
---|
2095 | | - cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2200 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
2096 | 2201 | rough2.setToolTipText("Medium metal"); |
---|
2097 | 2202 | rough2.addMouseListener(new MouseAdapter() |
---|
2098 | 2203 | { |
---|
.. | .. |
---|
2110 | 2215 | }); |
---|
2111 | 2216 | presetpanel.add(rough2); |
---|
2112 | 2217 | |
---|
2113 | | - cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2218 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
2114 | 2219 | shini0.setToolTipText("Shiny"); |
---|
2115 | 2220 | shini0.addMouseListener(new MouseAdapter() |
---|
2116 | 2221 | { |
---|
.. | .. |
---|
2128 | 2233 | }); |
---|
2129 | 2234 | presetpanel.add(shini0); |
---|
2130 | 2235 | |
---|
2131 | | - cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2236 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
2132 | 2237 | shini1.setToolTipText("Shiny2"); |
---|
2133 | 2238 | shini1.addMouseListener(new MouseAdapter() |
---|
2134 | 2239 | { |
---|
.. | .. |
---|
2146 | 2251 | }); |
---|
2147 | 2252 | presetpanel.add(shini1); |
---|
2148 | 2253 | |
---|
2149 | | - cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2254 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
2150 | 2255 | shini2.setToolTipText("Shiny3"); |
---|
2151 | 2256 | shini2.addMouseListener(new MouseAdapter() |
---|
2152 | 2257 | { |
---|
.. | .. |
---|
2164 | 2269 | }); |
---|
2165 | 2270 | presetpanel.add(shini2); |
---|
2166 | 2271 | |
---|
2167 | | - cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2272 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
2168 | 2273 | aniso.setToolTipText("AnisoU"); |
---|
2169 | 2274 | aniso.addMouseListener(new MouseAdapter() |
---|
2170 | 2275 | { |
---|
.. | .. |
---|
2182 | 2287 | }); |
---|
2183 | 2288 | presetpanel.add(aniso); |
---|
2184 | 2289 | |
---|
2185 | | - cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2290 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
2186 | 2291 | aniso2.setToolTipText("AnisoV"); |
---|
2187 | 2292 | aniso2.addMouseListener(new MouseAdapter() |
---|
2188 | 2293 | { |
---|
.. | .. |
---|
2200 | 2305 | }); |
---|
2201 | 2306 | presetpanel.add(aniso2); |
---|
2202 | 2307 | |
---|
2203 | | - cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2308 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
2204 | 2309 | aniso3.setToolTipText("AnisoUV"); |
---|
2205 | 2310 | aniso3.addMouseListener(new MouseAdapter() |
---|
2206 | 2311 | { |
---|
.. | .. |
---|
2218 | 2323 | }); |
---|
2219 | 2324 | presetpanel.add(aniso3); |
---|
2220 | 2325 | |
---|
2221 | | - cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2326 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
2222 | 2327 | velvet0.setToolTipText("Velvet"); |
---|
2223 | 2328 | velvet0.addMouseListener(new MouseAdapter() |
---|
2224 | 2329 | { |
---|
.. | .. |
---|
2240 | 2345 | }); |
---|
2241 | 2346 | presetpanel.add(velvet0); |
---|
2242 | 2347 | |
---|
2243 | | - cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2348 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
2244 | 2349 | bump0.setToolTipText("Bump texture"); |
---|
2245 | 2350 | bump0.addMouseListener(new MouseAdapter() |
---|
2246 | 2351 | { |
---|
.. | .. |
---|
2259 | 2364 | }); |
---|
2260 | 2365 | presetpanel.add(bump0); |
---|
2261 | 2366 | |
---|
2262 | | - cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2367 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF); |
---|
2263 | 2368 | borderShader.setToolTipText("Border fade"); |
---|
2264 | 2369 | borderShader.addMouseListener(new MouseAdapter() |
---|
2265 | 2370 | { |
---|
2266 | 2371 | public void mouseClicked(MouseEvent e) |
---|
2267 | 2372 | { |
---|
2268 | | - borderfadeField.setFloat(0.5); |
---|
| 2373 | + borderfadeField.setFloat(0.4); |
---|
2269 | 2374 | opacityField.setFloat(0.75); |
---|
2270 | 2375 | |
---|
2271 | 2376 | materialtouched = true; |
---|
.. | .. |
---|
2274 | 2379 | }); |
---|
2275 | 2380 | presetpanel.add(borderShader); |
---|
2276 | 2381 | |
---|
2277 | | - cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2382 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF); |
---|
2278 | 2383 | halo.setToolTipText("Halo"); |
---|
2279 | 2384 | halo.addMouseListener(new MouseAdapter() |
---|
2280 | 2385 | { |
---|
.. | .. |
---|
2291 | 2396 | }); |
---|
2292 | 2397 | presetpanel.add(halo); |
---|
2293 | 2398 | |
---|
2294 | | - cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2399 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
2295 | 2400 | candle.setToolTipText("Candle"); |
---|
2296 | 2401 | candle.addMouseListener(new MouseAdapter() |
---|
2297 | 2402 | { |
---|
.. | .. |
---|
2313 | 2418 | }); |
---|
2314 | 2419 | presetpanel.add(candle); |
---|
2315 | 2420 | |
---|
2316 | | - cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2421 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
2317 | 2422 | shadowShader.setToolTipText("Shadow"); |
---|
2318 | 2423 | shadowShader.addMouseListener(new MouseAdapter() |
---|
2319 | 2424 | { |
---|
.. | .. |
---|
2324 | 2429 | cameraField.setFloat(0.001); |
---|
2325 | 2430 | specularField.setFloat(0.001); |
---|
2326 | 2431 | fakedepthField.setFloat(0.001); |
---|
2327 | | - opacityField.setFloat(0.6); |
---|
| 2432 | + opacityField.setFloat(0.4); |
---|
2328 | 2433 | |
---|
2329 | 2434 | materialtouched = true; |
---|
2330 | 2435 | applySelf(); |
---|
2331 | 2436 | } |
---|
2332 | 2437 | }); |
---|
2333 | 2438 | presetpanel.add(shadowShader); |
---|
| 2439 | + |
---|
| 2440 | + cLabel para0 = GetLabel("icons/shadericons/parallax0.png", !Globals.NIMBUSLAF); |
---|
| 2441 | + para0.setToolTipText("No parallax"); |
---|
| 2442 | + para0.addMouseListener(new MouseAdapter() |
---|
| 2443 | + { |
---|
| 2444 | + public void mouseClicked(MouseEvent e) |
---|
| 2445 | + { |
---|
| 2446 | + parallaxField.setFloat(0.125); |
---|
| 2447 | + |
---|
| 2448 | + materialtouched = true; |
---|
| 2449 | + applySelf(); |
---|
| 2450 | + } |
---|
| 2451 | + }); |
---|
| 2452 | + presetpanel.add(para0); |
---|
| 2453 | + |
---|
| 2454 | + cLabel para1 = GetLabel("icons/shadericons/parallax1.png", !Globals.NIMBUSLAF); |
---|
| 2455 | + para1.setToolTipText("With parallax"); |
---|
| 2456 | + para1.addMouseListener(new MouseAdapter() |
---|
| 2457 | + { |
---|
| 2458 | + public void mouseClicked(MouseEvent e) |
---|
| 2459 | + { |
---|
| 2460 | + parallaxField.setFloat(0.13); |
---|
| 2461 | + |
---|
| 2462 | + materialtouched = true; |
---|
| 2463 | + applySelf(); |
---|
| 2464 | + } |
---|
| 2465 | + }); |
---|
| 2466 | + presetpanel.add(para1); |
---|
| 2467 | + |
---|
| 2468 | + cLabel para2 = GetLabel("icons/shadericons/parallax2.png", !Globals.NIMBUSLAF); |
---|
| 2469 | + para2.setToolTipText("Reset parallax"); |
---|
| 2470 | + para2.addMouseListener(new MouseAdapter() |
---|
| 2471 | + { |
---|
| 2472 | + public void mouseClicked(MouseEvent e) |
---|
| 2473 | + { |
---|
| 2474 | + parallaxField.setFloat(0.14); |
---|
| 2475 | + |
---|
| 2476 | + materialtouched = true; |
---|
| 2477 | + applySelf(); |
---|
| 2478 | + } |
---|
| 2479 | + }); |
---|
| 2480 | + presetpanel.add(para2); |
---|
2334 | 2481 | |
---|
2335 | 2482 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2336 | 2483 | |
---|
.. | .. |
---|
2348 | 2495 | |
---|
2349 | 2496 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
2350 | 2497 | |
---|
2351 | | - editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2498 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2352 | 2499 | createMaterialButton.setToolTipText("Create material"); |
---|
2353 | 2500 | |
---|
2354 | 2501 | /* |
---|
2355 | 2502 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
2356 | 2503 | */ |
---|
2357 | 2504 | |
---|
2358 | | - editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2505 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2359 | 2506 | clearMaterialButton.setToolTipText("Clear material"); |
---|
2360 | 2507 | |
---|
2361 | 2508 | if (Globals.ADVANCED) |
---|
2362 | 2509 | { |
---|
2363 | | - editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2510 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2364 | 2511 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
2365 | 2512 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
2366 | 2513 | } |
---|
.. | .. |
---|
2577 | 2724 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
2578 | 2725 | colorSection.add(backlit); |
---|
2579 | 2726 | |
---|
| 2727 | + cGridBag parallax = new cGridBag(); |
---|
| 2728 | + parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints); |
---|
| 2729 | + parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2730 | + parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.25, -0.125)); // , aConstraints); |
---|
| 2731 | + colorSection.add(parallax); |
---|
| 2732 | + |
---|
2580 | 2733 | //panel.add(new JSeparator()); |
---|
2581 | 2734 | |
---|
2582 | 2735 | //panel.add(globalSection); |
---|
.. | .. |
---|
3628 | 3781 | shadowField.setFloat(mat.shadow); |
---|
3629 | 3782 | textureField.setFloat(mat.texture); |
---|
3630 | 3783 | opacityField.setFloat(mat.opacity); |
---|
| 3784 | + parallaxField.setFloat(mat.parallax + 0.125f); |
---|
3631 | 3785 | fakedepthField.setFloat(mat.fakedepth); |
---|
3632 | 3786 | shadowbiasField.setFloat(mat.shadowbias); |
---|
3633 | 3787 | bumpField.setInteger(1); // dec 2013 |
---|
.. | .. |
---|
3921 | 4075 | } else if (event.getSource() == link2masterCB) |
---|
3922 | 4076 | { |
---|
3923 | 4077 | copy.link2master ^= true; |
---|
| 4078 | + objEditor.refreshContents(); |
---|
3924 | 4079 | return; |
---|
3925 | 4080 | } |
---|
3926 | 4081 | if (event.getSource() == randomCB) |
---|
.. | .. |
---|
4161 | 4316 | |
---|
4162 | 4317 | void New() |
---|
4163 | 4318 | { |
---|
4164 | | - while (copy.Size() > 1) |
---|
| 4319 | + while (copy.Size() > 0) |
---|
4165 | 4320 | { |
---|
4166 | | - copy.remove(1); |
---|
| 4321 | + copy.remove(0); |
---|
4167 | 4322 | } |
---|
4168 | 4323 | |
---|
| 4324 | + copy.selection.clear(); |
---|
| 4325 | + |
---|
| 4326 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4327 | + { |
---|
| 4328 | + CreateCameras(); |
---|
| 4329 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4330 | + } |
---|
4169 | 4331 | ResetModel(); |
---|
4170 | 4332 | objEditor.refreshContents(); |
---|
4171 | 4333 | } |
---|
.. | .. |
---|
4304 | 4466 | copy.versionindex -= 1; |
---|
4305 | 4467 | |
---|
4306 | 4468 | if (copy.versionindex != -1) |
---|
4307 | | - CopyChanged(); |
---|
| 4469 | + CopyChanged(copy); |
---|
4308 | 4470 | |
---|
4309 | 4471 | SetVersionStates(); |
---|
4310 | 4472 | } |
---|
.. | .. |
---|
4314 | 4476 | System.err.println("Save"); |
---|
4315 | 4477 | Replace(); |
---|
4316 | 4478 | |
---|
4317 | | - //cRadio tab = GetCurrentTab(); |
---|
| 4479 | + if (copy.versionlist == null) |
---|
| 4480 | + { |
---|
| 4481 | + copy.versionlist = new Object3D[100]; |
---|
| 4482 | + copy.versionindex = -1; |
---|
| 4483 | + } |
---|
4318 | 4484 | |
---|
4319 | 4485 | Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4320 | 4486 | |
---|
.. | .. |
---|
4382 | 4548 | { |
---|
4383 | 4549 | Object3D selection = new Object3D(); |
---|
4384 | 4550 | |
---|
4385 | | - for (int i = 0; i < copy.selection.size(); i++) |
---|
| 4551 | + for (int i = 0; i < objEditor.copy.selection.size(); i++) |
---|
4386 | 4552 | { |
---|
4387 | | - Object3D elem = copy.selection.elementAt(i); |
---|
| 4553 | + Object3D elem = objEditor.copy.selection.elementAt(i); |
---|
4388 | 4554 | |
---|
4389 | | - Object3D obj = copy.GetObject(elem.GetUUID()); |
---|
| 4555 | + Object3D obj = objEditor.copy.GetObject(elem.GetUUID()); |
---|
4390 | 4556 | |
---|
4391 | 4557 | if (obj == null) |
---|
4392 | 4558 | { |
---|
4393 | | - copy.selection.remove(i--); |
---|
| 4559 | + objEditor.copy.selection.remove(i--); |
---|
4394 | 4560 | } |
---|
4395 | 4561 | else |
---|
4396 | 4562 | { |
---|
4397 | 4563 | selection.add(obj); |
---|
4398 | | - copy.selection.setElementAt(obj, i); |
---|
| 4564 | + objEditor.copy.selection.setElementAt(obj, i); |
---|
4399 | 4565 | } |
---|
4400 | 4566 | } |
---|
4401 | 4567 | |
---|
.. | .. |
---|
4408 | 4574 | //refreshContents(false); |
---|
4409 | 4575 | } |
---|
4410 | 4576 | |
---|
4411 | | - void CopyChanged() |
---|
| 4577 | + void CopyChanged(Object3D changed) |
---|
4412 | 4578 | { |
---|
4413 | | - Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]); |
---|
4414 | | - |
---|
4415 | | - SetVersionStates(); |
---|
| 4579 | + Object3D obj = (Object3D)Grafreed.clone(changed.versionlist[copy.versionindex]); |
---|
4416 | 4580 | |
---|
4417 | 4581 | boolean temp = CameraPane.SWITCH; |
---|
4418 | 4582 | CameraPane.SWITCH = false; |
---|
4419 | 4583 | |
---|
4420 | | - copy.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4584 | + changed.ExtractBigData(Grafreed.grafreed.universe.versiontable); |
---|
4421 | 4585 | |
---|
4422 | | - copy.clear(); |
---|
| 4586 | + changed.clear(); |
---|
4423 | 4587 | |
---|
4424 | | - copy.skyboxname = obj.skyboxname; |
---|
4425 | | - copy.skyboxext = obj.skyboxext; |
---|
| 4588 | + changed.skyboxname = obj.skyboxname; |
---|
| 4589 | + changed.skyboxext = obj.skyboxext; |
---|
4426 | 4590 | |
---|
4427 | 4591 | for (int i=0; i<obj.Size(); i++) |
---|
4428 | 4592 | { |
---|
4429 | | - copy.add(obj.get(i)); |
---|
| 4593 | + changed.add(obj.get(i)); |
---|
4430 | 4594 | } |
---|
4431 | 4595 | |
---|
4432 | | - copy.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
| 4596 | + changed.RestoreBigData(Grafreed.grafreed.universe.versiontable); |
---|
4433 | 4597 | |
---|
4434 | 4598 | CameraPane.SWITCH = temp; |
---|
4435 | 4599 | |
---|
4436 | | - RefreshSelection(); |
---|
| 4600 | + if (objEditor == this) |
---|
| 4601 | + RefreshSelection(); |
---|
4437 | 4602 | //assert(hashtable.isEmpty()); |
---|
4438 | 4603 | |
---|
4439 | | - copy.Touch(); |
---|
| 4604 | + objEditor.copy.Touch(); |
---|
4440 | 4605 | |
---|
4441 | 4606 | ResetModel(); |
---|
4442 | | - copy.HardTouch(); // recompile? |
---|
| 4607 | + objEditor.copy.HardTouch(); // recompile? |
---|
4443 | 4608 | |
---|
4444 | 4609 | cRadio ab; |
---|
4445 | | - for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 4610 | + for (java.util.Enumeration e = objEditor.buttonGroup.getElements(); e.hasMoreElements();) |
---|
4446 | 4611 | { |
---|
4447 | 4612 | ab = (cRadio)e.nextElement(); |
---|
4448 | | - Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 4613 | + Object3D test = objEditor.copy.GetObject(ab.object.GetUUID()); |
---|
4449 | 4614 | //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
4450 | 4615 | if (test != null) |
---|
4451 | 4616 | { |
---|
.. | .. |
---|
4454 | 4619 | } |
---|
4455 | 4620 | } |
---|
4456 | 4621 | |
---|
4457 | | - refreshContents(true); |
---|
| 4622 | + objEditor.refreshContents(true); |
---|
4458 | 4623 | } |
---|
4459 | 4624 | |
---|
4460 | 4625 | cButton previousVersionButton; |
---|
.. | .. |
---|
4468 | 4633 | |
---|
4469 | 4634 | int VersionCount() |
---|
4470 | 4635 | { |
---|
4471 | | - int count = 0; |
---|
4472 | | - |
---|
4473 | | - for (int i = copy.versionlist.length; --i >= 0;) |
---|
4474 | | - { |
---|
4475 | | - if (copy.versionlist[i] != null) |
---|
4476 | | - count++; |
---|
4477 | | - } |
---|
4478 | | - |
---|
4479 | | - return count; |
---|
| 4636 | + return copy.VersionCount(); |
---|
4480 | 4637 | } |
---|
4481 | 4638 | |
---|
4482 | 4639 | public cGridBag versionSliderPane; |
---|
.. | .. |
---|
4488 | 4645 | |
---|
4489 | 4646 | //cRadio tab = GetCurrentTab(); |
---|
4490 | 4647 | |
---|
4491 | | - if (copy.versionlist == null) |
---|
| 4648 | + if (copy.versionindex == -2) |
---|
4492 | 4649 | { |
---|
4493 | 4650 | saveVersionButton.setEnabled(false); |
---|
4494 | 4651 | restoreButton.setEnabled(false); |
---|
.. | .. |
---|
4550 | 4707 | |
---|
4551 | 4708 | copy.versionindex -= 1; |
---|
4552 | 4709 | |
---|
4553 | | - CopyChanged(); |
---|
| 4710 | + CopyChanged(copy); |
---|
| 4711 | + |
---|
| 4712 | + SetVersionStates(); |
---|
4554 | 4713 | |
---|
4555 | 4714 | return true; |
---|
4556 | 4715 | } |
---|
.. | .. |
---|
4568 | 4727 | } |
---|
4569 | 4728 | |
---|
4570 | 4729 | //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
4571 | | - CopyChanged(); |
---|
| 4730 | + CopyChanged(copy); |
---|
| 4731 | + |
---|
| 4732 | + SetVersionStates(); |
---|
4572 | 4733 | |
---|
4573 | 4734 | return true; |
---|
4574 | 4735 | } |
---|
.. | .. |
---|
4605 | 4766 | |
---|
4606 | 4767 | copy.versionindex += 1; |
---|
4607 | 4768 | |
---|
4608 | | - CopyChanged(); |
---|
| 4769 | + CopyChanged(copy); |
---|
4609 | 4770 | |
---|
4610 | 4771 | //if (!tab.user[tab.versionindex]) |
---|
4611 | 4772 | // tab.graphs[tab.versionindex] = null; |
---|
| 4773 | + |
---|
| 4774 | + SetVersionStates(); |
---|
4612 | 4775 | } |
---|
4613 | 4776 | |
---|
4614 | 4777 | void ImportGFD() |
---|
.. | .. |
---|
4845 | 5008 | current.shadow = (float) shadowField.getFloat(); |
---|
4846 | 5009 | current.texture = (float) textureField.getFloat(); |
---|
4847 | 5010 | current.opacity = (float) opacityField.getFloat(); |
---|
| 5011 | + current.parallax = (float) parallaxField.getFloat() - 0.125f; |
---|
4848 | 5012 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4849 | 5013 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4850 | 5014 | |
---|
.. | .. |
---|
4899 | 5063 | textureField.SetToolTipValue((mat.texture)); |
---|
4900 | 5064 | if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
4901 | 5065 | opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5066 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5067 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
4902 | 5068 | if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
4903 | 5069 | fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4904 | 5070 | if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
.. | .. |
---|
4934 | 5100 | } |
---|
4935 | 5101 | |
---|
4936 | 5102 | cNumberSlider versionSlider; |
---|
| 5103 | + cNumberSlider versionField; |
---|
4937 | 5104 | |
---|
4938 | 5105 | public void stateChanged(ChangeEvent e) |
---|
4939 | 5106 | { |
---|
.. | .. |
---|
4950 | 5117 | if (version != -1 && copy.versionlist[version] != null) |
---|
4951 | 5118 | { |
---|
4952 | 5119 | copy.versionindex = version; |
---|
4953 | | - CopyChanged(); |
---|
| 5120 | + CopyChanged(copy); |
---|
| 5121 | + SetVersionStates(); |
---|
4954 | 5122 | } |
---|
4955 | 5123 | |
---|
4956 | 5124 | return; |
---|
4957 | 5125 | } |
---|
4958 | 5126 | |
---|
| 5127 | + if (e.getSource() == versionField) |
---|
| 5128 | + { |
---|
| 5129 | + int version = versionField.getInteger(); |
---|
| 5130 | + |
---|
| 5131 | + if (version != -1 && copy.versionindex != version && copy.versionlist[version] != null) |
---|
| 5132 | + { |
---|
| 5133 | + copy.versionindex = version; |
---|
| 5134 | + CopyChanged(copy); |
---|
| 5135 | + } |
---|
| 5136 | + |
---|
| 5137 | + return; |
---|
| 5138 | + } |
---|
| 5139 | + |
---|
4959 | 5140 | if (freezematerial) |
---|
4960 | 5141 | { |
---|
4961 | 5142 | return; |
---|
.. | .. |
---|
5045 | 5226 | } |
---|
5046 | 5227 | |
---|
5047 | 5228 | if (normalpushField != null) |
---|
5048 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
| 5229 | + copy.NORMALPUSH = (float)normalpushField.getFloat() / 100; |
---|
5049 | 5230 | } |
---|
5050 | 5231 | |
---|
5051 | 5232 | void SnapObject() |
---|
.. | .. |
---|
5419 | 5600 | void ResetModel() |
---|
5420 | 5601 | { |
---|
5421 | 5602 | //assert(copy instanceof Composite); |
---|
5422 | | - Object3D /*Composite*/ group = (Object3D /*Composite*/) copy; |
---|
| 5603 | + Object3D /*Composite*/ group = (Object3D /*Composite*/) objEditor.copy; |
---|
5423 | 5604 | |
---|
5424 | 5605 | // necessary? group.selection = new Object3D(); // java.util.Vector(); |
---|
5425 | 5606 | |
---|
.. | .. |
---|
5430 | 5611 | //group.refreshEditWindow(); |
---|
5431 | 5612 | //refreshContents(); |
---|
5432 | 5613 | |
---|
5433 | | - if (copy.selection == null) |
---|
| 5614 | + if (objEditor.copy.selection == null) |
---|
5434 | 5615 | { |
---|
5435 | | - copy.selection = new Object3D(); |
---|
| 5616 | + objEditor.copy.selection = new Object3D(); |
---|
5436 | 5617 | } |
---|
5437 | 5618 | |
---|
5438 | | - for (int j = 0; j < copy.selection.size(); j++) |
---|
| 5619 | + for (int j = 0; j < objEditor.copy.selection.size(); j++) |
---|
5439 | 5620 | { |
---|
5440 | | - Object3D item = copy.selection.get(j); |
---|
| 5621 | + Object3D item = objEditor.copy.selection.get(j); |
---|
5441 | 5622 | |
---|
5442 | 5623 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5443 | 5624 | { |
---|
.. | .. |
---|
5446 | 5627 | |
---|
5447 | 5628 | if (item.count <= 1) // ??? == 0) |
---|
5448 | 5629 | { |
---|
5449 | | - copy.selection.remove(item); |
---|
| 5630 | + objEditor.copy.selection.remove(item); |
---|
5450 | 5631 | } |
---|
5451 | 5632 | } |
---|
5452 | 5633 | |
---|
5453 | 5634 | boolean first = true; |
---|
5454 | 5635 | |
---|
5455 | | - for (int i = copy.selection.size(); --i >= 0;) |
---|
| 5636 | + for (int i = objEditor.copy.selection.size(); --i >= 0;) |
---|
5456 | 5637 | { |
---|
5457 | | - Object3D item = copy.selection.get(i); |
---|
| 5638 | + Object3D item = objEditor.copy.selection.get(i); |
---|
5458 | 5639 | |
---|
5459 | 5640 | if (item instanceof cGroup && ((cGroup) item).transientlink) |
---|
5460 | 5641 | { |
---|
.. | .. |
---|
6155 | 6336 | cNumberSlider textureField; |
---|
6156 | 6337 | JLabel opacityLabel; |
---|
6157 | 6338 | cNumberSlider opacityField; |
---|
| 6339 | + JLabel parallaxLabel; |
---|
| 6340 | + cNumberSlider parallaxField; |
---|
6158 | 6341 | JLabel fakedepthLabel; |
---|
6159 | 6342 | cNumberSlider fakedepthField; |
---|
6160 | 6343 | JLabel shadowbiasLabel; |
---|