.. | .. |
---|
42 | 42 | }); |
---|
43 | 43 | } |
---|
44 | 44 | |
---|
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) |
---|
46 | 46 | { |
---|
47 | 47 | cButton textureButton; |
---|
48 | | - final String path = "textures/" + f + "/"; // + t; |
---|
| 48 | + final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
49 | 49 | row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
50 | | - textureButton.setToolTipText(f + "s"); |
---|
| 50 | + textureButton.setToolTipText(c + count); |
---|
51 | 51 | textureButton.addActionListener(new ActionListener() |
---|
52 | 52 | { |
---|
53 | 53 | @Override |
---|
.. | .. |
---|
350 | 350 | |
---|
351 | 351 | public void ChangeTexture(String texture) |
---|
352 | 352 | { |
---|
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(); |
---|
354 | 360 | } |
---|
355 | 361 | |
---|
356 | 362 | //ObjEditor objEditor; |
---|
.. | .. |
---|
900 | 906 | int tabcount = 0; |
---|
901 | 907 | int colcount = 0; |
---|
902 | 908 | int rowcount = 0; |
---|
| 909 | + int texturecount = 0; |
---|
903 | 910 | |
---|
904 | 911 | int columns = 5; |
---|
905 | 912 | int rows = 7; |
---|
906 | 913 | |
---|
907 | 914 | public void ResourceCallBack(String[] path) |
---|
908 | 915 | { |
---|
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) |
---|
913 | 922 | { |
---|
914 | 923 | currenttab = new cGridBag(); |
---|
915 | 924 | added = false; |
---|
916 | | - String tabname = String.valueOf((char)('A'+tabcount)); |
---|
| 925 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
917 | 926 | currenttab.setName(tabname); |
---|
918 | 927 | rowcount = 1; |
---|
| 928 | + colcount = 0; |
---|
| 929 | + texturecount = 0; |
---|
919 | 930 | } |
---|
920 | 931 | |
---|
921 | | - if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg")) |
---|
| 932 | + if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
922 | 933 | { |
---|
923 | 934 | if (!added) |
---|
924 | 935 | { |
---|
925 | 936 | added = true; |
---|
926 | 937 | resourcecontainer.add(currenttab); |
---|
927 | | - String tabname = String.valueOf((char)('A'+tabcount)); |
---|
| 938 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
928 | 939 | resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
929 | 940 | } |
---|
930 | 941 | |
---|
931 | | - AddTextureButton(path[0], path[1], currenttab); |
---|
| 942 | + AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 943 | + |
---|
932 | 944 | if (++colcount >= columns) |
---|
933 | 945 | { |
---|
934 | 946 | colcount = 0; |
---|
.. | .. |
---|
949 | 961 | |
---|
950 | 962 | void CreateTexturePanel(cGridBag container) |
---|
951 | 963 | { |
---|
952 | | - resourcecontainer = new JTabbedPane(); |
---|
| 964 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
953 | 965 | container.add(resourcecontainer); |
---|
954 | 966 | |
---|
955 | 967 | Grafreed.ParseResources("textures", this); |
---|