Fixed about dialog not showing the right text
This commit is contained in:
@@ -85,18 +85,4 @@ public class Vars{
|
|||||||
public static NetClient netClient;
|
public static NetClient netClient;
|
||||||
|
|
||||||
public static Player player;
|
public static Player player;
|
||||||
|
|
||||||
public static String[] aboutText = {
|
|
||||||
"Created by [ROYAL]Anuken.[]",
|
|
||||||
"Originally an entry in the [orange]GDL[] MM Jam.",
|
|
||||||
"",
|
|
||||||
"Credits:",
|
|
||||||
"- SFX made with [YELLOW]bfxr[]",
|
|
||||||
"- Music made by [GREEN]RoccoW[] / found on [lime]FreeMusicArchive.org[]",
|
|
||||||
"",
|
|
||||||
"Special thanks to:",
|
|
||||||
"- [coral]MitchellFJN[]: extensive playtesting and feedback",
|
|
||||||
"- [sky]Luxray5474[]: wiki work, code contributions",
|
|
||||||
"- All the beta testers on itch.io and Google Play"
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,97 +0,0 @@
|
|||||||
package io.anuke.mindustry.io;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
|
||||||
import com.badlogic.gdx.utils.Array;
|
|
||||||
import io.anuke.mindustry.Vars;
|
|
||||||
import io.anuke.mindustry.game.Tutorial;
|
|
||||||
import io.anuke.mindustry.game.Tutorial.Stage;
|
|
||||||
import io.anuke.mindustry.resource.Item;
|
|
||||||
import io.anuke.mindustry.resource.Liquid;
|
|
||||||
import io.anuke.mindustry.world.Block;
|
|
||||||
import io.anuke.mindustry.game.GameMode;
|
|
||||||
import io.anuke.mindustry.world.Map;
|
|
||||||
import io.anuke.ucore.core.Inputs.DeviceType;
|
|
||||||
import io.anuke.ucore.core.KeyBinds;
|
|
||||||
import io.anuke.ucore.core.KeyBinds.Keybind;
|
|
||||||
import io.anuke.ucore.scene.ui.SettingsDialog.SettingsTable.Setting;
|
|
||||||
import io.anuke.ucore.util.Bundles;
|
|
||||||
import io.anuke.ucore.util.Mathf;
|
|
||||||
|
|
||||||
/**Used for generating a bundle from existing strings in the game.*/
|
|
||||||
public class BundleGen {
|
|
||||||
private static FileHandle file;
|
|
||||||
|
|
||||||
public static void cleanBundles(FileHandle file){
|
|
||||||
String[] strings = file.readString().split("\n");
|
|
||||||
FileHandle out = Gdx.files.absolute("/home/anuke/out.properties");
|
|
||||||
out.writeString("", false);
|
|
||||||
for(String string : strings){
|
|
||||||
if(!string.contains(".description")){
|
|
||||||
out.writeString(string + "\n", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void buildBundle(FileHandle file){
|
|
||||||
BundleGen.file = file;
|
|
||||||
|
|
||||||
file.writeString("", false);
|
|
||||||
write("about.text=" + join(Vars.aboutText));
|
|
||||||
write("discord.text=Join the mindustry discord!\n[orange]");
|
|
||||||
|
|
||||||
Mathf.each(table -> {
|
|
||||||
for(Setting setting : table.getSettings()){
|
|
||||||
write("setting." + setting.name + ".name=" + setting.title);
|
|
||||||
}
|
|
||||||
}, Vars.ui.settings.game, Vars.ui.settings.graphics, Vars.ui.settings.sound);
|
|
||||||
|
|
||||||
for(Map map : Vars.world.maps().list()){
|
|
||||||
write("map." + map.name + ".name=" + map.name);
|
|
||||||
}
|
|
||||||
for(Tutorial.Stage stage : Stage.values()){
|
|
||||||
write("tutorial." + stage.name() + ".text=" + stage.text);
|
|
||||||
}
|
|
||||||
for(Keybind bind : KeyBinds.getSection("default").keybinds.get(DeviceType.keyboard)){
|
|
||||||
write("keybind." + bind.name + ".name=" + bind.name);
|
|
||||||
}
|
|
||||||
for(GameMode mode : GameMode.values()){
|
|
||||||
write("mode." + mode.name() + ".name=" + mode.name());
|
|
||||||
}
|
|
||||||
for(Item item : Item.getAllItems()){
|
|
||||||
write("item." + item.name + ".name=" + item.name);
|
|
||||||
}
|
|
||||||
for(Liquid liquid : Liquid.getAllLiquids()){
|
|
||||||
write("liquid." + liquid.name + ".name=" + liquid.name);
|
|
||||||
}
|
|
||||||
for(Block block : Block.getAllBlocks()){
|
|
||||||
write("block." + block.name + ".name=" + block.formalName);
|
|
||||||
if(block.fullDescription != null) write("block." + block.name + ".fulldescription=" + block.fullDescription);
|
|
||||||
if(block.description != null) write("block." + block.name + ".description=" + block.description);
|
|
||||||
|
|
||||||
Array<String> a = new Array<>();
|
|
||||||
block.getStats(a);
|
|
||||||
for(String s : a){
|
|
||||||
if(s.contains(":")) {
|
|
||||||
String color = s.substring(0, s.indexOf("]")+1);
|
|
||||||
String first = s.substring(color.length(), s.indexOf(":")).replace("/", "").replace(" ", "").toLowerCase();
|
|
||||||
String last = s.substring(s.indexOf(":"), s.length());
|
|
||||||
s = color + Bundles.getNotNull("text.blocks." + first) + last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void write(String string){
|
|
||||||
file.writeString(string.replaceAll("\\n", "\\\\n") + "\n", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String join(String[] strings){
|
|
||||||
String s = "";
|
|
||||||
for(String string : strings){
|
|
||||||
s += string + "\n";
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +1,11 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.aboutText;
|
|
||||||
|
|
||||||
public class AboutDialog extends FloatingDialog {
|
public class AboutDialog extends FloatingDialog {
|
||||||
|
|
||||||
public AboutDialog(){
|
public AboutDialog(){
|
||||||
super("$text.about.button");
|
super("$text.about.button");
|
||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
|
content().add("$text.about");
|
||||||
for(String text : aboutText){
|
|
||||||
content().add(text).left();
|
|
||||||
content().row();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user