Skip to content

Commit

Permalink
Softbush (this isn't the best bush out there) and luminium ore editor…
Browse files Browse the repository at this point in the history
… fix
  • Loading branch information
Slotterleet committed Sep 22, 2023
1 parent e6847e7 commit 5476bca
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
Binary file added core/res/sprites/blocks/environment/softbush1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/res/sprites/blocks/environment/softbush2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/res/sprites/blocks/environment/softbush3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions core/src/fos/content/FOSBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public class FOSBlocks {
alienMoss,
oreTin, oreTinSurface, oreSilver, oreLithium, oreDiamond, oreVanadium, oreIridium, oreLuminium,
bugSpawn,
//props
softbush,
//units
upgradeCenter, hovercraftFactory, droidConstructor,
//storage
Expand Down Expand Up @@ -1159,6 +1161,12 @@ protected boolean canPump(Tile tile) {
size = 3;
interval = 20 * 60;
}};

softbush = new Prop("softbush"){{
variants = 3;
blublu.asFloor().decoration = this;
breakSound = Sounds.plantBreak;
}};
//endregion
//region units
upgradeCenter = new UpgradeCenter("upgrade-center"){{
Expand Down
21 changes: 17 additions & 4 deletions core/src/fos/type/blocks/environment/AnimatedOreBlock.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package fos.type.blocks.environment;

import arc.Events;
import arc.graphics.Color;
import arc.graphics.Texture;
import arc.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.graphics.gl.Shader;
import arc.math.Mathf;
Expand All @@ -13,7 +12,7 @@
import mindustry.Vars;
import mindustry.content.Blocks;
import mindustry.game.EventType;
import mindustry.graphics.*;
import mindustry.graphics.Drawf;
import mindustry.world.Tile;
import mindustry.world.blocks.environment.OreBlock;

Expand Down Expand Up @@ -47,6 +46,19 @@ public void load() {
}
}

//overridden to prevent crashes. FIXME: actual regions are fucked up
@Override
public TextureRegion[] editorVariantRegions() {
if (editorVariantRegions == null) {
variantRegions();
editorVariantRegions = new TextureRegion[variantRegions.length];
for (int i = 1; i <= variantRegions.length; i++) {
editorVariantRegions[i-1] = Core.atlas.find(name + "-" + i + "-2");
}
}
return editorVariantRegions;
}

@Override
public void drawBase(Tile tile) {

Expand Down Expand Up @@ -84,6 +96,7 @@ public boolean updateRender(Tile tile) {
public abstract static class DrawRequest {
public static Seq<DrawRequest> requests = new Seq<>();
static {

Events.run(EventType.Trigger.postDraw, () -> requests.clear());
Events.run(EventType.Trigger.draw, () -> requests.each(DrawRequest::draw));
}
Expand Down

0 comments on commit 5476bca

Please sign in to comment.