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

Maw #24

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ buildscript{
plugins{
java
id("com.github.GglLfr.EntityAnno") apply false
id("com.xpdustry.toxopid") version "4.1.0"
}

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

fun toxopid(module: String): String{
return "com.xpdustry.toxopid.spec.ModPlatform"
}

toxopid {
compileVersion = mindustryVersion
runtimeVersion = mindustryVersion
}

allprojects{
apply(plugin = "java")
sourceSets["main"].java.setSrcDirs(listOf(layout.projectDirectory.dir("src")))
Expand Down
10 changes: 8 additions & 2 deletions src/biotech/BioEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import arc.util.Log;
import arc.util.Reflect;
import biotech.content.BioFx;
import biotech.ui.BioResearchDialog;
import biotech.type.unit.*;
import biotech.ui.*;
import biotech.world.blocks.enviroment.BiologicalStaticSpawner;
import mindustry.Vars;
import mindustry.game.EventType;
import mindustry.game.*;
import mindustry.gen.Building;
import mindustry.gen.Groups;
import mindustry.ui.fragments.MenuFragment;
Expand All @@ -29,6 +30,11 @@ public static void init() {
}
});

Events.on(EventType.WaveEvent.class, event -> {
if(Vars.state.rules.spawns.contains( w -> w.type instanceof ShomeretUnitType)) BioVars.shomeretUI.begin();
});

Events.on(EventType.WorldLoadEvent.class, you -> BioVars.postInit());
Events.on(EventType.ClientLoadEvent.class, world -> BioVars.load());
}
}
1 change: 1 addition & 0 deletions src/biotech/BioTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static void loadMusic() {

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

t.pref(new ButtonPref(bundle.get("setting.biotech-clear-tech-tree"), Icon.trash,() -> {
ui.showConfirm("@confirm", bundle.get("setting.biotech-clear-tech-tree.confirm"), () -> {
Expand Down
13 changes: 10 additions & 3 deletions src/biotech/BioVars.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
package biotech;

import biotech.ui.ShomeretUI;
import biotech.type.unit.*;
import biotech.ui.*;
import mindustry.Vars;

public class BioVars {
public static ShomeretUI shomeretUI = new ShomeretUI();
public static ShomeretUI shomeretUI = new ShomeretUI();
public static BioBossBarFragment bossBar = new BioBossBarFragment();

public static void postInit() {
public static void load(){
bossBar.load(Vars.ui.hudGroup);
shomeretUI.build(Vars.ui.hudGroup);
}

public static void postInit() {
bossBar.build();
}
}
6 changes: 0 additions & 6 deletions src/biotech/type/unit/ShomeretUnitType.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class ShomeretUnitType extends BiologicalUnitType {
public static int state;
public static UnitType ima;

boolean cutsceneFinished = false;
int spawnCooldown = 10 * 60;

public ShomeretUnitType(String name) {
Expand Down Expand Up @@ -112,11 +111,6 @@ public void init() {
public void update(Unit unit) {
super.update(unit);

if (!cutsceneFinished) {
BioVars.shomeretUI.begin();
cutsceneFinished = true;
}

if (unit.health < unit.maxHealth / 2 && state == 0) state = 1;

//ima shitter
Expand Down
56 changes: 56 additions & 0 deletions src/biotech/ui/BioBossBarFragment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package biotech.ui;

import arc.*;
import arc.func.*;
import arc.graphics.g2d.*;
import arc.scene.*;
import arc.scene.ui.layout.*;
import arc.util.*;
import mindustry.*;
import mindustry.graphics.*;
import mindustry.ui.*;


public class BioBossBarFragment {
public Table bossBar = new Table();

public boolean hide(){
return !Core.settings.getBool("biotech-bossbar-hides-menu", true);
}

public void load(Group parent){
Boolp prevHud = Vars.ui.hudGroup.find("waves").visibility, prevMap = Vars.ui.hudGroup.find("minimap/position").visibility;
if(!Vars.mobile){ //dont softlock mobile players
if(prevHud == null) prevHud = () -> false;
Boolp finalprevHud = prevHud;
parent.find("waves").visible( () -> hide() && finalprevHud.get());
}

if(prevMap == null) prevMap = () -> false;
Boolp finalprevMap = prevMap;
parent.find("minimap/position").visible( () -> hide() && finalprevMap.get());

parent.fill( p -> {
p.name = "biotech-bossbar";
p.align(Align.top).setFillParent(true);
p.add(bossBar).visible(true); //<- replace with the unit detection
});
}

public void build(){
bossBar.clear();;
Bar bar = new Bar(
() -> ">m< ow",
() -> Pal.heal,
() -> Vars.player.unit() != null ? Vars.player.unit().healthf() : 0f //<- replace this with the actually unit(s)
){
@Override
public void draw(){
//replace this with ur gorry image -rushie
super.draw();
}
};
bossBar.add(bar).minWidth(Core.graphics.getWidth() * 0.85f).minHeight(50f).pad(5f);

}
}