Skip to content
This repository was archived by the owner on Jan 17, 2026. It is now read-only.

Commit ea03e0c

Browse files
authored
Merge pull request #24 from JiroCab/master
Maw
2 parents 9956da4 + 47ead3c commit ea03e0c

6 files changed

Lines changed: 85 additions & 11 deletions

File tree

build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ buildscript{
2121
plugins{
2222
java
2323
id("com.github.GglLfr.EntityAnno") apply false
24+
id("com.xpdustry.toxopid") version "4.1.0"
2425
}
2526

2627
val arcVersion: String by project
@@ -52,6 +53,15 @@ fun entity(module: String): String{
5253
return "com.github.GglLfr.EntityAnno$module:$entVersion"
5354
}
5455

56+
fun toxopid(module: String): String{
57+
return "com.xpdustry.toxopid.spec.ModPlatform"
58+
}
59+
60+
toxopid {
61+
compileVersion = mindustryVersion
62+
runtimeVersion = mindustryVersion
63+
}
64+
5565
allprojects{
5666
apply(plugin = "java")
5767
sourceSets["main"].java.setSrcDirs(listOf(layout.projectDirectory.dir("src")))

src/biotech/BioEventHandler.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
import arc.util.Log;
55
import arc.util.Reflect;
66
import biotech.content.BioFx;
7-
import biotech.ui.BioResearchDialog;
7+
import biotech.type.unit.*;
8+
import biotech.ui.*;
89
import biotech.world.blocks.enviroment.BiologicalStaticSpawner;
910
import mindustry.Vars;
10-
import mindustry.game.EventType;
11+
import mindustry.game.*;
1112
import mindustry.gen.Building;
1213
import mindustry.gen.Groups;
1314
import mindustry.ui.fragments.MenuFragment;
@@ -29,6 +30,11 @@ public static void init() {
2930
}
3031
});
3132

33+
Events.on(EventType.WaveEvent.class, event -> {
34+
if(Vars.state.rules.spawns.contains( w -> w.type instanceof ShomeretUnitType)) BioVars.shomeretUI.begin();
35+
});
36+
3237
Events.on(EventType.WorldLoadEvent.class, you -> BioVars.postInit());
38+
Events.on(EventType.ClientLoadEvent.class, world -> BioVars.load());
3339
}
3440
}

src/biotech/BioTech.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public static void loadMusic() {
6666

6767
void loadSettings() {
6868
ui.settings.addCategory(bundle.get("setting.biotech-category"), Icon.settings, t -> {
69+
t.checkPref("biotech-bossbar-hides-menu", true);
6970

7071
t.pref(new ButtonPref(bundle.get("setting.biotech-clear-tech-tree"), Icon.trash,() -> {
7172
ui.showConfirm("@confirm", bundle.get("setting.biotech-clear-tech-tree.confirm"), () -> {

src/biotech/BioVars.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
package biotech;
22

3-
import biotech.ui.ShomeretUI;
3+
import biotech.type.unit.*;
4+
import biotech.ui.*;
45
import mindustry.Vars;
56

67
public class BioVars {
7-
public static ShomeretUI shomeretUI = new ShomeretUI();
8+
public static ShomeretUI shomeretUI = new ShomeretUI();
9+
public static BioBossBarFragment bossBar = new BioBossBarFragment();
810

9-
public static void postInit() {
11+
public static void load(){
12+
bossBar.load(Vars.ui.hudGroup);
1013
shomeretUI.build(Vars.ui.hudGroup);
1114
}
15+
16+
public static void postInit() {
17+
bossBar.build();
18+
}
1219
}

src/biotech/type/unit/ShomeretUnitType.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class ShomeretUnitType extends BiologicalUnitType {
1919
public static int state;
2020
public static UnitType ima;
2121

22-
boolean cutsceneFinished = false;
2322
int spawnCooldown = 10 * 60;
2423

2524
public ShomeretUnitType(String name) {
@@ -112,11 +111,6 @@ public void init() {
112111
public void update(Unit unit) {
113112
super.update(unit);
114113

115-
if (!cutsceneFinished) {
116-
BioVars.shomeretUI.begin();
117-
cutsceneFinished = true;
118-
}
119-
120114
if (unit.health < unit.maxHealth / 2 && state == 0) state = 1;
121115

122116
//ima shitter
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package biotech.ui;
2+
3+
import arc.*;
4+
import arc.func.*;
5+
import arc.graphics.g2d.*;
6+
import arc.scene.*;
7+
import arc.scene.ui.layout.*;
8+
import arc.util.*;
9+
import mindustry.*;
10+
import mindustry.graphics.*;
11+
import mindustry.ui.*;
12+
13+
14+
public class BioBossBarFragment {
15+
public Table bossBar = new Table();
16+
17+
public boolean hide(){
18+
return !Core.settings.getBool("biotech-bossbar-hides-menu", true);
19+
}
20+
21+
public void load(Group parent){
22+
Boolp prevHud = Vars.ui.hudGroup.find("waves").visibility, prevMap = Vars.ui.hudGroup.find("minimap/position").visibility;
23+
if(!Vars.mobile){ //dont softlock mobile players
24+
if(prevHud == null) prevHud = () -> false;
25+
Boolp finalprevHud = prevHud;
26+
parent.find("waves").visible( () -> hide() && finalprevHud.get());
27+
}
28+
29+
if(prevMap == null) prevMap = () -> false;
30+
Boolp finalprevMap = prevMap;
31+
parent.find("minimap/position").visible( () -> hide() && finalprevMap.get());
32+
33+
parent.fill( p -> {
34+
p.name = "biotech-bossbar";
35+
p.align(Align.top).setFillParent(true);
36+
p.add(bossBar).visible(true); //<- replace with the unit detection
37+
});
38+
}
39+
40+
public void build(){
41+
bossBar.clear();;
42+
Bar bar = new Bar(
43+
() -> ">m< ow",
44+
() -> Pal.heal,
45+
() -> Vars.player.unit() != null ? Vars.player.unit().healthf() : 0f //<- replace this with the actually unit(s)
46+
){
47+
@Override
48+
public void draw(){
49+
//replace this with ur gorry image -rushie
50+
super.draw();
51+
}
52+
};
53+
bossBar.add(bar).minWidth(Core.graphics.getWidth() * 0.85f).minHeight(50f).pad(5f);
54+
55+
}
56+
}

0 commit comments

Comments
 (0)