mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 03:59:26 +02:00
setting
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#UI
|
||||
shar-stat.health = Health: {0}
|
||||
shar-stat.shield = Shield: {0}
|
||||
shar-stat.payloadCapacity = Payloads: {0} / {1}
|
||||
@@ -5,3 +6,7 @@ shar-stat.itemCapacity = Items: {0} / {1}
|
||||
shar-stat.ammos = Ammos: {0} / {1}
|
||||
shar-stat.infinityAmmos = Ammos: Infinity
|
||||
shar-stat.commandUnits = Commands: {0} / {1}
|
||||
|
||||
# Settings
|
||||
setting.weaponui.name = Display weapon UI
|
||||
setting.commandedunitui.name = Display commandUnits UI
|
||||
@@ -1,3 +1,4 @@
|
||||
#UI
|
||||
shar-stat.health = 체력: {0}
|
||||
shar-stat.shield = 방어막: {0}
|
||||
shar-stat.payloadCapacity = 화물: {0} / {1}
|
||||
@@ -5,3 +6,7 @@ shar-stat.itemCapacity = 아이템: {0} / {1}
|
||||
shar-stat.ammos = 탄약: {0} / {1}
|
||||
shar-stat.infinityAmmos = 탄약: 무한
|
||||
shar-stat.commandUnits = 지휘 유닛: {0} / {1}
|
||||
|
||||
# Settings
|
||||
setting.weaponui.name = 무기 UI 표시
|
||||
setting.commandedunitui.name = 지휘 유닛 UI 표시
|
||||
@@ -139,7 +139,7 @@ public class HudUi {
|
||||
weapon = new Table(tx -> {
|
||||
tx.defaults().minSize(12 * 8f);
|
||||
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.left();
|
||||
tt.top();
|
||||
@@ -180,7 +180,7 @@ public class HudUi {
|
||||
}
|
||||
}).padRight(24 * 8f);
|
||||
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.left();
|
||||
tt.top();
|
||||
@@ -242,7 +242,6 @@ public class HudUi {
|
||||
});
|
||||
}
|
||||
public void addTable(){
|
||||
|
||||
Vars.ui.hudGroup.addChild(new Table(table -> {
|
||||
table.left();
|
||||
addBars();
|
||||
|
||||
@@ -5,8 +5,10 @@ import mindustry.game.EventType.*;
|
||||
import mindustry.mod.Mod;
|
||||
|
||||
public class Main extends Mod {
|
||||
public static Setting settingAdder = new Setting();
|
||||
public Main(){
|
||||
Events.on(ClientLoadEvent.class, e -> {
|
||||
settingAdder.init();
|
||||
new HudUi().addTable();
|
||||
});
|
||||
|
||||
|
||||
22
src/UnitInfo/core/Setting.java
Normal file
22
src/UnitInfo/core/Setting.java
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user