Normand Briere
2019-08-23 60cec91731a350fe67e9b5ffe7a00d70e9026314
ObjEditor.java
....@@ -383,14 +383,6 @@
383383 client = inClient;
384384 copy = client;
385385
386
- if (copy.versionlist == null)
387
- {
388
- copy.versionlist = new Object3D[100];
389
- copy.versionindex = -1;
390
-
391
-// Save(true);
392
- }
393
-
394386 SetupUI2(callee.GetEditor());
395387 }
396388
....@@ -1775,7 +1767,7 @@
17751767 scrollpane.addMouseWheelListener(this); // Default not fast enough
17761768
17771769 /*JTabbedPane*/ scenePanel = new cGridBag();
1778
- scenePanel.preferredWidth = 6;
1770
+ scenePanel.preferredWidth = 5;
17791771
17801772 JTabbedPane tabbedPane = new JTabbedPane();
17811773 tabbedPane.add(scrollpane);
....@@ -1884,9 +1876,9 @@
18841876
18851877 if (Globals.ADVANCED)
18861878 {
1887
- tabbedPane.add(infoPanel);
1888
- tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1889
- tabbedPane.setToolTipTextAt(4, "Information");
1879
+ objectPanel.add(infoPanel);
1880
+ objectPanel.setIconAt(5, GetIcon("icons/info.png"));
1881
+ objectPanel.setToolTipTextAt(4, "Information");
18901882 }
18911883
18921884 /*
....@@ -2370,7 +2362,7 @@
23702362 {
23712363 public void mouseClicked(MouseEvent e)
23722364 {
2373
- borderfadeField.setFloat(0.5);
2365
+ borderfadeField.setFloat(0.4);
23742366 opacityField.setFloat(0.75);
23752367
23762368 materialtouched = true;
....@@ -2436,6 +2428,48 @@
24362428 }
24372429 });
24382430 presetpanel.add(shadowShader);
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);
24392473
24402474 cGridBag panel = new cGridBag().setVertical(true);
24412475
....@@ -2682,6 +2716,12 @@
26822716 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
26832717 colorSection.add(backlit);
26842718
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
+
26852725 //panel.add(new JSeparator());
26862726
26872727 //panel.add(globalSection);
....@@ -3733,6 +3773,7 @@
37333773 shadowField.setFloat(mat.shadow);
37343774 textureField.setFloat(mat.texture);
37353775 opacityField.setFloat(mat.opacity);
3776
+ parallaxField.setFloat(mat.parallax + 0.125f);
37363777 fakedepthField.setFloat(mat.fakedepth);
37373778 shadowbiasField.setFloat(mat.shadowbias);
37383779 bumpField.setInteger(1); // dec 2013
....@@ -4426,7 +4467,11 @@
44264467 System.err.println("Save");
44274468 Replace();
44284469
4429
- //cRadio tab = GetCurrentTab();
4470
+ if (copy.versionlist == null)
4471
+ {
4472
+ copy.versionlist = new Object3D[100];
4473
+ copy.versionindex = -1;
4474
+ }
44304475
44314476 Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
44324477
....@@ -4600,7 +4645,7 @@
46004645
46014646 //cRadio tab = GetCurrentTab();
46024647
4603
- if (copy.versionlist == null)
4648
+ if (copy.versionindex == -2)
46044649 {
46054650 saveVersionButton.setEnabled(false);
46064651 restoreButton.setEnabled(false);
....@@ -4957,6 +5002,7 @@
49575002 current.shadow = (float) shadowField.getFloat();
49585003 current.texture = (float) textureField.getFloat();
49595004 current.opacity = (float) opacityField.getFloat();
5005
+ current.parallax = (float) parallaxField.getFloat() - 0.125f;
49605006 current.fakedepth = (float) fakedepthField.getFloat();
49615007 current.shadowbias = (float) shadowbiasField.getFloat();
49625008
....@@ -5011,6 +5057,8 @@
50115057 textureField.SetToolTipValue((mat.texture));
50125058 if (!Equal(opacityField.getFloat(), mat.opacity))
50135059 opacityField.SetToolTipValue((mat.opacity));
5060
+ //if (!Equal(parallaxField.getFloat(), mat.parallax))
5061
+ parallaxField.SetToolTipValue((mat.parallax));
50145062 if (!Equal(fakedepthField.getFloat(), mat.fakedepth))
50155063 fakedepthField.SetToolTipValue((mat.fakedepth));
50165064 if (!Equal(shadowbiasField.getFloat(), mat.shadowbias))
....@@ -6267,6 +6315,8 @@
62676315 cNumberSlider textureField;
62686316 JLabel opacityLabel;
62696317 cNumberSlider opacityField;
6318
+ JLabel parallaxLabel;
6319
+ cNumberSlider parallaxField;
62706320 JLabel fakedepthLabel;
62716321 cNumberSlider fakedepthField;
62726322 JLabel shadowbiasLabel;