Skip to content

Commit

Permalink
Add Vars + Separate main and dev news
Browse files Browse the repository at this point in the history
  • Loading branch information
JojoFR1 committed Jul 31, 2023
1 parent 9b1b1f8 commit 65bf2fd
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 19 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jar {

from(rootDir) {
include "mod.json"
include "icon.png"
}

from("src/assets/") {
Expand Down
1 change: 1 addition & 0 deletions src/aeyama/Aeyama.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class Aeyama extends Mod {

@Override
public void init() {
AeyamaVars.load();
AeyamaDialogs.load();
}

Expand Down
16 changes: 16 additions & 0 deletions src/aeyama/AeyamaVars.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package aeyama;

import mindustry.*;
import mindustry.mod.Mods.*;

public class AeyamaVars {
public static String repo = "Aeyama-Mod/aeyama/";
public static boolean isDev;
public static boolean isBeta;

public static void load() {
LoadedMod mod = Vars.mods.getMod("aeyama");
isDev = mod.meta.version.contains("dev");
isBeta = mod.meta.version.contains("beta");
}
}
6 changes: 4 additions & 2 deletions src/aeyama/ui/dialogs/NewsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import mindustry.ui.dialogs.*;

import static mindustry.Vars.*;
import static aeyama.AeyamaVars.*;

public class NewsDialog extends BaseDialog {
static LoadedMod mod = Vars.mods.getMod("aeyama");
String urlNews = "https://raw.githubusercontent.com/" + repo + (isDev ? "dev" : "main") + "/src/assets/news/" + Core.bundle.get("newsFile");
String urlGithub = "https://github.com/Aeyama-Mod/aeyama";
String urlDiscord = "https://discord.gg/YVY9Y3uA85";
String urlProject = "https://github.com/users/FredyJabe/projects/2";
Expand Down Expand Up @@ -100,9 +102,9 @@ private Table getNews() {
Table table = new Table();
Log.info("[green][Aeyama][lightgray] Fetching news...");

Http.get(Core.bundle.format("urlNews")).error(err -> {
Http.get(urlNews).error(err -> {
table.add("[red][ERROR] FAILED TO GET NEWS.").center();
Log.err(err.getMessage());
Log.err("[red][Aeyama][lightgray] " + err.getMessage());
}).block(res -> {
table.add(res.getResultAsString()).left().growX().wrap().labelAlign(Align.left);
});
Expand Down
9 changes: 5 additions & 4 deletions src/assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,19 @@ liquid.aeyama-water.name = Water
liquid.aeyama-water.description = Common liquid, the source of life.


### UI ###
stat.unittypes = Unit Types


### Settings ###
mod.aeyama.displayName = Aeyama: The New World
title = Thanks for installing Aeyama: The New World!\n
installedVersion = Installed version:

stat.unittypes = Unit Types

linkGithub = GitHub\n(leave a star!)
linkDiscord = Discord
linkProject = What's coming next?
urlNews = https://raw.githubusercontent.com/Aeyama-Mod/aeyama/main/src/assets/news/news.txt

newsFile = news.txt


### Objectives ###
Expand Down
9 changes: 7 additions & 2 deletions src/assets/bundles/bundle_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,19 @@ liquid.aeyama-water.name = Agua
liquid.aeyama-water.description = Líquido común, la fuente de vida.


### UI ###
stat.unittypes = Unit Types


### Settings ###
mod.aeyama.displayName = Aeyama: El nuevo mundo
title = ¡Gracias por instalar la campaña de Aeyama!\n
installedVersion = Installed version:
linkGithub = Github\n(Deja una star!)

linkGithub = GitHub\n(Deja una star!)
linkDiscord = Discord
linkProject = ¿Qué vendrá después?
urlNews = https://raw.githubusercontent.com/Aeyama-Mod/aeyama/main/src/assets/news/news_es.txt
urlNews = news_es.txt


### Objectives ###
Expand Down
9 changes: 7 additions & 2 deletions src/assets/bundles/bundle_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,19 @@ liquid.aeyama-water.name = Eau
liquid.aeyama-water.description = Liquide commun, source de vie.


### UI ###
stat.unittypes = Types d'Unité


### Settings ###
mod.aeyama.displayName = Aeyama: Le Nouveau Monde
title = Merci d'avoir installé Aeyama: Le Nouveau Monde !\n
installedVersion = Aeyama\nVersion installé:
linkGithub = Github\n (donne une étoile!)

linkGithub = GitHub\n (donne une étoile!)
linkDiscord = Discord
linkProject = Qu'est-ce qui arrive ensuite ?
urlNews = https://raw.githubusercontent.com/Aeyama-Mod/aeyama/main/src/assets/news/news_fr.txt
newsFile = news_fr.txt


### Objectives ###
Expand Down
9 changes: 7 additions & 2 deletions src/assets/bundles/bundle_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,19 @@ liquid.aeyama-water.name = Woda
liquid.aeyama-water.description = Zwykła ciecz, żródło życia.


### UI ###
stat.unittypes = Unit Types


### Settings ###
mod.aeyama.displayName = Aeyama: The New World
title = Thanks for installing Aeyama: The New World!\n
installedVersion = Installed version:
linkGithub = Github\n(zostaw star!)

linkGithub = GitHub\n(zostaw star!)
linkDiscord = Discord
linkProject = Co nowego?
urlNews = https://raw.githubusercontent.com/Aeyama-Mod/aeyama/main/src/assets/news/news_pl.txt
newsFile = news_pl.txt


### Objectives ###
Expand Down
10 changes: 6 additions & 4 deletions src/assets/bundles/bundle_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -275,17 +275,19 @@ liquid.aeyama-water.name = Вода
liquid.aeyama-water.description = Обычная жидкость, источник жизни.


### UI ###
stat.unittypes = Типы единиц


### Settings ###
mod.aeyama.displayName = Аеама: Новый мир
title = Спасибо за загрузку мода!\n
installedVersion = Установленная версия:

stat.unittypes = Типы единиц

linkGithub = Github\n(Поставьте моду звезду!)
linkGithub = GitHub\n(Поставьте моду звезду!)
linkDiscord = Discord
linkProject = Что будет дальше?
urlNews = https://raw.githubusercontent.com/Aeyama-Mod/aeyama/main/src/assets/news/news_ru.txt
newsFile = news_ru.txt


### Objectives ###
Expand Down
9 changes: 7 additions & 2 deletions src/assets/bundles/bundle_uk_UA.properties
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,19 @@ liquid.aeyama-water.name = Вода
liquid.aeyama-water.description = Звичайна рідина, джерело життя.


### UI ###
stat.unittypes = Unit Types


### Settings ###
mod.aeyama.displayName = Аеяма: Новий світ
title = Дякуємо за встановку "Аеями: нового світу"!\n
installedVersion = Встановлена версія:
linkGithub = Github\n(Поставте модифікації star!)

linkGithub = GitHub\n(Поставте модифікації star!)
linkDiscord = Discord
linkProject = Що далі?
urlNews = https://raw.githubusercontent.com/Aeyama-Mod/aeyama/main/src/assets/news/news_uk_UA.txt
newsFile = news_uk_UA.txt


### Objectives ###
Expand Down
7 changes: 6 additions & 1 deletion src/assets/bundles/bundle_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,19 @@ liquid.aeyama-water.name = 水
liquid.aeyama-water.description = 普通液体,生命之源


### UI ###
stat.unittypes = Unit Types


### Settings ###
mod.aeyama.displayName = 阿亚玛;新世界
title = 欢迎游玩阿亚玛;新世界\n
installedVersion = 已安装版本:

linkGithub = GitHub\n(添加星标!)
linkDiscord = Discord
linkProject = 接下来会发生什么呢?
urlNews = https://raw.githubusercontent.com/Aeyama-Mod/aeyama/main/src/assets/news/news_zh_CN.txt
newsFile = news_zh_CN.txt


### Objectives ###
Expand Down

0 comments on commit 65bf2fd

Please sign in to comment.