.. | .. |
---|
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()); |
---|
.. | .. |
---|
445 | 466 | importOBJItem.addActionListener(this); |
---|
446 | 467 | import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
447 | 468 | import3DSItem.addActionListener(this); |
---|
| 469 | + if (Globals.ADVANCED) |
---|
| 470 | + { |
---|
448 | 471 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | 472 | importVRMLX3DItem.addActionListener(this); |
---|
| 473 | + } |
---|
450 | 474 | menu.add("-"); |
---|
451 | 475 | importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
452 | 476 | importGFDItem.addActionListener(this); |
---|
.. | .. |
---|
1318 | 1342 | |
---|
1319 | 1343 | //if (copy.pinned) |
---|
1320 | 1344 | { |
---|
1321 | | - pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF); |
---|
| 1345 | + pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF); |
---|
1322 | 1346 | pinButton.setSelected(copy.pinned); |
---|
1323 | 1347 | cGridBag t = new cGridBag(); |
---|
1324 | 1348 | t.preferredWidth = 2; |
---|
.. | .. |
---|
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; |
---|
.. | .. |
---|
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 | + tabbedPane.add(infoPanel); |
---|
| 1888 | + tabbedPane.setIconAt(4, GetIcon("icons/info.png")); |
---|
| 1889 | + tabbedPane.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 | { |
---|
.. | .. |
---|
2332 | 2437 | }); |
---|
2333 | 2438 | presetpanel.add(shadowShader); |
---|
2334 | 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); |
---|
| 2481 | + |
---|
2335 | 2482 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2336 | 2483 | |
---|
2337 | 2484 | presetpanel.preferredWidth = 1; |
---|
.. | .. |
---|
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 |
---|
.. | .. |
---|
4161 | 4315 | |
---|
4162 | 4316 | void New() |
---|
4163 | 4317 | { |
---|
4164 | | - while (copy.Size() > 1) |
---|
| 4318 | + while (copy.Size() > 0) |
---|
4165 | 4319 | { |
---|
4166 | | - copy.remove(1); |
---|
| 4320 | + copy.remove(0); |
---|
4167 | 4321 | } |
---|
4168 | 4322 | |
---|
| 4323 | + copy.selection.clear(); |
---|
| 4324 | + |
---|
| 4325 | + if (copy == Grafreed.grafreed.universe) |
---|
| 4326 | + { |
---|
| 4327 | + CreateCameras(); |
---|
| 4328 | + cameraView.SetCamera(GetCamera(copy, 0)); |
---|
| 4329 | + } |
---|
4169 | 4330 | ResetModel(); |
---|
4170 | 4331 | objEditor.refreshContents(); |
---|
4171 | 4332 | } |
---|
.. | .. |
---|
4845 | 5006 | current.shadow = (float) shadowField.getFloat(); |
---|
4846 | 5007 | current.texture = (float) textureField.getFloat(); |
---|
4847 | 5008 | current.opacity = (float) opacityField.getFloat(); |
---|
| 5009 | + current.parallax = (float) parallaxField.getFloat() - 0.125f; |
---|
4848 | 5010 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4849 | 5011 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4850 | 5012 | |
---|
.. | .. |
---|
4899 | 5061 | textureField.SetToolTipValue((mat.texture)); |
---|
4900 | 5062 | if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
4901 | 5063 | opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5064 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5065 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
4902 | 5066 | if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
4903 | 5067 | fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
4904 | 5068 | if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
.. | .. |
---|
6155 | 6319 | cNumberSlider textureField; |
---|
6156 | 6320 | JLabel opacityLabel; |
---|
6157 | 6321 | cNumberSlider opacityField; |
---|
| 6322 | + JLabel parallaxLabel; |
---|
| 6323 | + cNumberSlider parallaxField; |
---|
6158 | 6324 | JLabel fakedepthLabel; |
---|
6159 | 6325 | cNumberSlider fakedepthField; |
---|
6160 | 6326 | JLabel shadowbiasLabel; |
---|