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