Normand Briere
2019-08-22 6a145f6c81dfcbe0653eda27d042efb48daa7512
GroupEditor.java
....@@ -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;
....@@ -974,6 +976,7 @@
974976 }
975977
976978 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