@@ -165,6 +165,7 @@ const SectorInvasionEvent = Packages.mindustry.game.EventType.SectorInvasionEven
|
|||||||
const SectorLoseEvent = Packages.mindustry.game.EventType.SectorLoseEvent
|
const SectorLoseEvent = Packages.mindustry.game.EventType.SectorLoseEvent
|
||||||
const WorldLoadEvent = Packages.mindustry.game.EventType.WorldLoadEvent
|
const WorldLoadEvent = Packages.mindustry.game.EventType.WorldLoadEvent
|
||||||
const ClientLoadEvent = Packages.mindustry.game.EventType.ClientLoadEvent
|
const ClientLoadEvent = Packages.mindustry.game.EventType.ClientLoadEvent
|
||||||
|
const ContentInitEvent = Packages.mindustry.game.EventType.ContentInitEvent
|
||||||
const BlockInfoEvent = Packages.mindustry.game.EventType.BlockInfoEvent
|
const BlockInfoEvent = Packages.mindustry.game.EventType.BlockInfoEvent
|
||||||
const CoreItemDeliverEvent = Packages.mindustry.game.EventType.CoreItemDeliverEvent
|
const CoreItemDeliverEvent = Packages.mindustry.game.EventType.CoreItemDeliverEvent
|
||||||
const TurretAmmoDeliverEvent = Packages.mindustry.game.EventType.TurretAmmoDeliverEvent
|
const TurretAmmoDeliverEvent = Packages.mindustry.game.EventType.TurretAmmoDeliverEvent
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.core;
|
package mindustry.core;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.files.*;
|
import arc.files.*;
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
@@ -7,8 +8,10 @@ import arc.struct.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.ctype.*;
|
||||||
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.entities.bullet.*;
|
import mindustry.entities.bullet.*;
|
||||||
import mindustry.mod.Mods.*;
|
import mindustry.mod.Mods.*;
|
||||||
|
import mindustry.net.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
@@ -97,6 +100,7 @@ public class ContentLoader{
|
|||||||
public void init(){
|
public void init(){
|
||||||
initialize(Content::init);
|
initialize(Content::init);
|
||||||
if(constants != null) constants.init();
|
if(constants != null) constants.init();
|
||||||
|
Events.fire(new ContentInitEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Calls Content#load() on everything. Use only after all modules have been created on the client.*/
|
/** Calls Content#load() on everything. Use only after all modules have been created on the client.*/
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
net.dispose();
|
net.dispose();
|
||||||
Musics.dispose();
|
Musics.dispose();
|
||||||
Sounds.dispose();
|
Sounds.dispose();
|
||||||
ui.editor.dispose();
|
if(ui != null && ui.editor != null) ui.editor.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -111,7 +111,10 @@ public class Renderer implements ApplicationListener{
|
|||||||
minimap.dispose();
|
minimap.dispose();
|
||||||
effectBuffer.dispose();
|
effectBuffer.dispose();
|
||||||
blocks.dispose();
|
blocks.dispose();
|
||||||
planets.dispose();
|
if(planets != null){
|
||||||
|
planets.dispose();
|
||||||
|
planets = null;
|
||||||
|
}
|
||||||
if(bloom != null){
|
if(bloom != null){
|
||||||
bloom.dispose();
|
bloom.dispose();
|
||||||
bloom = null;
|
bloom = null;
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public class EventType{
|
|||||||
public static class CoreItemDeliverEvent{}
|
public static class CoreItemDeliverEvent{}
|
||||||
/** Called when the player opens info for a specific block.*/
|
/** Called when the player opens info for a specific block.*/
|
||||||
public static class BlockInfoEvent{}
|
public static class BlockInfoEvent{}
|
||||||
|
/** Called *after* all content has been initialized. */
|
||||||
|
public static class ContentInitEvent{}
|
||||||
/** Called when the client game is first loaded. */
|
/** Called when the client game is first loaded. */
|
||||||
public static class ClientLoadEvent{}
|
public static class ClientLoadEvent{}
|
||||||
/** Called when a game begins and the world is loaded. */
|
/** Called when a game begins and the world is loaded. */
|
||||||
|
|||||||
Reference in New Issue
Block a user