Add Discord link and fix more placement bugs
This commit is contained in:
@@ -4,6 +4,7 @@ A pixelated sandbox tower defense game made using [LibGDX](https://libgdx.badlog
|
|||||||
|
|
||||||
_[TODO list](TODO.md)_
|
_[TODO list](TODO.md)_
|
||||||
_[Wiki](http://mindustry.wikia.com/wiki/Mindustry_Wiki)_
|
_[Wiki](http://mindustry.wikia.com/wiki/Mindustry_Wiki)_
|
||||||
|
_[Discord](https://discord.gg/r8BkXNd)_
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.anuke.mindustry"
|
package="io.anuke.mindustry"
|
||||||
android:versionCode="33"
|
android:versionCode="34"
|
||||||
android:versionName="3.1" >
|
android:versionName="3.1b1" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
|
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
|
|||||||
@@ -9,9 +9,11 @@ import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import io.anuke.mindustry.io.Formatter;
|
import io.anuke.mindustry.io.PlatformFunction;
|
||||||
|
import io.anuke.ucore.function.Callable;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class AndroidLauncher extends AndroidApplication{
|
public class AndroidLauncher extends AndroidApplication{
|
||||||
@@ -24,7 +26,8 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||||
config.useImmersiveMode = true;
|
config.useImmersiveMode = true;
|
||||||
|
|
||||||
Mindustry.formatter = new Formatter(){
|
Mindustry.hasDiscord = isPackageInstalled("com.discord");
|
||||||
|
Mindustry.platforms = new PlatformFunction(){
|
||||||
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");
|
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -36,9 +39,16 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
public String format(int number){
|
public String format(int number){
|
||||||
return NumberFormat.getIntegerInstance().format(number);
|
return NumberFormat.getIntegerInstance().format(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openLink(String link){
|
||||||
|
Uri marketUri = Uri.parse(link);
|
||||||
|
Intent intent = new Intent( Intent.ACTION_VIEW, marketUri );
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Mindustry.donationsCallable = this::showDonations;
|
Mindustry.donationsCallable = new Callable(){ @Override public void run(){ showDonations(); } };
|
||||||
|
|
||||||
if(doubleScaleTablets){
|
if(doubleScaleTablets){
|
||||||
DisplayMetrics metrics = new DisplayMetrics();
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
@@ -63,6 +73,15 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
initialize(new Mindustry(), config);
|
initialize(new Mindustry(), config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isPackageInstalled(String packagename) {
|
||||||
|
try {
|
||||||
|
getPackageManager().getPackageInfo(packagename, 0);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void showDonations(){
|
void showDonations(){
|
||||||
Intent intent = new Intent(this, DonationsActivity.class);
|
Intent intent = new Intent(this, DonationsActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ project(":core") {
|
|||||||
apply plugin: "java"
|
apply plugin: "java"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.github.Anuken:ucore:5984abc'
|
compile 'com.github.anuken:ucore:d56206b7c0'
|
||||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||||
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
core/assets-raw/sprites/ui/icon-discord.png
Normal file
BIN
core/assets-raw/sprites/ui/icon-discord.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 214 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
@@ -6,7 +6,7 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
|
|
||||||
import io.anuke.mindustry.core.*;
|
import io.anuke.mindustry.core.*;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.io.Formatter;
|
import io.anuke.mindustry.io.PlatformFunction;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
import io.anuke.ucore.core.Inputs;
|
import io.anuke.ucore.core.Inputs;
|
||||||
@@ -16,10 +16,12 @@ import io.anuke.ucore.modules.ModuleCore;
|
|||||||
|
|
||||||
public class Mindustry extends ModuleCore {
|
public class Mindustry extends ModuleCore {
|
||||||
public static Callable donationsCallable;
|
public static Callable donationsCallable;
|
||||||
|
public static boolean hasDiscord = true;
|
||||||
public static Array<String> args = new Array<>();
|
public static Array<String> args = new Array<>();
|
||||||
public static Formatter formatter = new Formatter(){
|
public static PlatformFunction platforms = new PlatformFunction(){
|
||||||
@Override public String format(Date date){ return "invalid date"; }
|
@Override public String format(Date date){ return "invalid date"; }
|
||||||
@Override public String format(int number){ return number + ""; }
|
@Override public String format(int number){ return number + ""; }
|
||||||
|
@Override public void openLink(String link){ }
|
||||||
};
|
};
|
||||||
|
|
||||||
//always initialize blocks in this order, otherwise there are ID errors
|
//always initialize blocks in this order, otherwise there are ID errors
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import io.anuke.mindustry.entities.Player;
|
|||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class Vars{
|
public class Vars{
|
||||||
public static final boolean testAndroid = true;
|
public static final boolean testAndroid = false;
|
||||||
//shorthand for whether or not this is running on android
|
//shorthand for whether or not this is running on android
|
||||||
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid;
|
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid;
|
||||||
//shorthand for whether or not this is running on GWT
|
//shorthand for whether or not this is running on GWT
|
||||||
@@ -26,6 +26,8 @@ public class Vars{
|
|||||||
public static final float aheadPathfinding = 60*20;
|
public static final float aheadPathfinding = 60*20;
|
||||||
//how far away from spawn points the player can't place blocks
|
//how far away from spawn points the player can't place blocks
|
||||||
public static final float enemyspawnspace = 65;
|
public static final float enemyspawnspace = 65;
|
||||||
|
//discord group URL
|
||||||
|
public static final String discordURL = "https://discord.gg/r8BkXNd";
|
||||||
//scale of the font
|
//scale of the font
|
||||||
public static float fontscale = Unit.dp.inPixels(1f)/2f;
|
public static float fontscale = Unit.dp.inPixels(1f)/2f;
|
||||||
//camera zoom displayed on startup
|
//camera zoom displayed on startup
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class Tutorial{
|
|||||||
|
|
||||||
new table("pane"){{
|
new table("pane"){{
|
||||||
atop();
|
atop();
|
||||||
get().pad(Unit.dp.inPixels(12));
|
margin(12);
|
||||||
|
|
||||||
info = new label(()->stage.text).pad(10f).padBottom(5f).width(340f).units(Unit.dp).colspan(2).get();
|
info = new label(()->stage.text).pad(10f).padBottom(5f).width(340f).units(Unit.dp).colspan(2).get();
|
||||||
info.setWrap(true);
|
info.setWrap(true);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.badlogic.gdx.math.Vector2;
|
|||||||
import com.badlogic.gdx.utils.Align;
|
import com.badlogic.gdx.utils.Align;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
@@ -37,7 +38,7 @@ public class UI extends SceneModule{
|
|||||||
Table loadingtable, desctable, configtable;
|
Table loadingtable, desctable, configtable;
|
||||||
MindustrySettingsDialog prefs;
|
MindustrySettingsDialog prefs;
|
||||||
MindustryKeybindDialog keys;
|
MindustryKeybindDialog keys;
|
||||||
Dialog about, restart, levels, upgrades, load, settingserror, gameerror;
|
Dialog about, restart, levels, upgrades, load, settingserror, gameerror, discord;
|
||||||
MenuDialog menu;
|
MenuDialog menu;
|
||||||
Tooltip tooltip;
|
Tooltip tooltip;
|
||||||
Tile configTile;
|
Tile configTile;
|
||||||
@@ -170,9 +171,16 @@ public class UI extends SceneModule{
|
|||||||
+ "\n[ORANGE]anukendev@gmail.com[]"){{
|
+ "\n[ORANGE]anukendev@gmail.com[]"){{
|
||||||
setWrap(true);
|
setWrap(true);
|
||||||
}}).width(600f).units(Unit.dp).pad(10f);
|
}}).width(600f).units(Unit.dp).pad(10f);
|
||||||
gameerror.buttons().addButton("OK", ()-> gameerror.hide()).size(200f, 50).units(Unit.dp);
|
gameerror.buttons().addButton("OK", gameerror::hide).size(200f, 50).units(Unit.dp);
|
||||||
//gameerror.setFillParent(true);
|
//gameerror.setFillParent(true);
|
||||||
|
|
||||||
|
discord = new Dialog("Discord", "dialog");
|
||||||
|
discord.content().pad(Unit.dp.inPixels(12f));
|
||||||
|
discord.content().add("Join the mindustry discord!\n[orange]" + Vars.discordURL);
|
||||||
|
discord.buttons().defaults().size(200f, 50).units(Unit.dp);
|
||||||
|
discord.buttons().addButton("Open link", () -> Mindustry.platforms.openLink(Vars.discordURL));
|
||||||
|
discord.buttons().addButton("Back", discord::hide);
|
||||||
|
|
||||||
load = new LoadDialog();
|
load = new LoadDialog();
|
||||||
|
|
||||||
upgrades = new UpgradeDialog();
|
upgrades = new UpgradeDialog();
|
||||||
@@ -427,6 +435,10 @@ public class UI extends SceneModule{
|
|||||||
upgrades.show();
|
upgrades.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showDiscord(){
|
||||||
|
discord.show();
|
||||||
|
}
|
||||||
|
|
||||||
public void updateItems(){
|
public void updateItems(){
|
||||||
((HudFragment)hudfrag).updateItems();
|
((HudFragment)hudfrag).updateItems();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class EditorUI extends SceneModule{
|
|||||||
}).left();
|
}).left();
|
||||||
row();
|
row();
|
||||||
}
|
}
|
||||||
get().pad(16);
|
margin(16);
|
||||||
}}.end();
|
}}.end();
|
||||||
}}.end();
|
}}.end();
|
||||||
build.end();
|
build.end();
|
||||||
|
|||||||
@@ -313,10 +313,7 @@ public class Fx{
|
|||||||
breakBlock = new Effect(12, e -> {
|
breakBlock = new Effect(12, e -> {
|
||||||
Draw.thickness(2f);
|
Draw.thickness(2f);
|
||||||
Draw.color(Color.WHITE, Colors.get("break"), e.ifract());
|
Draw.color(Color.WHITE, Colors.get("break"), e.ifract());
|
||||||
Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 5, 90);
|
Draw.spikes(e.x, e.y, e.ifract() * 6f, 2, 5, 90);
|
||||||
|
|
||||||
Draw.thickness(2f - e.ifract() * 2f);
|
|
||||||
Draw.polygon(4, e.x, e.y, Vars.tilesize / 1.6f + e.ifract() * 5f, 45);
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ package io.anuke.mindustry.io;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public interface Formatter{
|
public interface PlatformFunction{
|
||||||
public String format(Date date);
|
public String format(Date date);
|
||||||
public String format(int number);
|
public String format(int number);
|
||||||
|
public void openLink(String link);
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ public class SaveIO{
|
|||||||
try(DataInputStream stream = new DataInputStream(fileFor(slot).read())){
|
try(DataInputStream stream = new DataInputStream(fileFor(slot).read())){
|
||||||
stream.readInt();
|
stream.readInt();
|
||||||
Date date = new Date(stream.readLong());
|
Date date = new Date(stream.readLong());
|
||||||
return Mindustry.formatter.format(date);
|
return Mindustry.platforms.format(date);
|
||||||
}catch (IOException e){
|
}catch (IOException e){
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class BlocksFragment implements Fragment{
|
|||||||
|
|
||||||
row();
|
row();
|
||||||
add(stack).colspan(Section.values().length);
|
add(stack).colspan(Section.values().length);
|
||||||
get().pad(10f);
|
margin(10f);
|
||||||
|
|
||||||
get().padLeft(0f);
|
get().padLeft(0f);
|
||||||
get().padRight(0f);
|
get().padRight(0f);
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public class HudFragment implements Fragment{
|
|||||||
(control.getTutorial().active() || Vars.control.getMode() == GameMode.sandbox) ? "waiting..." : "Wave in " + (int) (control.getWaveCountdown() / 60f))
|
(control.getTutorial().active() || Vars.control.getMode() == GameMode.sandbox) ? "waiting..." : "Wave in " + (int) (control.getWaveCountdown() / 60f))
|
||||||
.minWidth(140).units(Unit.dp).left();
|
.minWidth(140).units(Unit.dp).left();
|
||||||
|
|
||||||
get().pad(Unit.dp.inPixels(12));
|
margin(12f);
|
||||||
get().padLeft(6);
|
get().padLeft(6);
|
||||||
}}.left().end();
|
}}.left().end();
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ public class HudFragment implements Fragment{
|
|||||||
for(int i = 0; i < control.getItems().length; i ++){
|
for(int i = 0; i < control.getItems().length; i ++){
|
||||||
int amount = control.getItems()[i];
|
int amount = control.getItems()[i];
|
||||||
if(amount == 0) continue;
|
if(amount == 0) continue;
|
||||||
String formatted = Mindustry.formatter.format(amount);
|
String formatted = Mindustry.platforms.format(amount);
|
||||||
if(amount > 99999999){
|
if(amount > 99999999){
|
||||||
formatted = "inf";
|
formatted = "inf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package io.anuke.mindustry.ui.fragments;
|
package io.anuke.mindustry.ui.fragments;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
|
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
@@ -14,6 +12,11 @@ import io.anuke.ucore.scene.builders.imagebutton;
|
|||||||
import io.anuke.ucore.scene.builders.table;
|
import io.anuke.ucore.scene.builders.table;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.android;
|
||||||
|
import static io.anuke.mindustry.Vars.control;
|
||||||
|
import static io.anuke.mindustry.Vars.gwt;
|
||||||
|
import static io.anuke.mindustry.Vars.ui;
|
||||||
|
|
||||||
public class MenuFragment implements Fragment{
|
public class MenuFragment implements Fragment{
|
||||||
|
|
||||||
public void build(){
|
public void build(){
|
||||||
@@ -77,9 +80,14 @@ public class MenuFragment implements Fragment{
|
|||||||
//settings icon
|
//settings icon
|
||||||
new table(){{
|
new table(){{
|
||||||
atop().aright();
|
atop().aright();
|
||||||
|
if(Mindustry.hasDiscord){
|
||||||
|
new imagebutton("icon-discord", Unit.dp.inPixels(30f), ()->{
|
||||||
|
ui.showDiscord();
|
||||||
|
}).margin(14);
|
||||||
|
}
|
||||||
new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{
|
new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{
|
||||||
ui.showAbout();
|
ui.showAbout();
|
||||||
}).get().pad(Unit.dp.inPixels(14));
|
}).margin(14);
|
||||||
}}.end().visible(()->GameState.is(State.menu));
|
}}.end().visible(()->GameState.is(State.menu));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class PlacementFragment implements Fragment{
|
|||||||
row();
|
row();
|
||||||
|
|
||||||
new table("pane"){{
|
new table("pane"){{
|
||||||
get().pad(5);
|
margin(5f);
|
||||||
aleft();
|
aleft();
|
||||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ public class PlacementFragment implements Fragment{
|
|||||||
row();
|
row();
|
||||||
|
|
||||||
new table("pane"){{
|
new table("pane"){{
|
||||||
get().pad(5);
|
margin(5f);
|
||||||
touchable(Touchable.enabled);
|
touchable(Touchable.enabled);
|
||||||
aleft();
|
aleft();
|
||||||
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
ButtonGroup<ImageButton> group = new ButtonGroup<>();
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package io.anuke.mindustry.desktop;
|
package io.anuke.mindustry.desktop;
|
||||||
|
|
||||||
|
import java.awt.Desktop;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URI;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -9,7 +12,8 @@ import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
|
|||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.io.Formatter;
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.mindustry.io.PlatformFunction;
|
||||||
|
|
||||||
public class DesktopLauncher {
|
public class DesktopLauncher {
|
||||||
|
|
||||||
@@ -21,7 +25,7 @@ public class DesktopLauncher {
|
|||||||
config.setWindowIcon("sprites/icon.png");
|
config.setWindowIcon("sprites/icon.png");
|
||||||
//config.useVsync(false);
|
//config.useVsync(false);
|
||||||
|
|
||||||
Mindustry.formatter = new Formatter(){
|
Mindustry.platforms = new PlatformFunction(){
|
||||||
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");
|
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -33,6 +37,16 @@ public class DesktopLauncher {
|
|||||||
public String format(int number){
|
public String format(int number){
|
||||||
return NumberFormat.getIntegerInstance().format(number);
|
return NumberFormat.getIntegerInstance().format(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openLink(String link){
|
||||||
|
try{
|
||||||
|
Desktop.getDesktop().browse(URI.create(link));
|
||||||
|
}catch(IOException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
Vars.ui.showError("Error opening link.");
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Mindustry.args = Array.with(arg);
|
Mindustry.args = Array.with(arg);
|
||||||
|
|||||||
@@ -12,10 +12,11 @@ import com.google.gwt.dom.client.*;
|
|||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.i18n.client.NumberFormat;
|
import com.google.gwt.i18n.client.NumberFormat;
|
||||||
import com.google.gwt.i18n.shared.DateTimeFormat;
|
import com.google.gwt.i18n.shared.DateTimeFormat;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.ui.*;
|
import com.google.gwt.user.client.ui.*;
|
||||||
|
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.io.Formatter;
|
import io.anuke.mindustry.io.PlatformFunction;
|
||||||
|
|
||||||
public class HtmlLauncher extends GwtApplication {
|
public class HtmlLauncher extends GwtApplication {
|
||||||
static final int WIDTH = 800;
|
static final int WIDTH = 800;
|
||||||
@@ -88,7 +89,7 @@ public class HtmlLauncher extends GwtApplication {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Mindustry.formatter = new Formatter(){
|
Mindustry.platforms = new PlatformFunction(){
|
||||||
DateTimeFormat format = DateTimeFormat.getFormat("EEE, dd MMM yyyy HH:mm:ss");
|
DateTimeFormat format = DateTimeFormat.getFormat("EEE, dd MMM yyyy HH:mm:ss");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -100,6 +101,11 @@ public class HtmlLauncher extends GwtApplication {
|
|||||||
public String format(int number){
|
public String format(int number){
|
||||||
return NumberFormat.getDecimalFormat().format(number);
|
return NumberFormat.getDecimalFormat().format(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void openLink(String link){
|
||||||
|
Window.open(link, "_blank", "");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return new Mindustry();
|
return new Mindustry();
|
||||||
|
|||||||
Reference in New Issue
Block a user