This commit is contained in:
sharlottes
2021-05-05 22:24:48 +09:00
parent 5dcaf763e3
commit b24c5742ee
5 changed files with 38 additions and 5 deletions

View File

@@ -1,7 +1,12 @@
#UI
shar-stat.health = Health: {0} shar-stat.health = Health: {0}
shar-stat.shield = Shield: {0} shar-stat.shield = Shield: {0}
shar-stat.payloadCapacity = Payloads: {0} / {1} shar-stat.payloadCapacity = Payloads: {0} / {1}
shar-stat.itemCapacity = Items: {0} / {1} shar-stat.itemCapacity = Items: {0} / {1}
shar-stat.ammos = Ammos: {0} / {1} shar-stat.ammos = Ammos: {0} / {1}
shar-stat.infinityAmmos = Ammos: Infinity shar-stat.infinityAmmos = Ammos: Infinity
shar-stat.commandUnits = Commands: {0} / {1} shar-stat.commandUnits = Commands: {0} / {1}
# Settings
setting.weaponui.name = Display weapon UI
setting.commandedunitui.name = Display commandUnits UI

View File

@@ -1,7 +1,12 @@
#UI
shar-stat.health = 체력: {0} shar-stat.health = 체력: {0}
shar-stat.shield = 방어막: {0} shar-stat.shield = 방어막: {0}
shar-stat.payloadCapacity = 화물: {0} / {1} shar-stat.payloadCapacity = 화물: {0} / {1}
shar-stat.itemCapacity = 아이템: {0} / {1} shar-stat.itemCapacity = 아이템: {0} / {1}
shar-stat.ammos = 탄약: {0} / {1} shar-stat.ammos = 탄약: {0} / {1}
shar-stat.infinityAmmos = 탄약: 무한 shar-stat.infinityAmmos = 탄약: 무한
shar-stat.commandUnits = 지휘 유닛: {0} / {1} shar-stat.commandUnits = 지휘 유닛: {0} / {1}
# Settings
setting.weaponui.name = 무기 UI 표시
setting.commandedunitui.name = 지휘 유닛 UI 표시

View File

@@ -139,7 +139,7 @@ public class HudUi {
weapon = new Table(tx -> { weapon = new Table(tx -> {
tx.defaults().minSize(12 * 8f); tx.defaults().minSize(12 * 8f);
tx.left(); tx.left();
tx.table(scene.getStyle(Button.ButtonStyle.class).up, tt -> { if(Core.settings.getBool("weaponui")) tx.table(scene.getStyle(Button.ButtonStyle.class).up, tt -> {
tt.defaults().minSize(4 * 8f); tt.defaults().minSize(4 * 8f);
tt.left(); tt.left();
tt.top(); tt.top();
@@ -180,7 +180,7 @@ public class HudUi {
} }
}).padRight(24 * 8f); }).padRight(24 * 8f);
tx.row(); tx.row();
tx.table(scene.getStyle(Button.ButtonStyle.class).up, t1 -> t1.table(tt -> { if(Core.settings.getBool("commandedunitui")) tx.table(scene.getStyle(Button.ButtonStyle.class).up, t1 -> t1.table(tt -> {
tt.defaults().minSize(4 * 8f); tt.defaults().minSize(4 * 8f);
tt.left(); tt.left();
tt.top(); tt.top();
@@ -242,7 +242,6 @@ public class HudUi {
}); });
} }
public void addTable(){ public void addTable(){
Vars.ui.hudGroup.addChild(new Table(table -> { Vars.ui.hudGroup.addChild(new Table(table -> {
table.left(); table.left();
addBars(); addBars();

View File

@@ -5,8 +5,10 @@ import mindustry.game.EventType.*;
import mindustry.mod.Mod; import mindustry.mod.Mod;
public class Main extends Mod { public class Main extends Mod {
public static Setting settingAdder = new Setting();
public Main(){ public Main(){
Events.on(ClientLoadEvent.class, e -> { Events.on(ClientLoadEvent.class, e -> {
settingAdder.init();
new HudUi().addTable(); new HudUi().addTable();
}); });

View File

@@ -0,0 +1,22 @@
package UnitInfo.core;
import arc.Core;
import mindustry.Vars;
public class Setting {
public void addGraphicSetting(String key){
Vars.ui.settings.graphics.checkPref(key, Core.settings.getBool(key));
}
public void init(){
boolean tmp = Core.settings.getBool("uiscalechanged", false);
Core.settings.put("uiscalechanged", false);
addGraphicSetting("weaponui");
addGraphicSetting("commandedunitui");
Core.settings.defaults("weaponui", true);
Core.settings.defaults("commandedunitui", true);
Core.settings.put("uiscalechanged", tmp);
}
}