.. | .. |
---|
964 | 964 | texturecount = 0; |
---|
965 | 965 | } |
---|
966 | 966 | |
---|
967 | | - if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 967 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
968 | 968 | { |
---|
969 | 969 | //if (!added) |
---|
970 | 970 | { |
---|
.. | .. |
---|
973 | 973 | currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
974 | 974 | } |
---|
975 | 975 | |
---|
976 | | - AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 976 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
977 | 977 | |
---|
978 | 978 | if (++colcount >= columns) |
---|
979 | 979 | { |
---|
.. | .. |
---|
1259 | 1259 | |
---|
1260 | 1260 | CreateTexturePanel(textures); |
---|
1261 | 1261 | |
---|
1262 | | - resourcecontainer.setSelectedIndex((int)(Math.random() * resourcecontainer.getTabCount())); |
---|
| 1262 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1263 | + |
---|
| 1264 | + if (tabCount > 0) |
---|
| 1265 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
1263 | 1266 | |
---|
1264 | 1267 | oe.toolboxPanel.add(textures); |
---|
1265 | 1268 | |
---|