Normand Briere
2019-08-09 912749d2520afedd9b56458d771400c261fe2b88
GroupEditor.java
....@@ -42,12 +42,12 @@
4242 });
4343 }
4444
45
- public void AddTextureButton(String f, final String t, cGridBag row)
45
+ public void AddTextureButton(String f, String c, final String t, int count, cGridBag row)
4646 {
4747 cButton textureButton;
48
- final String path = "textures/" + f + "/"; // + t;
48
+ final String path = "textures/" + f + "/" + c + "/"; // + t;
4949 row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
- textureButton.setToolTipText(f + "s");
50
+ textureButton.setToolTipText(c + count);
5151 textureButton.addActionListener(new ActionListener()
5252 {
5353 @Override
....@@ -350,7 +350,13 @@
350350
351351 public void ChangeTexture(String texture)
352352 {
353
- cameraView.repaint();
353
+ for (int i=0; i<group.selection.size(); i++)
354
+ {
355
+ Object3D obj = group.selection.get(i);
356
+ obj.SetPigmentTexture("@" + texture);
357
+ }
358
+
359
+ refreshContents();
354360 }
355361
356362 //ObjEditor objEditor;
....@@ -900,35 +906,41 @@
900906 int tabcount = 0;
901907 int colcount = 0;
902908 int rowcount = 0;
909
+ int texturecount = 0;
903910
904911 int columns = 5;
905912 int rows = 7;
906913
907914 public void ResourceCallBack(String[] path)
908915 {
909
- for (int i = 0; i < path.length; i++)
910
- System.out.print(path[i] + "/");
911
- System.out.println();
912
- if (rowcount == 0)
916
+// for (int i = 0; i < path.length; i++)
917
+// System.out.print(path[i] + "/");
918
+// System.out.println();
919
+
920
+ if (//rowcount == 0 ||
921
+ path.length == 1)
913922 {
914923 currenttab = new cGridBag();
915924 added = false;
916
- String tabname = String.valueOf((char)('A'+tabcount));
925
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
917926 currenttab.setName(tabname);
918927 rowcount = 1;
928
+ colcount = 0;
929
+ texturecount = 0;
919930 }
920931
921
- if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg"))
932
+ if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
922933 {
923934 if (!added)
924935 {
925936 added = true;
926937 resourcecontainer.add(currenttab);
927
- String tabname = String.valueOf((char)('A'+tabcount));
938
+ String tabname = path[0]; // String.valueOf((char)('A'+tabcount));
928939 resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
929940 }
930941
931
- AddTextureButton(path[0], path[1], currenttab);
942
+ AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
943
+
932944 if (++colcount >= columns)
933945 {
934946 colcount = 0;
....@@ -949,7 +961,7 @@
949961
950962 void CreateTexturePanel(cGridBag container)
951963 {
952
- resourcecontainer = new JTabbedPane();
964
+ resourcecontainer = new JTabbedPane(JTabbedPane.LEFT);
953965 container.add(resourcecontainer);
954966
955967 Grafreed.ParseResources("textures", this);