Event things

This commit is contained in:
Anuken
2020-08-04 15:14:01 -04:00
parent 0d4e75fc42
commit b11908f509
9 changed files with 72 additions and 84 deletions

View File

@@ -171,7 +171,7 @@ public class Control implements ApplicationListener, Loadable{
}
});
Events.on(Trigger.newGame, () -> {
Events.run(Trigger.newGame, () -> {
Building core = player.closestCore();
if(core == null) return;

View File

@@ -2,7 +2,6 @@ package mindustry.mod;
import arc.*;
import arc.files.*;
import arc.func.*;
import arc.struct.*;
import arc.util.*;
import arc.util.Log.*;
@@ -76,10 +75,6 @@ public class Scripts implements Disposable{
//utility mod functions
public <T> void onEvent(Class<T> type, Cons<T> listener){
Events.on(type, listener);
}
public String readString(String path){
return Vars.tree.get(path, true).readString();
}

View File

@@ -241,7 +241,7 @@ public class HudFragment extends Fragment{
float[] coreAttackTime = {0};
float[] coreAttackOpacity = {0};
Events.on(Trigger.teamCoreDamage, () -> {
Events.run(Trigger.teamCoreDamage, () -> {
coreAttackTime[0] = notifDuration;
});