List of asset types works again

This commit is contained in:
7u83 2018-12-09 18:43:29 +01:00
parent 70661d6711
commit f62a385eab
4 changed files with 5 additions and 20 deletions

View File

@ -1,4 +1,4 @@
#Sun, 09 Dec 2018 01:51:19 +0100 #Sun, 09 Dec 2018 18:41:43 +0100
annotation.processing.enabled=true annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false annotation.processing.enabled.in.editor=false
annotation.processing.processors.list= annotation.processing.processors.list=

View File

@ -59,7 +59,7 @@ public class SelectAssetTypeDialog extends EscDialog {
} }
ComboBoxModel getComboBoxModel() { ComboBoxModel getComboBoxModel() {
ArrayList vector = new ArrayList(); ArrayList vector = new ArrayList(asset_types.size()+1);
int i; int i;
for (i = 0; i < asset_types.size(); i++) { for (i = 0; i < asset_types.size(); i++) {
AbstractAsset ait; AbstractAsset ait;
@ -67,9 +67,6 @@ public class SelectAssetTypeDialog extends EscDialog {
System.out.printf("ACL: %s\n", asset_type.getName()); System.out.printf("ACL: %s\n", asset_type.getName());
String tn = GodWorld.getTypeName(asset_type); String tn = GodWorld.getTypeName(asset_type);
if (tn == null) {
continue;
}
vector.add(i, tn); vector.add(i, tn);
} }

View File

@ -232,21 +232,9 @@ public class Globals {
asset_types.sort(new Comparator<Class<AbstractAsset>>() { asset_types.sort(new Comparator<Class<AbstractAsset>>() {
@Override @Override
public int compare(Class<AbstractAsset> o1, Class<AbstractAsset> o2) { public int compare(Class<AbstractAsset> o1, Class<AbstractAsset> o2) {
AbstractAsset a1, a2;
try {
// a1 = o1.newInstance();
a1 = o1.getConstructor(RealWorld.class,JSONObject.class).newInstance(null,null);
a2 = o2.getConstructor(RealWorld.class,JSONObject.class).newInstance(null,null);
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException ex) {
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
return 0;
}
String t1, t2; String t1, t2;
t1 = a1.getTypeName(); t1 = GodWorld.getTypeName(o1);
t2 = a2.getTypeName(); t2 = GodWorld.getTypeName(o2);
return t1.compareToIgnoreCase(t2); return t1.compareToIgnoreCase(t2);
} }

View File

@ -298,7 +298,7 @@ public class GodWorld implements GetJson, World {
return ait.getTypeName(); return ait.getTypeName();
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
Logger.getLogger(GodWorld.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(GodWorld.class.getName()).log(Level.SEVERE, null, ex);
return null; return asset_type.getName();
} }
} }