.. | .. |
---|
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()); |
---|
.. | .. |
---|
362 | 383 | client = inClient; |
---|
363 | 384 | copy = client; |
---|
364 | 385 | |
---|
365 | | - if (copy.versionlist == null) |
---|
366 | | - { |
---|
367 | | - copy.versionlist = new Object3D[100]; |
---|
368 | | - copy.versionindex = -1; |
---|
369 | | - |
---|
370 | | -// Save(true); |
---|
371 | | - } |
---|
372 | | - |
---|
373 | 386 | SetupUI2(callee.GetEditor()); |
---|
374 | 387 | } |
---|
375 | 388 | |
---|
.. | .. |
---|
445 | 458 | importOBJItem.addActionListener(this); |
---|
446 | 459 | import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
447 | 460 | import3DSItem.addActionListener(this); |
---|
| 461 | + if (Globals.ADVANCED) |
---|
| 462 | + { |
---|
448 | 463 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | 464 | importVRMLX3DItem.addActionListener(this); |
---|
| 465 | + } |
---|
450 | 466 | menu.add("-"); |
---|
451 | 467 | importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
452 | 468 | importGFDItem.addActionListener(this); |
---|
.. | .. |
---|
1318 | 1334 | |
---|
1319 | 1335 | //if (copy.pinned) |
---|
1320 | 1336 | { |
---|
1321 | | - pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1337 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
1322 | 1338 | pinButton.setSelected(copy.pinned); |
---|
1323 | 1339 | cGridBag t = new cGridBag(); |
---|
1324 | 1340 | t.preferredWidth = 2; |
---|
.. | .. |
---|
1550 | 1566 | |
---|
1551 | 1567 | if (cam == null || !(copy.get(0) instanceof cGroup)) |
---|
1552 | 1568 | { |
---|
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); |
---|
| 1569 | + if (Globals.DEBUG) |
---|
| 1570 | + System.out.println("CREATE CAMERAS"); |
---|
| 1571 | + cams = CreateCameras(); |
---|
1570 | 1572 | } else |
---|
1571 | 1573 | { |
---|
1572 | 1574 | cams = (cGroup) copy.get(0); |
---|
.. | .. |
---|
1638 | 1640 | |
---|
1639 | 1641 | resetTransformPanel.preferredHeight = 2; |
---|
1640 | 1642 | |
---|
1641 | | - cButton resetTransform = GetButton("Reset all", !Grafreed.NIMBUSLAF); |
---|
| 1643 | + cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF); |
---|
| 1644 | + resetTransform.setToolTipText("Reset Translation, Rotation and Scale"); |
---|
1642 | 1645 | resetTransform.addMouseListener(new MouseAdapter() |
---|
1643 | 1646 | { |
---|
1644 | 1647 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1648 | 1651 | }); |
---|
1649 | 1652 | resetTransformPanel.add(resetTransform); |
---|
1650 | 1653 | |
---|
1651 | | - resetTransform = GetButton("T only", !Grafreed.NIMBUSLAF); |
---|
| 1654 | + resetTransform = GetButton("T only", !Globals.NIMBUSLAF); |
---|
| 1655 | + resetTransform.setToolTipText("Reset Translation only"); |
---|
1652 | 1656 | resetTransform.addMouseListener(new MouseAdapter() |
---|
1653 | 1657 | { |
---|
1654 | 1658 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1658 | 1662 | }); |
---|
1659 | 1663 | resetTransformPanel.add(resetTransform); |
---|
1660 | 1664 | |
---|
1661 | | - resetTransform = GetButton("RS only", !Grafreed.NIMBUSLAF); |
---|
| 1665 | + resetTransform = GetButton("RS only", !Globals.NIMBUSLAF); |
---|
| 1666 | + resetTransform.setToolTipText("Reset Rotation and Scale only"); |
---|
1662 | 1667 | resetTransform.addMouseListener(new MouseAdapter() |
---|
1663 | 1668 | { |
---|
1664 | 1669 | public void mouseClicked(MouseEvent e) |
---|
.. | .. |
---|
1715 | 1720 | |
---|
1716 | 1721 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1717 | 1722 | //tmp.setName("Edit"); |
---|
| 1723 | + objectPanel.add(skyboxPanel); |
---|
| 1724 | + objectPanel.setIconAt(0, GetIcon("icons/skybox.jpg")); |
---|
| 1725 | + objectPanel.setToolTipTextAt(0, "Backgrounds"); |
---|
| 1726 | + |
---|
1718 | 1727 | objectPanel.add(toolboxPanel); |
---|
1719 | | - objectPanel.setIconAt(0, GetIcon("icons/primitives.png")); |
---|
1720 | | - objectPanel.setToolTipTextAt(0, "Objects & textures"); |
---|
| 1728 | + objectPanel.setIconAt(1, GetIcon("icons/primitives.png")); |
---|
| 1729 | + objectPanel.setToolTipTextAt(1, "Objects & textures"); |
---|
1721 | 1730 | |
---|
1722 | 1731 | objectPanel.add(materialPanel); |
---|
1723 | | - objectPanel.setIconAt(1, GetIcon("icons/material.png")); |
---|
1724 | | - objectPanel.setToolTipTextAt(1, "Material"); |
---|
| 1732 | + objectPanel.setIconAt(2, GetIcon("icons/material.png")); |
---|
| 1733 | + objectPanel.setToolTipTextAt(2, "Material"); |
---|
1725 | 1734 | |
---|
1726 | | - objectPanel.add(skyboxPanel); |
---|
1727 | | - objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg")); |
---|
1728 | | - objectPanel.setToolTipTextAt(2, "Backgrounds"); |
---|
1729 | | - |
---|
1730 | 1735 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1731 | 1736 | // north.setName("Edit"); |
---|
1732 | 1737 | // north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1733 | 1738 | // objectPanel.add(north); |
---|
1734 | 1739 | objectPanel.add(editPanel); |
---|
1735 | | - objectPanel.setIconAt(3, GetIcon("icons/write.png")); |
---|
| 1740 | + objectPanel.setIconAt(3, GetIcon("icons/writewhite.png")); |
---|
1736 | 1741 | objectPanel.setToolTipTextAt(3, "Edit controls"); |
---|
1737 | 1742 | |
---|
1738 | 1743 | objectPanel.add(transformPanel); |
---|
.. | .. |
---|
1741 | 1746 | |
---|
1742 | 1747 | patchMaterial = true; |
---|
1743 | 1748 | cameraView.patchMaterial = this; |
---|
1744 | | - objectPanel.setSelectedIndex(1); |
---|
| 1749 | + objectPanel.setSelectedIndex(2); |
---|
1745 | 1750 | |
---|
1746 | 1751 | /* |
---|
1747 | 1752 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1762 | 1767 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1763 | 1768 | |
---|
1764 | 1769 | /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
1765 | | - scenePanel.preferredWidth = 6; |
---|
| 1770 | + scenePanel.preferredWidth = 5; |
---|
1766 | 1771 | |
---|
1767 | 1772 | JTabbedPane tabbedPane = new JTabbedPane(); |
---|
1768 | 1773 | tabbedPane.add(scrollpane); |
---|
.. | .. |
---|
1773 | 1778 | |
---|
1774 | 1779 | AddOptions(optionsPanel); //, aConstraints); |
---|
1775 | 1780 | |
---|
1776 | | - tabbedPane.add(optionsPanel); |
---|
1777 | | - |
---|
1778 | 1781 | tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1779 | 1782 | |
---|
| 1783 | + tabbedPane.add(optionsPanel); |
---|
| 1784 | + |
---|
1780 | 1785 | scenePanel.add(tabbedPane); |
---|
1781 | 1786 | |
---|
1782 | | - //if (Globals.ADVANCED) |
---|
1783 | | -// tabbedPane.add(infoPanel); |
---|
1784 | | -// tabbedPane.setIconAt(3, GetIcon("icons/info.png")); |
---|
1785 | | -// tabbedPane.setToolTipTextAt(3, "Information"); |
---|
| 1787 | + cGridBag creditsPanel = new cGridBag().setVertical(true); |
---|
| 1788 | + creditsPanel.setName("Credits"); |
---|
1786 | 1789 | |
---|
| 1790 | + cLabel ogaLabel = new cLabel(" Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF); |
---|
| 1791 | + creditsPanel.add(ogaLabel); |
---|
| 1792 | + |
---|
| 1793 | + cButton creditButton; |
---|
| 1794 | + creditsPanel.add(creditButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF)); |
---|
| 1795 | + creditButton.setToolTipText("https://opengameart.org"); |
---|
| 1796 | + |
---|
| 1797 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1798 | + { |
---|
| 1799 | + public void mouseClicked(MouseEvent e) |
---|
| 1800 | + { |
---|
| 1801 | + try |
---|
| 1802 | + { |
---|
| 1803 | + Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/")); |
---|
| 1804 | + } catch (Exception e1) |
---|
| 1805 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1806 | + { |
---|
| 1807 | + e1.printStackTrace(); |
---|
| 1808 | + } |
---|
| 1809 | + } |
---|
| 1810 | + }); |
---|
| 1811 | + |
---|
| 1812 | + ogaLabel = new cLabel(" Download 3D models! (.3ds and .obj only)", !Globals.NIMBUSLAF); |
---|
| 1813 | + creditsPanel.add(ogaLabel); |
---|
| 1814 | + |
---|
| 1815 | + creditsPanel.add(creditButton = GetButton("icons/3delicious.png", !Globals.NIMBUSLAF)); |
---|
| 1816 | + creditButton.setToolTipText("https://3delicious.net"); |
---|
| 1817 | + |
---|
| 1818 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1819 | + { |
---|
| 1820 | + public void mouseClicked(MouseEvent e) |
---|
| 1821 | + { |
---|
| 1822 | + try |
---|
| 1823 | + { |
---|
| 1824 | + Desktop.getDesktop().browse(new java.net.URI("https://3delicious.net")); |
---|
| 1825 | + } catch (Exception e1) |
---|
| 1826 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1827 | + { |
---|
| 1828 | + e1.printStackTrace(); |
---|
| 1829 | + } |
---|
| 1830 | + } |
---|
| 1831 | + }); |
---|
| 1832 | + |
---|
| 1833 | + creditsPanel.add(creditButton = GetButton("icons/archive3d.png", !Globals.NIMBUSLAF)); |
---|
| 1834 | + creditButton.setToolTipText("https://archive3d.net"); |
---|
| 1835 | + |
---|
| 1836 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1837 | + { |
---|
| 1838 | + public void mouseClicked(MouseEvent e) |
---|
| 1839 | + { |
---|
| 1840 | + try |
---|
| 1841 | + { |
---|
| 1842 | + Desktop.getDesktop().browse(new java.net.URI("https://archive3d.net")); |
---|
| 1843 | + } catch (Exception e1) |
---|
| 1844 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1845 | + { |
---|
| 1846 | + e1.printStackTrace(); |
---|
| 1847 | + } |
---|
| 1848 | + } |
---|
| 1849 | + }); |
---|
| 1850 | + |
---|
| 1851 | + creditsPanel.add(creditButton = GetButton("icons/turbosquid.png", !Globals.NIMBUSLAF)); |
---|
| 1852 | + creditButton.setToolTipText("https://turbosquid.com"); |
---|
| 1853 | + |
---|
| 1854 | + creditButton.addMouseListener(new MouseAdapter() |
---|
| 1855 | + { |
---|
| 1856 | + public void mouseClicked(MouseEvent e) |
---|
| 1857 | + { |
---|
| 1858 | + try |
---|
| 1859 | + { |
---|
| 1860 | + Desktop.getDesktop().browse(new java.net.URI("https://www.turbosquid.com/Search/3D-Models/free")); |
---|
| 1861 | + } catch (Exception e1) |
---|
| 1862 | +// } catch (java.io.IOException | java.net.URISyntaxException e1) |
---|
| 1863 | + { |
---|
| 1864 | + e1.printStackTrace(); |
---|
| 1865 | + } |
---|
| 1866 | + } |
---|
| 1867 | + }); |
---|
| 1868 | + |
---|
| 1869 | + for (int i=6; --i>=0;) |
---|
| 1870 | + { |
---|
| 1871 | + creditsPanel.add(new cGridBag()); |
---|
| 1872 | + } |
---|
| 1873 | + |
---|
| 1874 | + tabbedPane.add(creditsPanel); |
---|
| 1875 | + tabbedPane.setToolTipTextAt(3, "Credits"); |
---|
| 1876 | + |
---|
| 1877 | + if (Globals.ADVANCED) |
---|
| 1878 | + { |
---|
| 1879 | + objectPanel.add(infoPanel); |
---|
| 1880 | + objectPanel.setIconAt(5, GetIcon("icons/info.png")); |
---|
| 1881 | + objectPanel.setToolTipTextAt(4, "Information"); |
---|
| 1882 | + } |
---|
| 1883 | + |
---|
1787 | 1884 | /* |
---|
1788 | 1885 | cTree jTree = new cTree(null); |
---|
1789 | 1886 | ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
.. | .. |
---|
1929 | 2026 | { |
---|
1930 | 2027 | cGridBag presetpanel = new cGridBag().setVertical(true); |
---|
1931 | 2028 | |
---|
1932 | | - cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF); |
---|
| 2029 | + cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF); |
---|
1933 | 2030 | skin.setToolTipText("Skin"); |
---|
1934 | 2031 | skin.addMouseListener(new MouseAdapter() |
---|
1935 | 2032 | { |
---|
.. | .. |
---|
1967 | 2064 | }); |
---|
1968 | 2065 | presetpanel.add(skin); |
---|
1969 | 2066 | |
---|
1970 | | - cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF); |
---|
| 2067 | + cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF); |
---|
1971 | 2068 | lambert.setToolTipText("Diffuse"); |
---|
1972 | 2069 | lambert.addMouseListener(new MouseAdapter() |
---|
1973 | 2070 | { |
---|
.. | .. |
---|
1985 | 2082 | }); |
---|
1986 | 2083 | presetpanel.add(lambert); |
---|
1987 | 2084 | |
---|
1988 | | - cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF); |
---|
| 2085 | + cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF); |
---|
1989 | 2086 | diffuse2.setToolTipText("Diffuse2"); |
---|
1990 | 2087 | diffuse2.addMouseListener(new MouseAdapter() |
---|
1991 | 2088 | { |
---|
.. | .. |
---|
2003 | 2100 | }); |
---|
2004 | 2101 | presetpanel.add(diffuse2); |
---|
2005 | 2102 | |
---|
2006 | | - cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF); |
---|
| 2103 | + cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF); |
---|
2007 | 2104 | diffusemoon.setToolTipText("Moon"); |
---|
2008 | 2105 | diffusemoon.addMouseListener(new MouseAdapter() |
---|
2009 | 2106 | { |
---|
.. | .. |
---|
2021 | 2118 | }); |
---|
2022 | 2119 | presetpanel.add(diffusemoon); |
---|
2023 | 2120 | |
---|
2024 | | - cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF); |
---|
| 2121 | + cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF); |
---|
2025 | 2122 | diffusemoon2.setToolTipText("Moon2"); |
---|
2026 | 2123 | diffusemoon2.addMouseListener(new MouseAdapter() |
---|
2027 | 2124 | { |
---|
.. | .. |
---|
2039 | 2136 | }); |
---|
2040 | 2137 | presetpanel.add(diffusemoon2); |
---|
2041 | 2138 | |
---|
2042 | | - cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF); |
---|
| 2139 | + cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF); |
---|
2043 | 2140 | diffusemoon3.setToolTipText("Moon3"); |
---|
2044 | 2141 | diffusemoon3.addMouseListener(new MouseAdapter() |
---|
2045 | 2142 | { |
---|
.. | .. |
---|
2057 | 2154 | }); |
---|
2058 | 2155 | presetpanel.add(diffusemoon3); |
---|
2059 | 2156 | |
---|
2060 | | - cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF); |
---|
| 2157 | + cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF); |
---|
2061 | 2158 | diffusesheen.setToolTipText("Sheen"); |
---|
2062 | 2159 | diffusesheen.addMouseListener(new MouseAdapter() |
---|
2063 | 2160 | { |
---|
.. | .. |
---|
2074 | 2171 | }); |
---|
2075 | 2172 | presetpanel.add(diffusesheen); |
---|
2076 | 2173 | |
---|
2077 | | - cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF); |
---|
| 2174 | + cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF); |
---|
2078 | 2175 | rough.setToolTipText("Rough metal"); |
---|
2079 | 2176 | rough.addMouseListener(new MouseAdapter() |
---|
2080 | 2177 | { |
---|
.. | .. |
---|
2092 | 2189 | }); |
---|
2093 | 2190 | presetpanel.add(rough); |
---|
2094 | 2191 | |
---|
2095 | | - cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF); |
---|
| 2192 | + cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF); |
---|
2096 | 2193 | rough2.setToolTipText("Medium metal"); |
---|
2097 | 2194 | rough2.addMouseListener(new MouseAdapter() |
---|
2098 | 2195 | { |
---|
.. | .. |
---|
2110 | 2207 | }); |
---|
2111 | 2208 | presetpanel.add(rough2); |
---|
2112 | 2209 | |
---|
2113 | | - cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF); |
---|
| 2210 | + cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF); |
---|
2114 | 2211 | shini0.setToolTipText("Shiny"); |
---|
2115 | 2212 | shini0.addMouseListener(new MouseAdapter() |
---|
2116 | 2213 | { |
---|
.. | .. |
---|
2128 | 2225 | }); |
---|
2129 | 2226 | presetpanel.add(shini0); |
---|
2130 | 2227 | |
---|
2131 | | - cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF); |
---|
| 2228 | + cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF); |
---|
2132 | 2229 | shini1.setToolTipText("Shiny2"); |
---|
2133 | 2230 | shini1.addMouseListener(new MouseAdapter() |
---|
2134 | 2231 | { |
---|
.. | .. |
---|
2146 | 2243 | }); |
---|
2147 | 2244 | presetpanel.add(shini1); |
---|
2148 | 2245 | |
---|
2149 | | - cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF); |
---|
| 2246 | + cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF); |
---|
2150 | 2247 | shini2.setToolTipText("Shiny3"); |
---|
2151 | 2248 | shini2.addMouseListener(new MouseAdapter() |
---|
2152 | 2249 | { |
---|
.. | .. |
---|
2164 | 2261 | }); |
---|
2165 | 2262 | presetpanel.add(shini2); |
---|
2166 | 2263 | |
---|
2167 | | - cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF); |
---|
| 2264 | + cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF); |
---|
2168 | 2265 | aniso.setToolTipText("AnisoU"); |
---|
2169 | 2266 | aniso.addMouseListener(new MouseAdapter() |
---|
2170 | 2267 | { |
---|
.. | .. |
---|
2182 | 2279 | }); |
---|
2183 | 2280 | presetpanel.add(aniso); |
---|
2184 | 2281 | |
---|
2185 | | - cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF); |
---|
| 2282 | + cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF); |
---|
2186 | 2283 | aniso2.setToolTipText("AnisoV"); |
---|
2187 | 2284 | aniso2.addMouseListener(new MouseAdapter() |
---|
2188 | 2285 | { |
---|
.. | .. |
---|
2200 | 2297 | }); |
---|
2201 | 2298 | presetpanel.add(aniso2); |
---|
2202 | 2299 | |
---|
2203 | | - cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF); |
---|
| 2300 | + cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF); |
---|
2204 | 2301 | aniso3.setToolTipText("AnisoUV"); |
---|
2205 | 2302 | aniso3.addMouseListener(new MouseAdapter() |
---|
2206 | 2303 | { |
---|
.. | .. |
---|
2218 | 2315 | }); |
---|
2219 | 2316 | presetpanel.add(aniso3); |
---|
2220 | 2317 | |
---|
2221 | | - cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF); |
---|
| 2318 | + cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF); |
---|
2222 | 2319 | velvet0.setToolTipText("Velvet"); |
---|
2223 | 2320 | velvet0.addMouseListener(new MouseAdapter() |
---|
2224 | 2321 | { |
---|
.. | .. |
---|
2240 | 2337 | }); |
---|
2241 | 2338 | presetpanel.add(velvet0); |
---|
2242 | 2339 | |
---|
2243 | | - cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF); |
---|
| 2340 | + cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF); |
---|
2244 | 2341 | bump0.setToolTipText("Bump texture"); |
---|
2245 | 2342 | bump0.addMouseListener(new MouseAdapter() |
---|
2246 | 2343 | { |
---|
.. | .. |
---|
2259 | 2356 | }); |
---|
2260 | 2357 | presetpanel.add(bump0); |
---|
2261 | 2358 | |
---|
2262 | | - cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF); |
---|
| 2359 | + cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF); |
---|
2263 | 2360 | borderShader.setToolTipText("Border fade"); |
---|
2264 | 2361 | borderShader.addMouseListener(new MouseAdapter() |
---|
2265 | 2362 | { |
---|
2266 | 2363 | public void mouseClicked(MouseEvent e) |
---|
2267 | 2364 | { |
---|
2268 | | - borderfadeField.setFloat(0.5); |
---|
| 2365 | + borderfadeField.setFloat(0.4); |
---|
2269 | 2366 | opacityField.setFloat(0.75); |
---|
2270 | 2367 | |
---|
2271 | 2368 | materialtouched = true; |
---|
.. | .. |
---|
2274 | 2371 | }); |
---|
2275 | 2372 | presetpanel.add(borderShader); |
---|
2276 | 2373 | |
---|
2277 | | - cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF); |
---|
| 2374 | + cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF); |
---|
2278 | 2375 | halo.setToolTipText("Halo"); |
---|
2279 | 2376 | halo.addMouseListener(new MouseAdapter() |
---|
2280 | 2377 | { |
---|
.. | .. |
---|
2291 | 2388 | }); |
---|
2292 | 2389 | presetpanel.add(halo); |
---|
2293 | 2390 | |
---|
2294 | | - cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF); |
---|
| 2391 | + cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF); |
---|
2295 | 2392 | candle.setToolTipText("Candle"); |
---|
2296 | 2393 | candle.addMouseListener(new MouseAdapter() |
---|
2297 | 2394 | { |
---|
.. | .. |
---|
2313 | 2410 | }); |
---|
2314 | 2411 | presetpanel.add(candle); |
---|
2315 | 2412 | |
---|
2316 | | - cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF); |
---|
| 2413 | + cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF); |
---|
2317 | 2414 | shadowShader.setToolTipText("Shadow"); |
---|
2318 | 2415 | shadowShader.addMouseListener(new MouseAdapter() |
---|
2319 | 2416 | { |
---|
.. | .. |
---|
2332 | 2429 | }); |
---|
2333 | 2430 | presetpanel.add(shadowShader); |
---|
2334 | 2431 | |
---|
| 2432 | + cLabel para0 = GetLabel("icons/shadericons/parallax0.png", !Globals.NIMBUSLAF); |
---|
| 2433 | + para0.setToolTipText("No parallax"); |
---|
| 2434 | + para0.addMouseListener(new MouseAdapter() |
---|
| 2435 | + { |
---|
| 2436 | + public void mouseClicked(MouseEvent e) |
---|
| 2437 | + { |
---|
| 2438 | + parallaxField.setFloat(0.125); |
---|
| 2439 | + |
---|
| 2440 | + materialtouched = true; |
---|
| 2441 | + applySelf(); |
---|
| 2442 | + } |
---|
| 2443 | + }); |
---|
| 2444 | + presetpanel.add(para0); |
---|
| 2445 | + |
---|
| 2446 | + cLabel para1 = GetLabel("icons/shadericons/parallax1.png", !Globals.NIMBUSLAF); |
---|
| 2447 | + para1.setToolTipText("With parallax"); |
---|
| 2448 | + para1.addMouseListener(new MouseAdapter() |
---|
| 2449 | + { |
---|
| 2450 | + public void mouseClicked(MouseEvent e) |
---|
| 2451 | + { |
---|
| 2452 | + parallaxField.setFloat(0.13); |
---|
| 2453 | + |
---|
| 2454 | + materialtouched = true; |
---|
| 2455 | + applySelf(); |
---|
| 2456 | + } |
---|
| 2457 | + }); |
---|
| 2458 | + presetpanel.add(para1); |
---|
| 2459 | + |
---|
| 2460 | + cLabel para2 = GetLabel("icons/shadericons/parallax2.png", !Globals.NIMBUSLAF); |
---|
| 2461 | + para2.setToolTipText("Reset parallax"); |
---|
| 2462 | + para2.addMouseListener(new MouseAdapter() |
---|
| 2463 | + { |
---|
| 2464 | + public void mouseClicked(MouseEvent e) |
---|
| 2465 | + { |
---|
| 2466 | + parallaxField.setFloat(0.14); |
---|
| 2467 | + |
---|
| 2468 | + materialtouched = true; |
---|
| 2469 | + applySelf(); |
---|
| 2470 | + } |
---|
| 2471 | + }); |
---|
| 2472 | + presetpanel.add(para2); |
---|
| 2473 | + |
---|
2335 | 2474 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2336 | 2475 | |
---|
2337 | 2476 | presetpanel.preferredWidth = 1; |
---|
.. | .. |
---|
2348 | 2487 | |
---|
2349 | 2488 | cGridBag editBar = new cGridBag().setVertical(false); |
---|
2350 | 2489 | |
---|
2351 | | - editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2490 | + editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2352 | 2491 | createMaterialButton.setToolTipText("Create material"); |
---|
2353 | 2492 | |
---|
2354 | 2493 | /* |
---|
2355 | 2494 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
2356 | 2495 | */ |
---|
2357 | 2496 | |
---|
2358 | | - editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2497 | + editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2359 | 2498 | clearMaterialButton.setToolTipText("Clear material"); |
---|
2360 | 2499 | |
---|
2361 | 2500 | if (Globals.ADVANCED) |
---|
2362 | 2501 | { |
---|
2363 | | - editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 2502 | + editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints); |
---|
2364 | 2503 | editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
2365 | 2504 | editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
2366 | 2505 | } |
---|
.. | .. |
---|
2577 | 2716 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
2578 | 2717 | colorSection.add(backlit); |
---|
2579 | 2718 | |
---|
| 2719 | + cGridBag parallax = new cGridBag(); |
---|
| 2720 | + parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints); |
---|
| 2721 | + parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2722 | + parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.25, -0.125)); // , aConstraints); |
---|
| 2723 | + colorSection.add(parallax); |
---|
| 2724 | + |
---|
2580 | 2725 | //panel.add(new JSeparator()); |
---|
2581 | 2726 | |
---|
2582 | 2727 | //panel.add(globalSection); |
---|
.. | .. |
---|
3628 | 3773 | shadowField.setFloat(mat.shadow); |
---|
3629 | 3774 | textureField.setFloat(mat.texture); |
---|
3630 | 3775 | opacityField.setFloat(mat.opacity); |
---|
| 3776 | + parallaxField.setFloat(mat.parallax + 0.125f); |
---|
3631 | 3777 | fakedepthField.setFloat(mat.fakedepth); |
---|
3632 | 3778 | shadowbiasField.setFloat(mat.shadowbias); |
---|
3633 | 3779 | bumpField.setInteger(1); // dec 2013 |
---|
.. | .. |
---|
4161 | 4307 | |
---|
4162 | 4308 | void New() |
---|
4163 | 4309 | { |
---|
4164 | | - while (copy.Size() > 1) |
---|
| 4310 | + while (copy.Size() > 0) |
---|
4165 | 4311 | { |
---|
4166 | | - copy.remove(1); |
---|
| 4312 | + copy.remove(0); |
---|
4167 | 4313 | } |
---|
4168 | 4314 | |
---|
| 4315 | + copy.selection.clear(); |
---|
| 4316 | + |
---|
| 4317 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4318 | + { |
---|
| 4319 | + CreateCameras(); |
---|
| 4320 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4321 | + } |
---|
4169 | 4322 | ResetModel(); |
---|
4170 | 4323 | objEditor.refreshContents(); |
---|
4171 | 4324 | } |
---|
.. | .. |
---|
4314 | 4467 | System.err.println("Save"); |
---|
4315 | 4468 | Replace(); |
---|
4316 | 4469 | |
---|
4317 | | - //cRadio tab = GetCurrentTab(); |
---|
| 4470 | + if (copy.versionlist == null) |
---|
| 4471 | + { |
---|
| 4472 | + copy.versionlist = new Object3D[100]; |
---|
| 4473 | + copy.versionindex = -1; |
---|
| 4474 | + } |
---|
4318 | 4475 | |
---|
4319 | 4476 | Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4320 | 4477 | |
---|
.. | .. |
---|
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); |
---|
.. | .. |
---|
4845 | 5002 | current.shadow = (float) shadowField.getFloat(); |
---|
4846 | 5003 | current.texture = (float) textureField.getFloat(); |
---|
4847 | 5004 | current.opacity = (float) opacityField.getFloat(); |
---|
| 5005 | + current.parallax = (float) parallaxField.getFloat() - 0.125f; |
---|
4848 | 5006 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4849 | 5007 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4850 | 5008 | |
---|
.. | .. |
---|
4899 | 5057 | textureField.SetToolTipValue((mat.texture)); |
---|
4900 | 5058 | if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
4901 | 5059 | opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5060 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5061 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
4902 | 5062 | if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
4903 | 5063 | fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4904 | 5064 | if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
.. | .. |
---|
6155 | 6315 | cNumberSlider textureField; |
---|
6156 | 6316 | JLabel opacityLabel; |
---|
6157 | 6317 | cNumberSlider opacityField; |
---|
| 6318 | + JLabel parallaxLabel; |
---|
| 6319 | + cNumberSlider parallaxField; |
---|
6158 | 6320 | JLabel fakedepthLabel; |
---|
6159 | 6321 | cNumberSlider fakedepthField; |
---|
6160 | 6322 | JLabel shadowbiasLabel; |
---|