why does this work
This commit is contained in:
@@ -139,7 +139,7 @@ public class AssetsAnnotationProcessor extends AbstractProcessor{
|
||||
|
||||
loadBegin.addStatement("io.anuke.arc.Core.assets.load("+filename +", "+rtype+".class).loaded = a -> " + name + " = ("+rtype+")a", filepath, filepath.replace(".ogg", ".mp3"));
|
||||
|
||||
dispose.addStatement(name + ".dispose()");
|
||||
dispose.addStatement("io.anuke.arc.Core.assets.unload(" + filename + ")");
|
||||
dispose.addStatement(name + " = null");
|
||||
type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), name, Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build());
|
||||
});
|
||||
|
||||
@@ -75,6 +75,7 @@ mod.disabled = [scarlet]Disabled
|
||||
mod.disable = Disable
|
||||
mod.enable = Enable
|
||||
mod.requiresrestart = The game will now close to apply the mod changes.
|
||||
mod.reloadrequired = [scarlet]Reload Required
|
||||
mod.import = Import Mod
|
||||
mod.remove.confirm = This mod will be deleted.
|
||||
mod.author = [LIGHT_GRAY]Author:[] {0}
|
||||
|
||||
@@ -221,18 +221,26 @@ public class Mods implements Loadable{
|
||||
}
|
||||
}
|
||||
|
||||
/** Reloads all mod content.*/
|
||||
/** Reloads all mod content. How does this even work? I refuse to believe that it functions correctly.*/
|
||||
public void reloadContent(){
|
||||
//epic memory leak
|
||||
Core.atlas = new TextureAtlas(Core.files.internal("sprites/sprites.atlas"));
|
||||
Tex.load();
|
||||
Tex.loadStyles();
|
||||
Styles.load();
|
||||
loaded.clear();
|
||||
disabled.clear();
|
||||
load();
|
||||
buildFiles();
|
||||
Musics.dispose();
|
||||
Sounds.dispose();
|
||||
Musics.load();
|
||||
Sounds.load();
|
||||
Core.assets.finishLoading();
|
||||
content.clear();
|
||||
content.createContent();
|
||||
loadAsync();
|
||||
loadSync();
|
||||
buildFiles();
|
||||
content.init();
|
||||
content.load();
|
||||
content.loadColors();
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.graphics.*;
|
||||
import io.anuke.mindustry.mod.Mods.*;
|
||||
@@ -36,6 +37,8 @@ public class ModsDialog extends FloatingDialog{
|
||||
void setup(){
|
||||
cont.clear();
|
||||
cont.defaults().width(520f).pad(4);
|
||||
cont.add("$mod.reloadrequired").visible(mods::requiresReload).center().get().setAlignment(Align.center);
|
||||
cont.row();
|
||||
if(!(mods.all().isEmpty() && mods.disabled().isEmpty())){
|
||||
cont.pane(table -> {
|
||||
table.margin(10f).top();
|
||||
|
||||
Reference in New Issue
Block a user