reformatted all src files (#141)
This commit is contained in:
@@ -19,54 +19,46 @@
|
||||
package appeng.client.gui.config;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.fml.client.config.GuiConfig;
|
||||
import net.minecraftforge.fml.client.config.IConfigElement;
|
||||
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AEConfigGui extends GuiConfig
|
||||
{
|
||||
public class AEConfigGui extends GuiConfig {
|
||||
|
||||
public AEConfigGui( final GuiScreen parent )
|
||||
{
|
||||
super( parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath( AEConfig.instance().getFilePath() ) );
|
||||
}
|
||||
public AEConfigGui(final GuiScreen parent) {
|
||||
super(parent, getConfigElements(), AppEng.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(AEConfig.instance().getFilePath()));
|
||||
}
|
||||
|
||||
private static List<IConfigElement> getConfigElements()
|
||||
{
|
||||
final List<IConfigElement> list = new ArrayList<>();
|
||||
private static List<IConfigElement> getConfigElements() {
|
||||
final List<IConfigElement> list = new ArrayList<>();
|
||||
|
||||
for( final String cat : AEConfig.instance().getCategoryNames() )
|
||||
{
|
||||
if( cat.equals( "versionchecker" ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
for (final String cat : AEConfig.instance().getCategoryNames()) {
|
||||
if (cat.equals("versionchecker")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if( cat.equals( "settings" ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (cat.equals("settings")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final ConfigCategory cc = AEConfig.instance().getCategory( cat );
|
||||
final ConfigCategory cc = AEConfig.instance().getCategory(cat);
|
||||
|
||||
if( cc.isChild() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (cc.isChild()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final ConfigElement ce = new ConfigElement( cc );
|
||||
list.add( ce );
|
||||
}
|
||||
final ConfigElement ce = new ConfigElement(cc);
|
||||
list.add(ce);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,63 +19,58 @@
|
||||
package appeng.client.gui.config;
|
||||
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraftforge.fml.client.IModGuiFactory;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class AEConfigGuiFactory implements IModGuiFactory
|
||||
{
|
||||
|
||||
@Override
|
||||
public void initialize( final Minecraft minecraftInstance )
|
||||
{
|
||||
public class AEConfigGuiFactory implements IModGuiFactory {
|
||||
|
||||
}
|
||||
@Override
|
||||
public void initialize(final Minecraft minecraftInstance) {
|
||||
|
||||
/**
|
||||
* If this method returns false, the config button in the mod list will be disabled
|
||||
*
|
||||
* @return true if this object provides a config gui screen, false otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean hasConfigGui()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an initialized {@link GuiScreen}. This screen will be displayed
|
||||
* when the "config" button is pressed in the mod list. It will
|
||||
* have a single argument constructor - the "parent" screen, the same as all
|
||||
* Minecraft GUIs. The expected behaviour is that this screen will replace the
|
||||
* "mod list" screen completely, and will return to the mod list screen through
|
||||
* the parent link, once the appropriate action is taken from the config screen.
|
||||
* <p>
|
||||
* This config GUI is anticipated to provide configuration to the mod in a friendly
|
||||
* visual way. It should not be abused to set internals such as IDs (they're gonna
|
||||
* keep disappearing anyway), but rather, interesting behaviours. This config GUI
|
||||
* is never run when a server game is running, and should be used to configure
|
||||
* desired behaviours that affect server state. Costs, mod game modes, stuff like that
|
||||
* can be changed here.
|
||||
*
|
||||
* @param parentScreen The screen to which must be returned when closing the
|
||||
* returned screen.
|
||||
* @return A class that will be instantiated on clicks on the config button
|
||||
* or null if no GUI is desired.
|
||||
*/
|
||||
@Override
|
||||
public GuiScreen createConfigGui( GuiScreen parentScreen )
|
||||
{
|
||||
return new AEConfigGui( parentScreen );
|
||||
}
|
||||
/**
|
||||
* If this method returns false, the config button in the mod list will be disabled
|
||||
*
|
||||
* @return true if this object provides a config gui screen, false otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean hasConfigGui() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Return an initialized {@link GuiScreen}. This screen will be displayed
|
||||
* when the "config" button is pressed in the mod list. It will
|
||||
* have a single argument constructor - the "parent" screen, the same as all
|
||||
* Minecraft GUIs. The expected behaviour is that this screen will replace the
|
||||
* "mod list" screen completely, and will return to the mod list screen through
|
||||
* the parent link, once the appropriate action is taken from the config screen.
|
||||
* <p>
|
||||
* This config GUI is anticipated to provide configuration to the mod in a friendly
|
||||
* visual way. It should not be abused to set internals such as IDs (they're gonna
|
||||
* keep disappearing anyway), but rather, interesting behaviours. This config GUI
|
||||
* is never run when a server game is running, and should be used to configure
|
||||
* desired behaviours that affect server state. Costs, mod game modes, stuff like that
|
||||
* can be changed here.
|
||||
*
|
||||
* @param parentScreen The screen to which must be returned when closing the
|
||||
* returned screen.
|
||||
* @return A class that will be instantiated on clicks on the config button
|
||||
* or null if no GUI is desired.
|
||||
*/
|
||||
@Override
|
||||
public GuiScreen createConfigGui(GuiScreen parentScreen) {
|
||||
return new AEConfigGui(parentScreen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user