Normand Briere
2019-08-22 6a823ffbfcda4c843f46e02e83c869d5bc323e25
GroupEditor.java
....@@ -347,7 +347,7 @@
347347
348348 public void CreateSkyboxPanel(cGridBag skyboxPanel)
349349 {
350
- JTabbedPane skyboxpane = new JTabbedPane();
350
+ JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT);
351351
352352 AddSkyboxTab0(skyboxpane);
353353 AddSkyboxTab1(skyboxpane);
....@@ -936,6 +936,8 @@
936936 cGridBag currenttab;
937937 //boolean added; // patch for jar
938938
939
+ int totalcount = 0;
940
+
939941 int tabcount = 0;
940942 int colcount = 0;
941943 int rowcount = 0;
....@@ -964,7 +966,7 @@
964966 texturecount = 0;
965967 }
966968
967
- if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg"))
969
+ if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png")))
968970 {
969971 //if (!added)
970972 {
....@@ -973,7 +975,8 @@
973975 currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname));
974976 }
975977
976
- AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab);
978
+ AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab);
979
+ totalcount++;
977980
978981 if (++colcount >= columns)
979982 {
....@@ -999,6 +1002,8 @@
9991002 container.add(resourcecontainer);
10001003
10011004 Grafreed.ParseResources("textures", this);
1005
+
1006
+ // 935. System.out.println("Total = " + totalcount);
10021007 }
10031008
10041009 void SetupUI2(ObjEditor oe)
....@@ -1259,7 +1264,10 @@
12591264
12601265 CreateTexturePanel(textures);
12611266
1262
- resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount()));
1267
+ int tabCount = resourcecontainer.getTabCount();
1268
+
1269
+ if (tabCount > 0)
1270
+ resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount));
12631271
12641272 oe.toolboxPanel.add(textures);
12651273