mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 03:59:26 +02:00
Merge branch 'master' into patch-2
This commit is contained in:
@@ -40,6 +40,8 @@ setting.uiopacity.description = use the slider to set opacity of ui background.
|
||||
|
||||
setting.scan.name = Enable Block Scanner
|
||||
setting.scan.description = toggle to enable scanner that shows nearly turret and wall hp.
|
||||
setting.coreRange.name = Display Core Range
|
||||
setting.coreRange.description = display enemy core build-limit range
|
||||
setting.rangemax.name = Block Scanner Range
|
||||
setting.rangemax.description = set scan radius of scanner.\nSelect the pencil and enter a number.
|
||||
setting.rangeNearby.name = Display Near Range
|
||||
|
||||
@@ -36,6 +36,8 @@ setting.scan.name = 블록 스캐너 활성화
|
||||
setting.scan.description = 주변 포탑과 벽의 체력을 표시하는 스캐터를 활성화합니다.
|
||||
setting.rangemax.name = 블록 스캐너 사거리
|
||||
setting.rangemax.description = 연필 아이콘을 눌러서 스캐너 사거리를 설정합니다.
|
||||
setting.coreRange.name = 코어 사거리 표시
|
||||
setting.coreRange.description = 적 코어 건설제한 사거리를 표시합니다.
|
||||
setting.rangeNearby.name = 주변 사거리 표시
|
||||
setting.rangeNearby.description = 적 사거리에 접근했을 경우 사거리를 표시합니다.
|
||||
setting.unitRange.name = 유닛 사거리 표시
|
||||
|
||||
@@ -10,7 +10,7 @@ public class SVars {
|
||||
public static Fi modRoot = modDirectory.child("UnitInfo");
|
||||
public static Seq<PlayerParser.PlayerInfo> playerInfos = new Seq<>();
|
||||
|
||||
public static Setting settingAdder = new Setting();
|
||||
public static SettingS settingAdder = new SettingS();
|
||||
public static HudUi hud = new HudUi();
|
||||
public static PlayerParser playerinfo = new PlayerParser();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BarInfo {
|
||||
return Strings.fixed(number, 1);
|
||||
}
|
||||
|
||||
public static <T extends Teamc> void getInfo(T target) {
|
||||
public static <T extends Teamc> void getInfo(T target) throws IllegalAccessException, NoSuchFieldException {
|
||||
for(int i = 0; i < 6; i++) { //init
|
||||
strings.set(i, "[lightgray]<Empty>[]");
|
||||
colors.set(i, Color.clear);
|
||||
@@ -109,9 +109,12 @@ public class BarInfo {
|
||||
numbers.set(1, (float) mend.sense(LAccess.progress));
|
||||
}
|
||||
else if(target instanceof OverdriveProjector.OverdriveBuild over){
|
||||
strings.set(1, Core.bundle.format("shar-stat.progress", Strings.fixed((float) over.sense(LAccess.progress) * 100f, 2)));
|
||||
colors.set(1, Pal.heal);
|
||||
numbers.set(1, (float) over.sense(LAccess.progress));
|
||||
Field ohno = OverdriveProjector.OverdriveBuild.class.getDeclaredField("charge");
|
||||
ohno.setAccessible(true);
|
||||
float charge = (float) ohno.get(over);
|
||||
strings.set(1, Core.bundle.format("shar-stat.progress", Strings.fixed(Mathf.clamp(charge/((OverdriveProjector)over.block).reload) * 100f, 2)));
|
||||
colors.set(1, Color.valueOf("feb380"));
|
||||
numbers.set(1, Mathf.clamp(charge/((OverdriveProjector)over.block).reload));
|
||||
}
|
||||
else if(target instanceof Drill.DrillBuild drill){
|
||||
strings.set(1, bundle.format("shar-stat.progress", Strings.fixed((float) drill.sense(LAccess.progress) * 100f, 2)));
|
||||
@@ -194,6 +197,13 @@ public class BarInfo {
|
||||
colors.set(3, Pal.power);
|
||||
numbers.set(3, factory.unit() == null ? 0f : (float)factory.team.data().countType(factory.unit()) / Units.getCap(factory.team));
|
||||
}
|
||||
else if(target instanceof Reconstructor.ReconstructorBuild reconstruct){
|
||||
strings.set(3, reconstruct.unit() == null ? "[lightgray]" + Iconc.cancel :
|
||||
Core.bundle.format("bar.unitcap", Fonts.getUnicodeStr(reconstruct.unit().name), format(reconstruct.team.data().countType(reconstruct.unit())), format(Units.getCap(reconstruct.team))));
|
||||
colors.set(3, Pal.power);
|
||||
numbers.set(3, reconstruct.unit() == null ? 0f : (float)reconstruct.team.data().countType(reconstruct.unit()) / Units.getCap(reconstruct.team));
|
||||
|
||||
}
|
||||
else if(target instanceof Drill.DrillBuild e){
|
||||
strings.set(3, bundle.format("bar.drillspeed", Strings.fixed(e.lastDrillSpeed * 60 * e.timeScale, 2)));
|
||||
colors.set(3, Pal.ammo);
|
||||
|
||||
@@ -19,7 +19,6 @@ import mindustry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.Renderer;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.bullet.MassDriverBolt;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
@@ -34,12 +33,11 @@ import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
import mindustry.world.blocks.defense.turrets.*;
|
||||
import mindustry.world.blocks.distribution.MassDriver;
|
||||
import mindustry.world.blocks.power.PowerGraph;
|
||||
import mindustry.world.blocks.power.PowerNode;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
|
||||
import java.io.PipedWriter;
|
||||
import java.util.Objects;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import static arc.Core.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -153,15 +151,22 @@ public class HudUi {
|
||||
}
|
||||
}
|
||||
|
||||
public Seq<Building> getPowerLinkedBuilds(Building build){
|
||||
public Seq<Building> getPowerLinkedBuilds(Building build) {
|
||||
Seq<Building> linkedBuilds = new Seq<>();
|
||||
linkedBuilds.add(build.front(), build.back(), build.right(), build.left());
|
||||
/*
|
||||
Field ohno = PowerGraph.class.getDeclaredField("all");
|
||||
ohno.setAccessible(true);
|
||||
((Seq<Building>) ohno.get(build.power.graph)).each(linkedBuilds::add);
|
||||
*/
|
||||
build.power.links.each(i -> linkedBuilds.add(world.build(i)));
|
||||
build.proximity().each(linkedBuilds::add);
|
||||
linkedBuilds.filter(b -> b != null && b.power != null);
|
||||
if(!build.block.outputsPower && !(build instanceof PowerNode.PowerNodeBuild))
|
||||
linkedBuilds.filter(b -> b.block.outputsPower || b instanceof PowerNode.PowerNodeBuild);
|
||||
return linkedBuilds;
|
||||
}
|
||||
|
||||
public void drawNodeLink(Building node){
|
||||
public void drawNodeLink(Building node) {
|
||||
if(node.power == null) return;
|
||||
if(!linkedNodes.contains(node)) {
|
||||
linkedNodes.add(node);
|
||||
@@ -661,7 +666,11 @@ public class HudUi {
|
||||
}).padRight(Scl.scl(24 * 8f));
|
||||
table.row();
|
||||
table.update(() -> {
|
||||
BarInfo.getInfo(getTarget());
|
||||
try {
|
||||
BarInfo.getInfo(getTarget());
|
||||
} catch (IllegalAccessException | NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
strings = BarInfo.strings;
|
||||
numbers = BarInfo.numbers;
|
||||
colors = BarInfo.colors;
|
||||
|
||||
@@ -137,11 +137,16 @@ public class Main extends Mod {
|
||||
});
|
||||
}
|
||||
}
|
||||
if(!state.rules.polygonCoreProtection && settings.getBool("coreRange") && player != null){
|
||||
state.teams.eachEnemyCore(player.team(), core -> {
|
||||
if(Core.camera.bounds(Tmp.r1).overlaps(Tmp.r2.setCentered(core.x, core.y, state.rules.enemyCoreBuildRadius * 2f))){
|
||||
Draw.color(Color.darkGray);
|
||||
Lines.circle(core.x, core.y - 2, state.rules.enemyCoreBuildRadius);
|
||||
Draw.color(Pal.accent, core.team.color, 0.5f + Mathf.absin(Time.time, 10f, 0.5f));
|
||||
Lines.circle(core.x, core.y, state.rules.enemyCoreBuildRadius);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadContent(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.*;
|
||||
import static arc.Core.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class Setting {
|
||||
public class SettingS {
|
||||
public static SettingsMenuDialog.SettingsTable waveTable = new SettingsMenuDialog.SettingsTable();
|
||||
public static SettingsMenuDialog.SettingsTable opacityTable = new SettingsMenuDialog.SettingsTable();
|
||||
public static SettingsMenuDialog.SettingsTable scanTable = new SettingsMenuDialog.SettingsTable();
|
||||
@@ -30,8 +30,8 @@ public class Setting {
|
||||
ui.settings.graphics.sliderPref(key, def, min, max, step, s);
|
||||
}
|
||||
/*
|
||||
public void addGraphicSlideSetting(String key, int def, int min, int max, int step, SettingsMenuDialog.StringProcessor s, Seq<SettingsMenuDialog.SettingsTable.Setting> list){
|
||||
list.add(new SettingsMenuDialog.SettingsTable.Setting(key) {
|
||||
public void addGraphicSlideSetting(String key, int def, int min, int max, int step, SettingsMenuDialog.StringProcessor s, Seq<SettingsMenuDialog.SettingsTable.SettingS> list){
|
||||
list.add(new SettingsMenuDialog.SettingsTable.SettingS(key) {
|
||||
{
|
||||
Core.settings.defaults(name, def);
|
||||
}
|
||||
@@ -62,8 +62,8 @@ public class Setting {
|
||||
}
|
||||
});
|
||||
}
|
||||
public void addGraphicCheckSetting(String key, boolean def, Seq<SettingsMenuDialog.SettingsTable.Setting> list){
|
||||
list.add(new SettingsMenuDialog.SettingsTable.Setting() {
|
||||
public void addGraphicCheckSetting(String key, boolean def, Seq<SettingsMenuDialog.SettingsTable.SettingS> list){
|
||||
list.add(new SettingsMenuDialog.SettingsTable.SettingS() {
|
||||
{
|
||||
name = key;
|
||||
title = bundle.get("setting." + key + ".name");
|
||||
@@ -87,8 +87,8 @@ public class Setting {
|
||||
});
|
||||
}
|
||||
|
||||
public void addGraphicTypeSetting(String key, int defs, String dialogs, String invalid, int warnMax, Seq<SettingsMenuDialog.SettingsTable.Setting> list){
|
||||
list.add(new SettingsMenuDialog.SettingsTable.Setting() {
|
||||
public void addGraphicTypeSetting(String key, int defs, String dialogs, String invalid, int warnMax, Seq<SettingsMenuDialog.SettingsTable.SettingS> list){
|
||||
list.add(new SettingsMenuDialog.SettingsTable.SettingS() {
|
||||
public final int def;
|
||||
{
|
||||
def = defs;
|
||||
@@ -218,8 +218,8 @@ public class Setting {
|
||||
});
|
||||
}
|
||||
|
||||
public void addGraphicDialogSetting(String key, Seq<SettingsMenuDialog.SettingsTable.Setting> list, SettingsMenuDialog.SettingsTable table){
|
||||
ui.settings.graphics.pref(new SettingsMenuDialog.SettingsTable.Setting() {
|
||||
public void addGraphicDialogSetting(String key, Seq<SettingsMenuDialog.SettingsTable.SettingS> list, SettingsMenuDialog.SettingsTable table){
|
||||
ui.settings.graphics.pref(new SettingsMenuDialog.SettingsTable.SettingS() {
|
||||
{
|
||||
name = key;
|
||||
title = Core.bundle.get("setting." + key + ".name");
|
||||
@@ -230,17 +230,17 @@ public class Setting {
|
||||
public Table rebuild() {
|
||||
table.clearChildren();
|
||||
|
||||
Iterator<SettingsMenuDialog.SettingsTable.Setting> var1 = list.iterator();
|
||||
Iterator<SettingsMenuDialog.SettingsTable.SettingS> var1 = list.iterator();
|
||||
|
||||
while(var1.hasNext()) {
|
||||
SettingsMenuDialog.SettingsTable.Setting setting = var1.next();
|
||||
SettingsMenuDialog.SettingsTable.SettingS setting = var1.next();
|
||||
setting.add(table);
|
||||
}
|
||||
table.button(Core.bundle.get("settings.reset", "Reset to Defaults"), () -> {
|
||||
Iterator<SettingsMenuDialog.SettingsTable.Setting> var2 = list.iterator();
|
||||
Iterator<SettingsMenuDialog.SettingsTable.SettingS> var2 = list.iterator();
|
||||
|
||||
while(var2.hasNext()) {
|
||||
SettingsMenuDialog.SettingsTable.Setting setting = var1.next();
|
||||
SettingsMenuDialog.SettingsTable.SettingS setting = var1.next();
|
||||
if (setting.name != null && setting.title != null) {
|
||||
Core.settings.put(setting.name, Core.settings.getDefault(setting.name));
|
||||
}
|
||||
@@ -264,13 +264,13 @@ public class Setting {
|
||||
*/
|
||||
public void init(){
|
||||
/*
|
||||
Seq<SettingsMenuDialog.SettingsTable.Setting> waveSeq = new Seq<>();
|
||||
Seq<SettingsMenuDialog.SettingsTable.SettingS> waveSeq = new Seq<>();
|
||||
addGraphicCheckSetting("pastwave", false, waveSeq);
|
||||
addGraphicCheckSetting("emptywave", true, waveSeq);
|
||||
addGraphicTypeSetting("wavemax", 100, "@editmaxwave","@invalid", 200, waveSeq);
|
||||
addGraphicDialogSetting("wavesetting", waveSeq, waveTable);
|
||||
|
||||
Seq<SettingsMenuDialog.SettingsTable.Setting> scanSeq = new Seq<>();
|
||||
Seq<SettingsMenuDialog.SettingsTable.SettingS> scanSeq = new Seq<>();
|
||||
addGraphicCheckSetting("scan", false, scanSeq);
|
||||
addGraphicTypeSetting("rangemax", 10, "@editrange","@invalid", 100, scanSeq);
|
||||
addGraphicCheckSetting("rangeNearby", true, scanSeq);
|
||||
@@ -282,7 +282,7 @@ public class Setting {
|
||||
addGraphicSlideSetting("rangeRadius", 5, 0, 20, 1, s -> s + "tiles", scanSeq);
|
||||
addGraphicDialogSetting("wavesetting", scanSeq, scanTable);
|
||||
|
||||
Seq<SettingsMenuDialog.SettingsTable.Setting> opacitySeq = new Seq<>();
|
||||
Seq<SettingsMenuDialog.SettingsTable.SettingS> opacitySeq = new Seq<>();
|
||||
addGraphicSlideSetting("selectopacity", 50, 0, 100, 5, s -> s + "%", opacitySeq);
|
||||
addGraphicSlideSetting("baropacity", 50, 0, 100, 5, s -> s + "%", opacitySeq);
|
||||
addGraphicSlideSetting("uiopacity", 50, 0, 100, 5, s -> s + "%", opacitySeq);
|
||||
@@ -293,6 +293,7 @@ public class Setting {
|
||||
addGraphicCheckSetting("emptywave", true);
|
||||
addGraphicCheckSetting("scan", false);
|
||||
addGraphicSlideSetting("rangemax", 10, 0, 100, 1, s -> s + "tiles");
|
||||
addGraphicCheckSetting("coreRange", true);
|
||||
addGraphicCheckSetting("rangeNearby", true);
|
||||
addGraphicCheckSetting("allTeamRange", false);
|
||||
addGraphicCheckSetting("allTargetRange", false);
|
||||
Reference in New Issue
Block a user