update
This commit is contained in:
@@ -16,14 +16,12 @@ import mindustry.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.desktop.steam.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.net.*;
|
||||
import mindustry.net.Net.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -307,23 +305,7 @@ public class DesktopLauncher extends ClientLauncher{
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
|
||||
NetworkInterface out;
|
||||
for(out = e.nextElement(); (out.getHardwareAddress() == null || out.isVirtual() || !validAddress(out.getHardwareAddress())) && e.hasMoreElements(); out = e.nextElement());
|
||||
|
||||
byte[] bytes = out.getHardwareAddress();
|
||||
byte[] result = new byte[8];
|
||||
System.arraycopy(bytes, 0, result, 0, bytes.length);
|
||||
|
||||
String str = new String(Base64Coder.encode(result));
|
||||
|
||||
if(str.equals("AAAAAAAAAOA=") || str.equals("AAAAAAAAAAA=")) throw new RuntimeException("Bad UUID.");
|
||||
|
||||
return str;
|
||||
}catch(Exception e){
|
||||
return super.getUUID();
|
||||
}
|
||||
return super.getUUID();
|
||||
}
|
||||
|
||||
private static void message(String message){
|
||||
|
||||
@@ -86,13 +86,14 @@ public class SStats implements SteamUserStatsCallback{
|
||||
}
|
||||
});
|
||||
|
||||
//TODO achievement invalid
|
||||
Events.on(ZoneConfigureCompleteEvent.class, e -> {
|
||||
if(!content.sectors().contains(z -> !z.canConfigure())){
|
||||
configAllZones.complete();
|
||||
}
|
||||
//if(!content.sectors().contains(z -> !z.canConfigure())){
|
||||
// configAllZones.complete();
|
||||
//}
|
||||
});
|
||||
|
||||
Events.on(Trigger.newGame, () -> Core.app.post(() -> {
|
||||
Events.run(Trigger.newGame, () -> Core.app.post(() -> {
|
||||
if(campaign() && player.core() != null && player.core().items.total() >= 10 * 1000){
|
||||
drop10kitems.complete();
|
||||
}
|
||||
@@ -152,11 +153,11 @@ public class SStats implements SteamUserStatsCallback{
|
||||
}
|
||||
});
|
||||
|
||||
Events.on(Trigger.openWiki, openWiki::complete);
|
||||
Events.run(Trigger.openWiki, openWiki::complete);
|
||||
|
||||
Events.on(Trigger.exclusionDeath, dieExclusion::complete);
|
||||
Events.run(Trigger.exclusionDeath, dieExclusion::complete);
|
||||
|
||||
Events.on(Trigger.drown, drown::complete);
|
||||
Events.run(Trigger.drown, drown::complete);
|
||||
|
||||
trigger(Trigger.impactPower, powerupImpactReactor);
|
||||
|
||||
@@ -166,9 +167,9 @@ public class SStats implements SteamUserStatsCallback{
|
||||
|
||||
trigger(Trigger.suicideBomb, suicideBomb);
|
||||
|
||||
Events.on(Trigger.enablePixelation, enablePixelation::complete);
|
||||
Events.run(Trigger.enablePixelation, enablePixelation::complete);
|
||||
|
||||
Events.on(Trigger.thoriumReactorOverheat, () -> {
|
||||
Events.run(Trigger.thoriumReactorOverheat, () -> {
|
||||
if(campaign()){
|
||||
SStat.reactorsOverheated.add();
|
||||
}
|
||||
@@ -263,7 +264,7 @@ public class SStats implements SteamUserStatsCallback{
|
||||
}
|
||||
|
||||
private void trigger(Trigger trigger, SAchievement ach){
|
||||
Events.on(trigger, () -> {
|
||||
Events.run(trigger, () -> {
|
||||
if(campaign()){
|
||||
ach.complete();
|
||||
}
|
||||
|
||||
@@ -96,36 +96,36 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
if(details.getResult() == SteamResult.OK){
|
||||
if(details.getOwnerID().equals(SVars.user.user.getSteamID())){
|
||||
|
||||
BaseDialog dialog = new BaseDialog("$workshop.info");
|
||||
BaseDialog dialog = new BaseDialog("@workshop.info");
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.add("$workshop.menu").pad(20f);
|
||||
dialog.cont.add("@workshop.menu").pad(20f);
|
||||
dialog.addCloseButton();
|
||||
|
||||
dialog.buttons.button("$view.workshop", Icon.link, () -> {
|
||||
dialog.buttons.button("@view.workshop", Icon.link, () -> {
|
||||
viewListingID(id);
|
||||
dialog.hide();
|
||||
}).size(210f, 64f);
|
||||
|
||||
dialog.buttons.button("$workshop.update", Icon.up, () -> {
|
||||
new BaseDialog("$workshop.update"){{
|
||||
dialog.buttons.button("@workshop.update", Icon.up, () -> {
|
||||
new BaseDialog("@workshop.update"){{
|
||||
setFillParent(false);
|
||||
cont.margin(10).add("$changelog").padRight(6f);
|
||||
cont.margin(10).add("@changelog").padRight(6f);
|
||||
cont.row();
|
||||
TextArea field = cont.area("", t -> {}).size(500f, 160f).get();
|
||||
field.setMaxLength(400);
|
||||
buttons.defaults().size(120, 54).pad(4);
|
||||
buttons.button("$ok", () -> {
|
||||
buttons.button("@ok", () -> {
|
||||
if(!p.prePublish()){
|
||||
Log.info("Rejecting due to pre-publish.");
|
||||
return;
|
||||
}
|
||||
|
||||
ui.loadfrag.show("$publishing");
|
||||
ui.loadfrag.show("@publishing");
|
||||
updateItem(p, field.getText().replace("\r", "\n"));
|
||||
dialog.hide();
|
||||
hide();
|
||||
});
|
||||
buttons.button("$cancel", this::hide);
|
||||
buttons.button("@cancel", this::hide);
|
||||
}}.show();
|
||||
|
||||
}).size(210f, 64f);
|
||||
@@ -135,7 +135,7 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
}
|
||||
}else if(details.getResult() == SteamResult.FileNotFound){
|
||||
p.removeSteamID();
|
||||
ui.showErrorMessage("$missing");
|
||||
ui.showErrorMessage("@missing");
|
||||
}else{
|
||||
ui.showErrorMessage(Core.bundle.format("workshop.error", details.getResult().name()));
|
||||
}
|
||||
@@ -177,19 +177,19 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
}
|
||||
|
||||
void showPublish(Cons<SteamPublishedFileID> published){
|
||||
BaseDialog dialog = new BaseDialog("$confirm");
|
||||
BaseDialog dialog = new BaseDialog("@confirm");
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.add("$publish.confirm").width(600f).wrap();
|
||||
dialog.cont.add("@publish.confirm").width(600f).wrap();
|
||||
dialog.addCloseButton();
|
||||
dialog.buttons.button("$eula", Icon.link,
|
||||
dialog.buttons.button("@eula", Icon.link,
|
||||
() -> SVars.net.friends.activateGameOverlayToWebPage("https://steamcommunity.com/sharedfiles/workshoplegalagreement"))
|
||||
.size(210f, 64f);
|
||||
|
||||
dialog.buttons.button("$ok", Icon.ok, () -> {
|
||||
dialog.buttons.button("@ok", Icon.ok, () -> {
|
||||
Log.info("Accepted, publishing item...");
|
||||
itemHandlers.add(published);
|
||||
ugc.createItem(SVars.steamID, WorkshopFileType.Community);
|
||||
ui.loadfrag.show("$publishing");
|
||||
ui.loadfrag.show("@publishing");
|
||||
dialog.hide();
|
||||
}).size(170f, 64f);
|
||||
dialog.show();
|
||||
@@ -213,9 +213,9 @@ public class SWorkshop implements SteamUGCCallback{
|
||||
|
||||
ui.loadfrag.setProgress(() -> {
|
||||
ItemUpdateStatus status = ugc.getItemUpdateProgress(h, info);
|
||||
ui.loadfrag.setText("$" + status.name().toLowerCase());
|
||||
ui.loadfrag.setText("@" + status.name().toLowerCase());
|
||||
if(status == ItemUpdateStatus.Invalid){
|
||||
ui.loadfrag.setText("$done");
|
||||
ui.loadfrag.setText("@done");
|
||||
return 1f;
|
||||
}
|
||||
return (float)status.ordinal() / (float)ItemUpdateStatus.values().length;
|
||||
|
||||
Reference in New Issue
Block a user