mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-09-23 14:27:56 +03:00
Merge branch 'master' of https://github.com/Anuken/Mindustry into 4.0
# Conflicts: # core/assets/sprites/sprites.atlas # core/assets/version.properties
This commit is contained in:
commit
9c05ddbd7d
@ -108,21 +108,6 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
String s = Secure.getString(getContext().getContentResolver(),
|
String s = Secure.getString(getContext().getContentResolver(),
|
||||||
Secure.ANDROID_ID);
|
Secure.ANDROID_ID);
|
||||||
|
|
||||||
if(s == null){
|
|
||||||
Settings.defaults("uuid", "");
|
|
||||||
|
|
||||||
String uuid = Settings.getString("uuid");
|
|
||||||
if(uuid.isEmpty()){
|
|
||||||
byte[] result = new byte[8];
|
|
||||||
new Random().nextBytes(result);
|
|
||||||
uuid = new String(Base64Coder.encode(result));
|
|
||||||
Settings.putString("uuid", uuid);
|
|
||||||
Settings.save();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return Base64Coder.decode(uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
int len = s.length();
|
int len = s.length();
|
||||||
byte[] data = new byte[len / 2];
|
byte[] data = new byte[len / 2];
|
||||||
for (int i = 0; i < len; i += 2) {
|
for (int i = 0; i < len; i += 2) {
|
||||||
@ -132,7 +117,18 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
|
|
||||||
return data;
|
return data;
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return null;
|
Settings.defaults("uuid", "");
|
||||||
|
|
||||||
|
String uuid = Settings.getString("uuid");
|
||||||
|
if(uuid.isEmpty()){
|
||||||
|
byte[] result = new byte[8];
|
||||||
|
new Random().nextBytes(result);
|
||||||
|
uuid = new String(Base64Coder.encode(result));
|
||||||
|
Settings.putString("uuid", uuid);
|
||||||
|
Settings.save();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return Base64Coder.decode(uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -25,7 +25,7 @@ allprojects {
|
|||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
aiVersion = '1.8.1'
|
aiVersion = '1.8.1'
|
||||||
uCoreVersion = '21f04f8'
|
uCoreVersion = '156dff2'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
OLD_TRAVIS_BUILD_NUMBER=`expr $TRAVIS_BUILD_NUMBER - 7`
|
|
||||||
OLD_DESKFILE=$OLD_TRAVIS_BUILD_BUMBER"-desktop-bleeding-edge.jar"
|
|
||||||
OLD_FILE1="Bleeding-Edge-Build-"$OLD_TRAVIS_BUILD_NUMBER".md"
|
|
||||||
|
|
||||||
if [ -e $OLD_FILE1 ]; then
|
|
||||||
rm -f $OLD_FILE1
|
|
||||||
rm -f $OLD_DESKFILE
|
|
||||||
git add $OLD_FILE1
|
|
||||||
git add $OLD_DESKFILE
|
|
||||||
fi
|
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
duplicatePadding: true,
|
duplicatePadding: true,
|
||||||
combineSubdirectories: true
|
combineSubdirectories: true,
|
||||||
|
flattenPaths: true
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
text.about=Created by [ROYAL]Anuken.[]\nOriginally an entry in the [orange]GDL[] MM Jam.\n\nCredits:\n- SFX made with [YELLOW]bfxr[]\n- Music made by [GREEN]RoccoW[] / found on [lime]FreeMusicArchive.org[]\n\nSpecial thanks to:\n- [coral]MitchellFJN[]: extensive playtesting and feedback\n- [sky]Luxray5474[]: wiki work, code contributions\n- All the beta testers on itch.io and Google Play\n
|
text.about=Created by [ROYAL]Anuken.[]\nOriginally an entry in the [orange]GDL[] MM Jam.\n\nCredits:\n- SFX made with [YELLOW]bfxr[]\n- Music made by [GREEN]RoccoW[] / found on [lime]FreeMusicArchive.org[]\n\nSpecial thanks to:\n- [coral]MitchellFJN[]: extensive playtesting and feedback\n- [sky]Luxray5474[]: wiki work, code contributions\n- [lime]Epowerj[]: code build system, icon\n- All the beta testers on itch.io and Google Play\n
|
||||||
text.discord=Join the mindustry discord!
|
text.discord=Join the mindustry discord!
|
||||||
text.changes=[SCARLET]Attention!\n[]Some important game mechanics have been changed.\n\n- [accent]Teleporters[] now use power.\n- [accent]Smelteries[] and [accent]crucibles[] now have a maximum item capacity.\n- [accent]Crucibles[] now require coal as fuel.
|
text.changes=[SCARLET]Attention!\n[]Some important game mechanics have been changed.\n\n- [accent]Teleporters[] now use power.\n- [accent]Smelteries[] and [accent]crucibles[] now have a maximum item capacity.\n- [accent]Crucibles[] now require coal as fuel.
|
||||||
text.gameover=The core was destroyed.
|
text.gameover=The core was destroyed.
|
||||||
@ -114,6 +114,10 @@ text.cancel=Cancel
|
|||||||
text.openlink=Open Link
|
text.openlink=Open Link
|
||||||
text.back=Back
|
text.back=Back
|
||||||
text.quit.confirm=Are you sure you want to quit?
|
text.quit.confirm=Are you sure you want to quit?
|
||||||
|
text.changelog.title=Changelog
|
||||||
|
text.changelog.error=[scarlet]Error getting changelog!\nCheck your internet connection.
|
||||||
|
text.changelog.current=[yellow][[Current version]
|
||||||
|
text.changelog.latest=[orange][[Latest version]
|
||||||
text.loading=[accent]Loading...
|
text.loading=[accent]Loading...
|
||||||
text.wave=[orange]Wave {0}
|
text.wave=[orange]Wave {0}
|
||||||
text.wave.waiting=Wave in {0}
|
text.wave.waiting=Wave in {0}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -45,7 +45,7 @@ public class Vars{
|
|||||||
//discord group URL
|
//discord group URL
|
||||||
public static final String discordURL = "https://discord.gg/BKADYds";
|
public static final String discordURL = "https://discord.gg/BKADYds";
|
||||||
|
|
||||||
public static final String serverURL = "http://localhost:3000";
|
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||||
//directory for user-created map data
|
//directory for user-created map data
|
||||||
public static final FileHandle customMapDirectory = gwt ? null : UCore.isAssets() ?
|
public static final FileHandle customMapDirectory = gwt ? null : UCore.isAssets() ?
|
||||||
Gdx.files.local("../../desktop/mindustry-maps") : Gdx.files.local("mindustry-maps/");
|
Gdx.files.local("../../desktop/mindustry-maps") : Gdx.files.local("mindustry-maps/");
|
||||||
|
@ -120,7 +120,8 @@ public class Control extends Module{
|
|||||||
"name", android || gwt ? "player" : UCore.getProperty("user.name"),
|
"name", android || gwt ? "player" : UCore.getProperty("user.name"),
|
||||||
"servers", "",
|
"servers", "",
|
||||||
"color", Color.rgba8888(playerColors[8]),
|
"color", Color.rgba8888(playerColors[8]),
|
||||||
"lastVersion", "3.2"
|
"lastVersion", "3.2",
|
||||||
|
"lastBuild", 0
|
||||||
);
|
);
|
||||||
|
|
||||||
KeyBinds.load();
|
KeyBinds.load();
|
||||||
|
@ -49,6 +49,7 @@ public class UI extends SceneModule{
|
|||||||
public BansDialog bans;
|
public BansDialog bans;
|
||||||
public AdminsDialog admins;
|
public AdminsDialog admins;
|
||||||
public TraceDialog traces;
|
public TraceDialog traces;
|
||||||
|
public ChangelogDialog changelog;
|
||||||
|
|
||||||
public final MenuFragment menufrag = new MenuFragment();
|
public final MenuFragment menufrag = new MenuFragment();
|
||||||
public final ToolFragment toolfrag = new ToolFragment();
|
public final ToolFragment toolfrag = new ToolFragment();
|
||||||
@ -159,6 +160,7 @@ public class UI extends SceneModule{
|
|||||||
bans = new BansDialog();
|
bans = new BansDialog();
|
||||||
admins = new AdminsDialog();
|
admins = new AdminsDialog();
|
||||||
traces = new TraceDialog();
|
traces = new TraceDialog();
|
||||||
|
changelog = new ChangelogDialog();
|
||||||
|
|
||||||
build.begin(scene);
|
build.begin(scene);
|
||||||
|
|
||||||
|
@ -157,7 +157,8 @@ public class DesktopInput extends InputHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean select(){
|
boolean select(){
|
||||||
return !Inputs.keyDown("select") && !Inputs.keyRelease("select");
|
return !Inputs.keyDown("select") && !Inputs.keyRelease("select") &&
|
||||||
|
!Inputs.keyDown("break") && !Inputs.keyRelease("break");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int tilex(){
|
public int tilex(){
|
||||||
|
50
core/src/io/anuke/mindustry/io/Changelogs.java
Normal file
50
core/src/io/anuke/mindustry/io/Changelogs.java
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package io.anuke.mindustry.io;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.Json;
|
||||||
|
import com.badlogic.gdx.utils.JsonValue;
|
||||||
|
import io.anuke.mindustry.net.Net;
|
||||||
|
import io.anuke.ucore.function.Consumer;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.releasesURL;
|
||||||
|
|
||||||
|
public class Changelogs {
|
||||||
|
|
||||||
|
public static void getChangelog(Consumer<Array<VersionInfo>> success, Consumer<Throwable> fail){
|
||||||
|
Net.http(releasesURL, "GET", result -> {
|
||||||
|
Json j = new Json();
|
||||||
|
Array<JsonValue> list = j.fromJson(null, result);
|
||||||
|
Array<VersionInfo> out = new Array<>();
|
||||||
|
for(JsonValue value : list){
|
||||||
|
String name = value.getString("name");
|
||||||
|
String description = value.getString("body").replace("\r", "");
|
||||||
|
int id = value.getInt("id");
|
||||||
|
int build = Integer.parseInt(value.getString("tag_name").substring(1));
|
||||||
|
out.add(new VersionInfo(name, description, id, build));
|
||||||
|
}
|
||||||
|
success.accept(out);
|
||||||
|
}, fail);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class VersionInfo{
|
||||||
|
public final String name, description;
|
||||||
|
public final int id, build;
|
||||||
|
|
||||||
|
public VersionInfo(String name, String description, int id, int build) {
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.id = id;
|
||||||
|
this.build = build;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "VersionInfo{" +
|
||||||
|
"name='" + name + '\'' +
|
||||||
|
", description='" + description + '\'' +
|
||||||
|
", id=" + id +
|
||||||
|
", build=" + build +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -248,9 +248,9 @@ public class Net{
|
|||||||
active = false;
|
active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void http(String method, String content, Consumer<String> listener){
|
public static void http(String url, String method, Consumer<String> listener, Consumer<Throwable> failure){
|
||||||
HttpRequest req = new HttpRequestBuilder().newRequest()
|
HttpRequest req = new HttpRequestBuilder().newRequest()
|
||||||
.method(method).content(content).url(serverURL + "/servers").build();
|
.method(method).url(url).build();
|
||||||
|
|
||||||
Gdx.net.sendHttpRequest(req, new HttpResponseListener() {
|
Gdx.net.sendHttpRequest(req, new HttpResponseListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -260,8 +260,7 @@ public class Net{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void failed(Throwable t) {
|
public void failed(Throwable t) {
|
||||||
Log.err("HTTP error:");
|
failure.accept(t);
|
||||||
Log.err(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
66
core/src/io/anuke/mindustry/ui/dialogs/ChangelogDialog.java
Normal file
66
core/src/io/anuke/mindustry/ui/dialogs/ChangelogDialog.java
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import io.anuke.mindustry.io.Changelogs;
|
||||||
|
import io.anuke.mindustry.io.Changelogs.VersionInfo;
|
||||||
|
import io.anuke.mindustry.io.Version;
|
||||||
|
import io.anuke.ucore.core.Settings;
|
||||||
|
import io.anuke.ucore.scene.ui.ScrollPane;
|
||||||
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
|
import io.anuke.ucore.util.Log;
|
||||||
|
|
||||||
|
public class ChangelogDialog extends FloatingDialog{
|
||||||
|
private final float vw = 600;
|
||||||
|
private Array<VersionInfo> versions;
|
||||||
|
|
||||||
|
public ChangelogDialog(){
|
||||||
|
super("$text.changelog.title");
|
||||||
|
|
||||||
|
Changelogs.getChangelog(result -> {
|
||||||
|
versions = result;
|
||||||
|
Gdx.app.postRunnable(this::setup);
|
||||||
|
}, t -> {
|
||||||
|
Log.err(t);
|
||||||
|
Gdx.app.postRunnable(this::setup);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup(){
|
||||||
|
Table table = new Table();
|
||||||
|
ScrollPane pane = new ScrollPane(table, "clear");
|
||||||
|
|
||||||
|
content().add(pane).grow();
|
||||||
|
|
||||||
|
addCloseButton();
|
||||||
|
|
||||||
|
if(versions == null){
|
||||||
|
table.add("$text.changelog.error");
|
||||||
|
}else{
|
||||||
|
for(VersionInfo info : versions){
|
||||||
|
Table in = new Table("clear");
|
||||||
|
in.top().left().margin(10);
|
||||||
|
|
||||||
|
in.add("[accent]" + info.name);
|
||||||
|
if(info.build == Version.build){
|
||||||
|
in.row();
|
||||||
|
in.add("$text.changelog.current");
|
||||||
|
}else if(info == versions.peek()){
|
||||||
|
in.row();
|
||||||
|
in.add("$text.changelog.latest");
|
||||||
|
}
|
||||||
|
in.row();
|
||||||
|
in.labelWrap("[lightgray]" + info.description).width(vw - 20).padTop(12);
|
||||||
|
|
||||||
|
table.add(in).width(vw).pad(8).row();
|
||||||
|
}
|
||||||
|
|
||||||
|
int lastid = Settings.getInt("lastBuild");
|
||||||
|
if(lastid != 0 && versions.peek().build > lastid){
|
||||||
|
Settings.putInt("lastBuild", versions.peek().build);
|
||||||
|
Settings.save();
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -89,6 +89,7 @@ public class MenuFragment implements Fragment{
|
|||||||
if(!Vars.android) {
|
if(!Vars.android) {
|
||||||
new imagebutton("icon-info", 30f, ui.about::show).margin(14);
|
new imagebutton("icon-info", 30f, ui.about::show).margin(14);
|
||||||
}
|
}
|
||||||
|
new imagebutton("icon-menu", 30f, ui.changelog::show).margin(14);
|
||||||
}}.end().visible(()->state.is(State.menu));
|
}}.end().visible(()->state.is(State.menu));
|
||||||
|
|
||||||
//version info
|
//version info
|
||||||
|
@ -8,24 +8,30 @@ git config --global user.name $GHUSERNAME
|
|||||||
git clone https://github.com/Anuken/Mindustry.wiki.git
|
git clone https://github.com/Anuken/Mindustry.wiki.git
|
||||||
cd Mindustry.wiki
|
cd Mindustry.wiki
|
||||||
|
|
||||||
DESKFILE=$TRAVIS_BUILD_NUMBER"-desktop-bleeding-edge.jar"
|
DESKFILE="mindustry-desktop-bleeding-edge.jar"
|
||||||
cp ../desktop/build/libs/desktop-release.jar $DESKFILE
|
|
||||||
|
|
||||||
FILE1="Bleeding-Edge-Build-"$TRAVIS_BUILD_NUMBER".md"
|
if [ -e $DESKFILE ]; then
|
||||||
|
rm $DESKFILE
|
||||||
if [ ! -e $FILE1 ]; then
|
|
||||||
touch $FILE1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "### Commit #"$TRAVIS_COMMIT"." >> $FILE1
|
cp ../desktop/build/libs/desktop-release.jar $DESKFILE
|
||||||
|
|
||||||
|
FILE1="Home.md"
|
||||||
|
|
||||||
|
if [ -e $FILE1 ]; then
|
||||||
|
rm $FILE1
|
||||||
|
fi
|
||||||
|
|
||||||
|
touch $FILE1
|
||||||
|
|
||||||
|
echo "#### Latest Bleeding Edge Build: "$TRAVIS_BUILD_NUMBER"" >> $FILE1
|
||||||
|
echo "###### Commit: "$TRAVIS_COMMIT"" >> $FILE1
|
||||||
echo >> $FILE1
|
echo >> $FILE1
|
||||||
echo "Desktop JAR download: [Link]("$DESKFILE")" >> $FILE1
|
echo "[Desktop JAR download.]("$DESKFILE") " >> $FILE1
|
||||||
|
echo "*Requires Java to run, as usual.*" >> $FILE1
|
||||||
|
|
||||||
git add $FILE1
|
git add $FILE1
|
||||||
git add $DESKFILE
|
git add $DESKFILE
|
||||||
git commit -m "Added a new bleeding edge build"
|
git commit -m "Added a new bleeding edge build"
|
||||||
|
|
||||||
# now remove old build
|
|
||||||
bash ../cleanup_builds.sh
|
|
||||||
|
|
||||||
git push https://$GHUSERNAME:$GHPASSWORD@github.com/Anuken/Mindustry.wiki.git --all
|
git push https://$GHUSERNAME:$GHPASSWORD@github.com/Anuken/Mindustry.wiki.git --all
|
||||||
|
Loading…
Reference in New Issue
Block a user