mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
fixed item tap
This commit is contained in:
@@ -38,18 +38,6 @@ public class BarInfo {
|
||||
static Seq<String> strings = Seq.with("","","","","","");
|
||||
static FloatSeq numbers = FloatSeq.with(0f,0f,0f,0f,0f,0f);
|
||||
static Seq<Color> colors = Seq.with(Color.clear,Color.clear,Color.clear,Color.clear,Color.clear,Color.clear);
|
||||
static Field linkedCore; // Versions below 130 don't have this public
|
||||
|
||||
static {
|
||||
if(Version.build <= 129) {
|
||||
try {
|
||||
linkedCore = StorageBlock.StorageBuild.class.getDeclaredField("linkedCore");
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
linkedCore.setAccessible(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T extends Teamc> void getInfo(T target) throws IllegalAccessException, NoSuchFieldException {
|
||||
for(int i = 0; i < 6; i++) { //init
|
||||
|
||||
@@ -1072,16 +1072,17 @@ public class HudUi {
|
||||
}
|
||||
|
||||
public void setItem(Table table){
|
||||
table.left().defaults().minWidth(Scl.scl(modUiScale) * 54 * 8f).align(Align.center);
|
||||
table.table().update(t -> {
|
||||
t.clear();
|
||||
for(int i = 0; i < coreItems.tables.size; i++){
|
||||
if((state.rules.pvp && coreItems.teams[i] != player.team()) || coreItems.teams[i].cores().isEmpty()) continue;
|
||||
int finalI = i;
|
||||
Label label = new Label(() -> "[#" + coreItems.teams[finalI].color.toString() + "]" + coreItems.teams[finalI].name + "[]");
|
||||
label.setFontScale(modUiScale);
|
||||
t.background(Tex.underline2).add(label).center();
|
||||
t.row();
|
||||
t.add(coreItems.tables.get(i)).left();
|
||||
t.table(tt -> {
|
||||
tt.center().defaults().minWidth(Scl.scl(modUiScale) * 54 * 8f);
|
||||
coreItems.tables.get(finalI).setBackground(((NinePatchDrawable)Tex.underline2).tint(coreItems.teams[finalI].color));
|
||||
tt.add(coreItems.tables.get(finalI)).left();
|
||||
}).pad(4);
|
||||
t.row();
|
||||
}
|
||||
});
|
||||
@@ -1107,7 +1108,7 @@ public class HudUi {
|
||||
});
|
||||
|
||||
itemTable = new Table(table -> {
|
||||
table.left().defaults().width(Scl.scl(modUiScale) * 54 * 8f).height(Scl.scl(modUiScale) * 32 * 8f).align(Align.left);
|
||||
table.left().defaults().minWidth(Scl.scl(modUiScale) * 54 * 8f).height(Scl.scl(modUiScale) * 32 * 8f).align(Align.left);
|
||||
table.table(Tex.button, t -> {
|
||||
t.add(itemPane);
|
||||
t.update(() -> {
|
||||
|
||||
@@ -106,7 +106,7 @@ public class SettingS {
|
||||
Seq<Seq<SharSetting>> settingSeq = new Seq<>();
|
||||
Seq<SharSetting> tapSeq = new Seq<>();
|
||||
addGraphicSlideSetting("barstyle", 0, 0, 5, 1, s -> s == 0 ? "default bar" : s + "th bar", tapSeq);
|
||||
addGraphicSlideSetting("infoUiScale", 100, 50, 100, 5, s -> s + "%", tapSeq);
|
||||
addGraphicSlideSetting("infoUiScale", 75, 50, 100, 5, s -> s + "%", tapSeq);
|
||||
addGraphicSlideSetting("coreItemCheckRate", 60, 6, 180, 6, s -> Strings.fixed(s/60f,1) + "sec", tapSeq);
|
||||
addGraphicTypeSetting("wavemax", 0, 100,200, true, () -> true, s -> s + "waves", tapSeq);
|
||||
addGraphicCheckSetting("infoui", true, tapSeq);
|
||||
|
||||
@@ -91,6 +91,11 @@ public class CoresItemsDisplay {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Label label1 = new Label(() -> "[#" + team.color.toString() + "]" + team.name + "[]");
|
||||
label1.setFontScale(modUiScale);
|
||||
t.add(label1).row();
|
||||
t.row();
|
||||
t.table(coretable -> {
|
||||
final int[] i = {0};
|
||||
for(CoreBlock.CoreBuild core : team.cores()) {
|
||||
@@ -165,16 +170,16 @@ public class CoresItemsDisplay {
|
||||
unitTable.clear();
|
||||
final int[] i = {0};
|
||||
for(UnitType unit : content.units()){
|
||||
if(unit != UnitTypes.block && Groups.unit.contains(u -> u.type == unit && u.team == team)){
|
||||
unitTable.table(tt -> {
|
||||
tt.center();
|
||||
if(unit != UnitTypes.block && Groups.unit.contains(u -> u.type == unit && u.team == team)){
|
||||
tt.image(unit.uiIcon).size(iconSmall * modUiScale).padRight(3 * modUiScale).tooltip(ttt -> ttt.background(Styles.black6).margin(2f * modUiScale).add(unit.localizedName).style(Styles.outlineLabel));
|
||||
Label label = new Label(() -> core == null ? "0" : UI.formatAmount(Groups.unit.count(u -> u.team == team && u.type == unit)));
|
||||
label.setFontScale(modUiScale);
|
||||
tt.add(label).padRight(3 * modUiScale).minWidth(5 * 8f * modUiScale).left();
|
||||
});
|
||||
if(++i[0] % 5 == 0) unitTable.row();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user