mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
what is this white bar
This commit is contained in:
29
README.md
29
README.md
@@ -1,27 +1,2 @@
|
|||||||
# Mindustry Mod Template
|
# Unit Information
|
||||||
A blank template for Mindustry mods with an existing Gradle configuration to compile and dex-ify, and Github Actions to automatically do both and upload the artifacts.
|
The mod displays more information for unit, such as health, armor, shield, weapon/weapon reload etc.
|
||||||
|
|
||||||
## Compiling
|
|
||||||
JDK 8.\
|
|
||||||
Task `dexify` requires `d8` from Android `build-tools` > `28.0.1`.
|
|
||||||
|
|
||||||
Plain Jar is for JVMs (desktop).\
|
|
||||||
Dexed Jar is for for JVMs (desktop) and ARTs (Android).\
|
|
||||||
These two are separate in order to decrease size of mod download.
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
Plain Jar: `gradlew build`\
|
|
||||||
Dexify Plain Jar: `gradlew dexify`\
|
|
||||||
Build Plain & Dexify Jar: `gradlew buildDex`
|
|
||||||
|
|
||||||
### *nix
|
|
||||||
Plain Jar: `./gradlew build`\
|
|
||||||
Dexify Plain Jar: `./gradlew dexify`\
|
|
||||||
Build Plain & Dexify Jar: `./gradlew buildDex`
|
|
||||||
|
|
||||||
## I have no idea what I'm doing with this
|
|
||||||
|
|
||||||
1. Rename directories in `src/` to avoid collisions with other mods that didn't.
|
|
||||||
2. Change `pGroup` in `gradle.properties` to match up with the new directories.
|
|
||||||
3. Update `main` in `assets/mod.json` to line up with renamed directories.
|
|
||||||
4. Refer to [Compiling](#compiling).
|
|
||||||
@@ -7,6 +7,6 @@
|
|||||||
"main": "UnitInfo.core.Main",
|
"main": "UnitInfo.core.Main",
|
||||||
"minGameVersion": "126",
|
"minGameVersion": "126",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"hidden": false,
|
"hidden": true,
|
||||||
"java": true
|
"java": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,16 +36,16 @@ public class HudUi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void reset(Table table){
|
public void reset(Table table){
|
||||||
|
addTable();
|
||||||
table.remove();
|
table.remove();
|
||||||
table.reset();
|
table.reset();
|
||||||
addTable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTable(){
|
public void addTable(){
|
||||||
Vars.ui.hudGroup.addChild(new Table(table -> {
|
Vars.ui.hudGroup.addChild(new Table(table -> {
|
||||||
Unit unit = getUnit();
|
Unit unit = getUnit();
|
||||||
table.update(() -> {
|
table.update(() -> {
|
||||||
if(getUnit() != unit) reset(table);
|
if(getUnit() != unit || getUnit().type == null) reset(table);
|
||||||
});
|
});
|
||||||
table.left();
|
table.left();
|
||||||
table.table(scene.getStyle(Button.ButtonStyle.class).up, t -> {
|
table.table(scene.getStyle(Button.ButtonStyle.class).up, t -> {
|
||||||
@@ -95,9 +95,9 @@ public class HudUi {
|
|||||||
)).growX().left();
|
)).growX().left();
|
||||||
tt.row();
|
tt.row();
|
||||||
if(getUnit() instanceof Payloadc) tt.add(new SBar(
|
if(getUnit() instanceof Payloadc) tt.add(new SBar(
|
||||||
() -> Core.bundle.format("shar-stat.payloadCapacity", Mathf.round(((Payloadc)getUnit()).payloadUsed()), Mathf.round(unit.type().payloadCapacity)),
|
() -> Core.bundle.format("shar-stat.payloadCapacity", Mathf.round(((Payloadc)getUnit()).payloadUsed()), Mathf.round(getUnit().type().payloadCapacity)),
|
||||||
() -> Pal.items,
|
() -> Pal.items,
|
||||||
() -> Mathf.clamp(((Payloadc)getUnit()).payloadUsed() / unit.type().payloadCapacity)
|
() -> Mathf.clamp(((Payloadc)getUnit()).payloadUsed() / getUnit().type().payloadCapacity)
|
||||||
)).growX().left();
|
)).growX().left();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -107,19 +107,19 @@ public class SBar extends Element{
|
|||||||
blink = Mathf.lerpDelta(blink, 0f, 0.2f);
|
blink = Mathf.lerpDelta(blink, 0f, 0.2f);
|
||||||
value = Mathf.lerpDelta(value, computed, 0.15f);
|
value = Mathf.lerpDelta(value, computed, 0.15f);
|
||||||
|
|
||||||
NinePatchDrawable bar = (NinePatchDrawable) drawable("shar-barS");
|
NinePatchDrawable bar = (NinePatchDrawable) drawable("unitinfo-barS");
|
||||||
Draw.colorl(0.1f);
|
Draw.colorl(0.1f);
|
||||||
bar.draw(x, y, width, height);
|
bar.draw(x, y, width, height);
|
||||||
Draw.color(color, blinkColor, blink);
|
Draw.color(color, blinkColor, blink);
|
||||||
|
|
||||||
NinePatchDrawable top = (NinePatchDrawable) drawable("shar-barS-top");
|
NinePatchDrawable top = (NinePatchDrawable) drawable("unitinfo-barS-top");
|
||||||
float topWidth = width * value;
|
float topWidth = width * value;
|
||||||
|
|
||||||
if(topWidth > Core.atlas.find("shar-bar-top").width){
|
if(topWidth > Core.atlas.find("unitinfo-bar-top").width){
|
||||||
top.draw(x, y, topWidth, height);
|
top.draw(x, y, topWidth, height);
|
||||||
}else{
|
}else{
|
||||||
if(ScissorStack.push(scissor.set(x, y, topWidth, height))){
|
if(ScissorStack.push(scissor.set(x, y, topWidth, height))){
|
||||||
top.draw(x, y, Core.atlas.find("shar-bar-top").width, height);
|
top.draw(x, y, Core.atlas.find("unitinfo-bar-top").width, height);
|
||||||
ScissorStack.pop();
|
ScissorStack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user