This commit is contained in:
Anuken
2019-10-21 18:55:01 -04:00
parent 181c418cea
commit 4f6bd5b684
2 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
package io.anuke.mindustry.editor; package io.anuke.mindustry.editor;
import io.anuke.arc.Core; import io.anuke.arc.*;
import io.anuke.arc.collection.IntSet; import io.anuke.arc.collection.IntSet;
import io.anuke.arc.collection.IntSet.IntSetIterator; import io.anuke.arc.collection.IntSet.IntSetIterator;
import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.Color;
@@ -10,6 +10,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf; import io.anuke.arc.math.Mathf;
import io.anuke.arc.util.*; import io.anuke.arc.util.*;
import io.anuke.mindustry.content.Blocks; import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.graphics.IndexedRenderer; import io.anuke.mindustry.graphics.IndexedRenderer;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
@@ -29,7 +30,11 @@ public class MapRenderer implements Disposable{
public MapRenderer(MapEditor editor){ public MapRenderer(MapEditor editor){
this.editor = editor; this.editor = editor;
this.texture = Core.atlas.find("clear-editor").getTexture();
Events.on(ContentReloadEvent.class, e -> {
texture = Core.atlas.find("clear-editor").getTexture(); texture = Core.atlas.find("clear-editor").getTexture();
});
} }
public void resize(int width, int height){ public void resize(int width, int height){

View File

@@ -15,6 +15,7 @@ import io.anuke.arc.util.*;
import io.anuke.arc.util.io.*; import io.anuke.arc.util.io.*;
import io.anuke.arc.util.serialization.*; import io.anuke.arc.util.serialization.*;
import io.anuke.mindustry.game.*; import io.anuke.mindustry.game.*;
import io.anuke.mindustry.game.EventType.*;
import io.anuke.mindustry.gen.*; import io.anuke.mindustry.gen.*;
import io.anuke.mindustry.plugin.*; import io.anuke.mindustry.plugin.*;
import io.anuke.mindustry.type.*; import io.anuke.mindustry.type.*;
@@ -154,6 +155,7 @@ public class Mods implements Loadable{
mod.file.delete(); mod.file.delete();
} }
loaded.remove(mod); loaded.remove(mod);
disabled.remove(mod);
requiresReload = true; requiresReload = true;
} }
@@ -244,7 +246,9 @@ public class Mods implements Loadable{
/** Reloads all mod content. How does this even work? I refuse to believe that it functions correctly.*/ /** Reloads all mod content. How does this even work? I refuse to believe that it functions correctly.*/
public void reloadContent(){ public void reloadContent(){
//epic memory leak //epic memory leak
//TODO make it less epic
Core.atlas = new TextureAtlas(Core.files.internal("sprites/sprites.atlas")); Core.atlas = new TextureAtlas(Core.files.internal("sprites/sprites.atlas"));
loaded.clear(); loaded.clear();
disabled.clear(); disabled.clear();
load(); load();
@@ -263,6 +267,8 @@ public class Mods implements Loadable{
content.loadColors(); content.loadColors();
data.load(); data.load();
requiresReload = false; requiresReload = false;
Events.fire(new ContentReloadEvent());
} }
/** Creates all the content found in mod files. */ /** Creates all the content found in mod files. */