From 60cec91731a350fe67e9b5ffe7a00d70e9026314 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Thu, 22 Aug 2019 22:45:00 -0400 Subject: [PATCH] Min shader. --- ObjEditor.java | 74 ++++++++++++++++++++++++++++--------- 1 files changed, 56 insertions(+), 18 deletions(-) diff --git a/ObjEditor.java b/ObjEditor.java index 3f3be5b..63acad8 100644 --- a/ObjEditor.java +++ b/ObjEditor.java @@ -383,14 +383,6 @@ client = inClient; copy = client; - if (copy.versionlist == null) - { - copy.versionlist = new Object3D[100]; - copy.versionindex = -1; - -// Save(true); - } - SetupUI2(callee.GetEditor()); } @@ -1775,7 +1767,7 @@ scrollpane.addMouseWheelListener(this); // Default not fast enough /*JTabbedPane*/ scenePanel = new cGridBag(); - scenePanel.preferredWidth = 6; + scenePanel.preferredWidth = 5; JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.add(scrollpane); @@ -1884,9 +1876,9 @@ if (Globals.ADVANCED) { - tabbedPane.add(infoPanel); - tabbedPane.setIconAt(4, GetIcon("icons/info.png")); - tabbedPane.setToolTipTextAt(4, "Information"); + objectPanel.add(infoPanel); + objectPanel.setIconAt(5, GetIcon("icons/info.png")); + objectPanel.setToolTipTextAt(4, "Information"); } /* @@ -2370,7 +2362,7 @@ { public void mouseClicked(MouseEvent e) { - borderfadeField.setFloat(0.5); + borderfadeField.setFloat(0.4); opacityField.setFloat(0.75); materialtouched = true; @@ -2436,6 +2428,48 @@ } }); presetpanel.add(shadowShader); + + cLabel para0 = GetLabel("icons/shadericons/parallax0.png", !Globals.NIMBUSLAF); + para0.setToolTipText("No parallax"); + para0.addMouseListener(new MouseAdapter() + { + public void mouseClicked(MouseEvent e) + { + parallaxField.setFloat(0.125); + + materialtouched = true; + applySelf(); + } + }); + presetpanel.add(para0); + + cLabel para1 = GetLabel("icons/shadericons/parallax1.png", !Globals.NIMBUSLAF); + para1.setToolTipText("With parallax"); + para1.addMouseListener(new MouseAdapter() + { + public void mouseClicked(MouseEvent e) + { + parallaxField.setFloat(0.13); + + materialtouched = true; + applySelf(); + } + }); + presetpanel.add(para1); + + cLabel para2 = GetLabel("icons/shadericons/parallax2.png", !Globals.NIMBUSLAF); + para2.setToolTipText("Reset parallax"); + para2.addMouseListener(new MouseAdapter() + { + public void mouseClicked(MouseEvent e) + { + parallaxField.setFloat(0.14); + + materialtouched = true; + applySelf(); + } + }); + presetpanel.add(para2); cGridBag panel = new cGridBag().setVertical(true); @@ -2685,7 +2719,7 @@ cGridBag parallax = new cGridBag(); parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints); parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING); - parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.5, -0.25)); // , aConstraints); + parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.25, -0.125)); // , aConstraints); colorSection.add(parallax); //panel.add(new JSeparator()); @@ -3739,7 +3773,7 @@ shadowField.setFloat(mat.shadow); textureField.setFloat(mat.texture); opacityField.setFloat(mat.opacity); - parallaxField.setFloat(mat.parallax + 0.25f); + parallaxField.setFloat(mat.parallax + 0.125f); fakedepthField.setFloat(mat.fakedepth); shadowbiasField.setFloat(mat.shadowbias); bumpField.setInteger(1); // dec 2013 @@ -4433,7 +4467,11 @@ System.err.println("Save"); Replace(); - //cRadio tab = GetCurrentTab(); + if (copy.versionlist == null) + { + copy.versionlist = new Object3D[100]; + copy.versionindex = -1; + } Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? @@ -4607,7 +4645,7 @@ //cRadio tab = GetCurrentTab(); - if (copy.versionlist == null) + if (copy.versionindex == -2) { saveVersionButton.setEnabled(false); restoreButton.setEnabled(false); @@ -4964,7 +5002,7 @@ current.shadow = (float) shadowField.getFloat(); current.texture = (float) textureField.getFloat(); current.opacity = (float) opacityField.getFloat(); - current.parallax = (float) parallaxField.getFloat() - 0.25f; + current.parallax = (float) parallaxField.getFloat() - 0.125f; current.fakedepth = (float) fakedepthField.getFloat(); current.shadowbias = (float) shadowbiasField.getFloat(); -- Gitblit v1.6.2