mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 23:28:52 +07:00
More cleanup
This commit is contained in:
parent
e043f4bb66
commit
bcc8f65ac8
@ -123,7 +123,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
for(ApplicationListener listener : modules){
|
||||
listener.init();
|
||||
}
|
||||
mods.each(Mod::init);
|
||||
mods.eachClass(Mod::init);
|
||||
finished = true;
|
||||
Events.fire(new ClientLoadEvent());
|
||||
super.resize(graphics.getWidth(), graphics.getHeight());
|
||||
|
@ -243,13 +243,16 @@ public class Mods implements Loadable{
|
||||
}
|
||||
|
||||
resolveModState();
|
||||
|
||||
//sort mods to make sure servers handle them properly.
|
||||
mods.sort(Structs.comparing(m -> m.name));
|
||||
sortMods();
|
||||
|
||||
buildFiles();
|
||||
}
|
||||
|
||||
private void sortMods(){
|
||||
//sort mods to make sure servers handle them properly.
|
||||
mods.sort(Structs.comps(Structs.comparingInt(m -> -m.state.ordinal()), Structs.comparing(m -> m.name)));
|
||||
}
|
||||
|
||||
private void resolveModState(){
|
||||
mods.each(this::updateDependencies);
|
||||
|
||||
@ -483,6 +486,7 @@ public class Mods implements Loadable{
|
||||
requiresReload = true;
|
||||
mod.state = enabled ? ModState.enabled : ModState.disabled;
|
||||
mods.each(this::updateDependencies);
|
||||
sortMods();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@ package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.Net.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.files.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.arc.util.io.*;
|
||||
@ -110,11 +109,10 @@ public class ModsDialog extends FloatingDialog{
|
||||
if(!mods.list().isEmpty()){
|
||||
cont.pane(table -> {
|
||||
table.margin(10f).top();
|
||||
Array<LoadedMod> all = Array.withArrays(mods.all(), mods.disabled());
|
||||
|
||||
boolean anyDisabled = false;
|
||||
for(LoadedMod mod : all){
|
||||
if(!mod.enabled() && !anyDisabled && mods.all().size > 0){
|
||||
for(LoadedMod mod : mods.list()){
|
||||
if(!mod.enabled() && !anyDisabled && mods.list().size > 0){
|
||||
anyDisabled = true;
|
||||
table.row();
|
||||
table.addImage().growX().height(4f).pad(6f).color(Pal.gray);
|
||||
|
Loading…
Reference in New Issue
Block a user