Cleanup mod state dump to be easier to read by displaying the states in abreviation and placing them before the mod info.

This commit is contained in:
Lex Manos 2015-06-09 23:06:06 -07:00
parent b94c2799ab
commit b3a1548cfa
2 changed files with 26 additions and 12 deletions

View file

@ -266,10 +266,17 @@ public class LoadController
public void printModStates(StringBuilder ret)
{
ret.append("\n\tStates:");
for (ModState state : ModState.values())
ret.append(" '").append(state.getMarker()).append("' = ").append(state.toString());
for (ModContainer mc : loader.getModList())
{
ret.append("\n\t").append(mc.getModId()).append("{").append(mc.getVersion()).append("} [").append(mc.getName()).append("] (").append(mc.getSource().getName()).append(") ");
Joiner.on("->"). appendTo(ret, modStates.get(mc.getModId()));
ret.append("\n\t");
for (ModState state : modStates.get(mc.getModId()))
ret.append(state.getMarker());
ret.append("\t").append(mc.getModId()).append("{").append(mc.getVersion()).append("} [").append(mc.getName()).append("] (").append(mc.getSource().getName()).append(") ");
}
}

View file

@ -95,21 +95,23 @@ public enum LoaderState
}
public enum ModState
{
UNLOADED("Unloaded"),
LOADED("Loaded"),
CONSTRUCTED("Constructed"),
PREINITIALIZED("Pre-initialized"),
INITIALIZED("Initialized"),
POSTINITIALIZED("Post-initialized"),
AVAILABLE("Available"),
DISABLED("Disabled"),
ERRORED("Errored");
UNLOADED ("Unloaded", "U"),
LOADED ("Loaded", "L"),
CONSTRUCTED ("Constructed", "C"),
PREINITIALIZED ("Pre-initialized", "H"),
INITIALIZED ("Initialized", "I"),
POSTINITIALIZED("Post-initialized", "J"),
AVAILABLE ("Available", "A"),
DISABLED ("Disabled", "D"),
ERRORED ("Errored", "E");
private String label;
private String marker;
private ModState(String label)
private ModState(String label, String marker)
{
this.label = label;
this.marker = marker;
}
@Override
@ -117,5 +119,10 @@ public enum LoaderState
{
return this.label;
}
public String getMarker()
{
return this.marker;
}
}
}